feat(frontend): 统一界面图标体系

This commit is contained in:
2026-08-30 09:57:04 +08:00
parent bba3041867
commit c33610a295
14 changed files with 321 additions and 36 deletions
@@ -1,5 +1,7 @@
<script setup lang="ts">
import type { FileNode } from '@/contracts'
import { Document, Folder, FolderOpened } from '@element-plus/icons-vue'
import AppIcon from '@/components/common/AppIcon.vue'
defineProps<{ node: FileNode; activePath: string | null }>()
const emit = defineEmits<{
@@ -12,7 +14,7 @@ const emit = defineEmits<{
<div>
<div class="tree-node" :class="{ active: node.path === activePath }"
@click="emit('open', node)" @contextmenu="emit('contextMenu', $event, node)">
<span>{{ node.type === 'folder' ? (node.is_open ? '📂' : '📁') : '📄' }}</span>
<AppIcon :icon="node.type === 'folder' ? (node.is_open ? FolderOpened : Folder) : Document" :size="16" />
<span class="name">{{ node.name }}</span>
<span v-if="node.is_dirty"></span>
</div>
@@ -6,6 +6,8 @@ import * as workspaceService from '@/services/workspaceService'
import { useEditorStore } from '@/stores/editor'
import { useWorkspaceStore } from '@/stores/workspace'
import FileTreeNode from './FileTreeNode.vue'
import { DocumentAdd, FolderAdd } from '@element-plus/icons-vue'
import AppIcon from '@/components/common/AppIcon.vue'
const workspaceStore = useWorkspaceStore()
const editorStore = useEditorStore()
@@ -90,8 +92,8 @@ async function deleteTarget() {
<template>
<section class="file-tree-panel" @click="closeContextMenu">
<div class="toolbar">
<button type="button" title="新建笔记" @click.stop="beginCreate('file')">📄</button>
<button type="button" title="新建文件夹" @click.stop="beginCreate('folder')">📁</button>
<button type="button" title="新建笔记" aria-label="新建笔记" @click.stop="beginCreate('file')"><AppIcon :icon="DocumentAdd" /></button>
<button type="button" title="新建文件夹" aria-label="新建文件夹" @click.stop="beginCreate('folder')"><AppIcon :icon="FolderAdd" /></button>
</div>
<form v-if="newItemType" class="new-item" @submit.prevent="createItem">
<input v-model="newItemName" :placeholder="newItemType === 'file' ? '笔记名称' : '文件夹名称'" autofocus />
@@ -4,6 +4,8 @@ import { useWorkspaceStore } from '@/stores/workspace'
import { useEditorStore } from '@/stores/editor'
import EditorHeader from '@/features/editor/EditorHeader.vue'
import EditorPane from '@/features/editor/EditorPane.vue'
import { EditPen } from '@element-plus/icons-vue'
import AppIcon from '@/components/common/AppIcon.vue'
const workspaceStore = useWorkspaceStore()
const editorStore = useEditorStore()
@@ -28,7 +30,7 @@ onMounted(() => {
</template>
<div v-else class="empty-workspace">
<div class="empty-content">
<div class="empty-icon">📝</div>
<AppIcon class="empty-icon" :icon="EditPen" :size="48" />
<h2>开始写作</h2>
<p>从左侧文件树选择笔记或创建新的笔记</p>
</div>