From a5663a8bb23099c5a6d26859215401b9c52ee1c1 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Fri, 5 Jun 2026 01:29:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor(web):=20=E6=96=87=E4=BB=B6/=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=9B=BE=E6=A0=87=E7=BB=9F=E4=B8=80=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20FileTypeIcon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 文件预览、工作区文件列表、侧边栏文件树、知识库 FileTable、上传弹窗、 @mention、附件预览等处统一渲染彩色文件/文件夹图标 - 移除 file_utils 旧的 Ant 单色图标映射与 mention_icon_utils 的 file 分支 - 清理各组件因替换产生的孤儿图标导入;按钮图标保持不变 --- web/src/components/AgentArtifactsCard.vue | 8 +- web/src/components/AgentChatComponent.vue | 23 ++--- web/src/components/AgentFilePreview.vue | 8 +- web/src/components/AgentInputArea.vue | 5 +- web/src/components/AgentMessageComponent.vue | 5 +- web/src/components/AgentPanel.vue | 8 +- .../components/AttachmentTmpUploadModal.vue | 6 +- web/src/components/FileDetailModal.vue | 8 +- web/src/components/FileTable.vue | 23 ++--- web/src/components/FileTreeComponent.vue | 13 +-- web/src/components/FileUploadModal.vue | 7 +- web/src/components/MessageInputComponent.vue | 38 +++++--- .../components/common/MentionTextRenderer.vue | 9 ++ .../workspace/WorkspaceFileList.vue | 17 +--- web/src/utils/file_utils.js | 93 +------------------ web/src/utils/mention_icon_utils.js | 17 +--- 16 files changed, 82 insertions(+), 206 deletions(-) diff --git a/web/src/components/AgentArtifactsCard.vue b/web/src/components/AgentArtifactsCard.vue index 71cd9ab2..117b9960 100644 --- a/web/src/components/AgentArtifactsCard.vue +++ b/web/src/components/AgentArtifactsCard.vue @@ -7,11 +7,7 @@ :title="`打开 ${file.name}`" @click="openPreview(file)" > - +
{{ file.name }}
{{ getFileMetaLabel(file.path) }}
@@ -41,7 +37,7 @@ import { computed, ref } from 'vue' import { message } from 'ant-design-vue' import { Download, LoaderCircle, Save } from 'lucide-vue-next' import { threadApi } from '@/apis/agent_api' -import { getFileIcon, getFileIconColor } from '@/utils/file_utils' +import FileTypeIcon from '@/components/common/FileTypeIcon.vue' import { downloadViewerFile } from '@/apis/viewer_filesystem' const props = defineProps({ diff --git a/web/src/components/AgentChatComponent.vue b/web/src/components/AgentChatComponent.vue index fffd9885..0dfd106f 100644 --- a/web/src/components/AgentChatComponent.vue +++ b/web/src/components/AgentChatComponent.vue @@ -246,10 +246,10 @@
-
{{ file.name }}
@@ -274,10 +274,10 @@ :title="`打开 ${file.name}`" @click="openPanelPreview(file)" > -
{{ file.name }}
@@ -362,7 +362,8 @@ import { } from 'vue' import { message } from 'ant-design-vue' import { RefreshCw, SquareCheck } from 'lucide-vue-next' -import { getFileIcon, getFileIconColor, formatFileSize } from '@/utils/file_utils' +import { formatFileSize } from '@/utils/file_utils' +import FileTypeIcon from '@/components/common/FileTypeIcon.vue' import { generatePixelAvatar } from '@/utils/pixelAvatar' import { CheckCircleOutlined, @@ -720,9 +721,7 @@ const currentArtifactFiles = computed(() => .map((path) => ({ path, name: getPanelFileName({ path }), - meta: getArtifactMetaLabel(path), - icon: getFileIcon(path), - iconColor: getFileIconColor(path) + meta: getArtifactMetaLabel(path) })) ) const currentTodos = computed(() => { @@ -780,9 +779,7 @@ const currentStateFiles = computed(() => { key: path, path, name, - meta: [status, sizeLabel === '-' ? '' : sizeLabel, path].filter(Boolean).join(' · '), - icon: getFileIcon(name || path), - iconColor: getFileIconColor(name || path) + meta: [status, sizeLabel === '-' ? '' : sizeLabel, path].filter(Boolean).join(' · ') }) } diff --git a/web/src/components/AgentFilePreview.vue b/web/src/components/AgentFilePreview.vue index c3678426..a7fa9bcb 100644 --- a/web/src/components/AgentFilePreview.vue +++ b/web/src/components/AgentFilePreview.vue @@ -5,11 +5,7 @@ >
- + {{ filePath }}