From 56d6a992f86e8ac104b654941dfffaf286c6e748 Mon Sep 17 00:00:00 2001 From: Chuck1sn Date: Sat, 28 Jun 2025 08:12:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9F=A5=E8=AF=86=E5=BA=93?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=8C=85=E6=8B=AC?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=8D=A1=E7=89=87=E3=80=81=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E5=BA=93=E5=8D=A1=E7=89=87=E3=80=81=E7=8A=B6=E6=80=81=E5=BE=BD?= =?UTF-8?q?=E7=AB=A0=E5=92=8C=E5=88=86=E6=AE=B5=E5=8D=A1=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=AE=A1=E7=90=86=E5=92=8C=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E5=BA=93=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E4=BB=A5=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B0=E7=BB=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/knowledge/KnowledgeDocCard.vue | 36 ++++++++ .../common/knowledge/KnowledgeLibraryCard.vue | 30 ++++++ .../common/knowledge/KnowledgeStatusBadge.vue | 37 ++++++++ .../common/knowledge/SegmentCard.vue | 34 +++++++ .../src/components/common/knowledge/index.ts | 11 +++ frontend/src/utils/dateUtil.ts | 7 +- .../src/views/KnowledgeDocManagementPage.vue | 92 ++++++------------- .../src/views/KnowledgeManagementPage.vue | 71 +++++++------- frontend/src/views/KnowledgeSegmentsPage.vue | 31 +------ 9 files changed, 220 insertions(+), 129 deletions(-) create mode 100644 frontend/src/components/common/knowledge/KnowledgeDocCard.vue create mode 100644 frontend/src/components/common/knowledge/KnowledgeLibraryCard.vue create mode 100644 frontend/src/components/common/knowledge/KnowledgeStatusBadge.vue create mode 100644 frontend/src/components/common/knowledge/SegmentCard.vue create mode 100644 frontend/src/components/common/knowledge/index.ts diff --git a/frontend/src/components/common/knowledge/KnowledgeDocCard.vue b/frontend/src/components/common/knowledge/KnowledgeDocCard.vue new file mode 100644 index 0000000..6a776a5 --- /dev/null +++ b/frontend/src/components/common/knowledge/KnowledgeDocCard.vue @@ -0,0 +1,36 @@ + + + diff --git a/frontend/src/components/common/knowledge/KnowledgeLibraryCard.vue b/frontend/src/components/common/knowledge/KnowledgeLibraryCard.vue new file mode 100644 index 0000000..56f77f6 --- /dev/null +++ b/frontend/src/components/common/knowledge/KnowledgeLibraryCard.vue @@ -0,0 +1,30 @@ + + + diff --git a/frontend/src/components/common/knowledge/KnowledgeStatusBadge.vue b/frontend/src/components/common/knowledge/KnowledgeStatusBadge.vue new file mode 100644 index 0000000..5821252 --- /dev/null +++ b/frontend/src/components/common/knowledge/KnowledgeStatusBadge.vue @@ -0,0 +1,37 @@ + + + diff --git a/frontend/src/components/common/knowledge/SegmentCard.vue b/frontend/src/components/common/knowledge/SegmentCard.vue new file mode 100644 index 0000000..177f83d --- /dev/null +++ b/frontend/src/components/common/knowledge/SegmentCard.vue @@ -0,0 +1,34 @@ + + + diff --git a/frontend/src/components/common/knowledge/index.ts b/frontend/src/components/common/knowledge/index.ts new file mode 100644 index 0000000..1bfbc99 --- /dev/null +++ b/frontend/src/components/common/knowledge/index.ts @@ -0,0 +1,11 @@ +import KnowledgeDocCard from "./KnowledgeDocCard.vue"; +import KnowledgeLibraryCard from "./KnowledgeLibraryCard.vue"; +import KnowledgeStatusBadge from "./KnowledgeStatusBadge.vue"; +import SegmentCard from "./SegmentCard.vue"; + +export { + KnowledgeStatusBadge, + KnowledgeDocCard, + KnowledgeLibraryCard, + SegmentCard, +}; diff --git a/frontend/src/utils/dateUtil.ts b/frontend/src/utils/dateUtil.ts index 1fc88cf..ea18120 100644 --- a/frontend/src/utils/dateUtil.ts +++ b/frontend/src/utils/dateUtil.ts @@ -13,4 +13,9 @@ const formatDate = (date?: Date) => { return dayjs(date).format("YYYY-MM-DDTHH:mm:ss.SSSZ"); }; -export { dayjs, formatDate }; +const formatDateString = (dateString?: string, format = "YYYY-MM-DD HH:mm") => { + if (!dateString) return "未知"; + return dayjs(dateString).format(format); +}; + +export { dayjs, formatDate, formatDateString }; diff --git a/frontend/src/views/KnowledgeDocManagementPage.vue b/frontend/src/views/KnowledgeDocManagementPage.vue index de84fb3..1cf017d 100644 --- a/frontend/src/views/KnowledgeDocManagementPage.vue +++ b/frontend/src/views/KnowledgeDocManagementPage.vue @@ -5,63 +5,36 @@

{{ currentLibrary?.name || '知识库' }} - 文档管理

-
-
-
-
-
-
{{ doc.name }}
-
- - {{ doc.status === DocStatus.SUCCESS ? '解析完成' : '解析中' }} - - - {{ doc.enable ? '已启用' : '已禁用' }} - -
+ +
+ + + +
-
-
暂无文档
+ + +
+
暂无文档
@@ -84,11 +57,11 @@