From 49b7f2a64cc8a0ea64475f1fee9511b10c2359c0 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 29 Jan 2026 15:00:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor(KnowledgeManagement):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=9F=A5=E8=AF=86=E9=9B=86=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=87=E4=BB=B6=E8=AE=B0=E5=BD=95=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将重复的条件判断提取为变量 isFileRecord - 使用立即执行函数简化 JSX 结构 - 统一文件类型记录的操作按钮渲染方式 - 提高代码可读性和维护性 --- .../Detail/KnowledgeSetDetail.tsx | 83 +++++++++++-------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx b/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx index 56b8f51..d9a1294 100644 --- a/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx +++ b/frontend/src/pages/KnowledgeManagement/Detail/KnowledgeSetDetail.tsx @@ -335,41 +335,54 @@ const KnowledgeSetDetail = () => { /> )} - {(record.contentType === KnowledgeContentType.FILE || - record.sourceType === KnowledgeSourceType.FILE_UPLOAD) && ( - -