From 06f6de577b99719f6150442a0b72d7674d466482 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 29 Jan 2026 15:21:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(KnowledgeManagement):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=9F=A5=E8=AF=86=E5=BA=93=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除未使用的 Tag 组件导入 - 将文件标题列改为文件名列,并调整数据源为 sourceFileId - 修改文件名显示逻辑,统一返回 "文件" 作为默认值 - 移除负责人列的显示 - 更新搜索框占位符文本为 "搜索文件名或内容" - 调整文件名列宽度从 220px 增加到 260px - 优化文件名解析逻辑,根据文件类型返回对应的预览文件名 --- .../Detail/KnowledgeSetDetail.tsx | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx b/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx index d9a1294..3d980cf 100644 --- a/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx +++ b/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx @@ -8,7 +8,6 @@ import { Empty, Modal, Table, - Tag, Tooltip, } from "antd"; import { DeleteOutlined, DownloadOutlined, EditOutlined, EyeOutlined, PlusOutlined } from "@ant-design/icons"; @@ -148,7 +147,7 @@ const KnowledgeSetDetail = () => { return lastSegment; } } - return record.title || "文件"; + return "文件"; }; const handlePreviewItemFile = async (record: KnowledgeItemView) => { @@ -268,21 +267,21 @@ const KnowledgeSetDetail = () => { const itemColumns = [ { - title: "标题", - dataIndex: "title", - key: "title", + title: "文件名", + dataIndex: "sourceFileId", + key: "sourceFileId", fixed: "left" as const, - width: 220, + width: 260, ellipsis: true, - }, - { - title: "状态", - dataIndex: "status", - key: "status", - width: 120, - render: (status: KnowledgeItemView["status"]) => ( - {status?.label} - ), + render: (_: string, record: KnowledgeItemView) => { + if ( + record.contentType === KnowledgeContentType.FILE || + record.sourceType === KnowledgeSourceType.FILE_UPLOAD + ) { + return resolvePreviewFileName(record); + } + return record.sourceFileId || "-"; + }, }, { title: "类型", @@ -293,13 +292,6 @@ const KnowledgeSetDetail = () => { knowledgeContentTypeOptions.find((opt) => opt.value === contentType)?.label || contentType, }, - { - title: "负责人", - dataIndex: "owner", - key: "owner", - width: 120, - ellipsis: true, - }, { title: "来源", dataIndex: "sourceType", @@ -474,7 +466,7 @@ const KnowledgeSetDetail = () => { setSearchParams({ ...searchParams, filter: { type: [], status: [], tags: [] } })}