From 72d9833038690b8062a59fc586f82a78d70ee29d Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 19 Jun 2025 20:32:02 +0800 Subject: [PATCH] feat: paragraph --- ui/src/api/knowledge/document.ts | 26 ++++-- ui/src/api/knowledge/paragraph.ts | 5 ++ .../generate-related-dialog/index.vue | 1 + ui/src/locales/lang/en-US/views/document.ts | 63 ++++++------- ui/src/locales/lang/zh-CN/views/document.ts | 1 + ui/src/locales/lang/zh-Hant/views/document.ts | 57 ++++++------ ui/src/stores/modules/document.ts | 4 +- .../component/SelectKnowledgeDialog.vue | 37 ++++---- .../paragraph/component/ParagraphCard.vue | 34 +++---- .../paragraph/component/ParagraphDialog.vue | 18 ++-- .../component/SelectDocumentDialog.vue | 90 ++++++++++++------- ui/src/views/paragraph/index.vue | 33 ++++--- 12 files changed, 213 insertions(+), 156 deletions(-) diff --git a/ui/src/api/knowledge/document.ts b/ui/src/api/knowledge/document.ts index cfd8ae517..0d5aa1860 100644 --- a/ui/src/api/knowledge/document.ts +++ b/ui/src/api/knowledge/document.ts @@ -14,13 +14,29 @@ Object.defineProperty(prefix, 'value', { }) /** - * 文档分页列表 + * 文档列表(无分页) * @param 参数 knowledge_id, * param { " name": "string", } */ +const getDocumentList: (knowledge_id: string, loading?: Ref) => Promise> = ( + knowledge_id, + loading, +) => { + return get(`${prefix.value}/${knowledge_id}/document`, undefined, loading) +} + +/** + * 文档分页列表 + * @param 参数 knowledge_id, + * param { + "name": "string", + folder_id: "string", + } + */ + const getDocumentPage: ( knowledge_id: string, page: pageRequest, @@ -549,15 +565,9 @@ const importLarkDocument: ( return post(`${prefix.value}/lark/${knowledge_id}/import`, data, null, loading) } -// todo -const getAllDocument: (knowledge_id: string, loading?: Ref) => Promise> = ( - knowledge_id, - loading, -) => { - return get(`${prefix.value}/${knowledge_id}/document`, undefined, loading) -} export default { + getDocumentList, getDocumentPage, getDocumentDetail, putDocument, diff --git a/ui/src/api/knowledge/paragraph.ts b/ui/src/api/knowledge/paragraph.ts index e1287cb06..35aa5cfad 100644 --- a/ui/src/api/knowledge/paragraph.ts +++ b/ui/src/api/knowledge/paragraph.ts @@ -239,6 +239,11 @@ const putBatchGenerateRelated: ( /** * 批量迁移段落 * @param 参数 knowledge_id,target_knowledge_id, + * { + "id_list": [ + "3fa85f64-5717-4562-b3fc-2c963f66afa6" + ] + } */ const putMigrateMulParagraph: ( knowledge_id: string, diff --git a/ui/src/components/generate-related-dialog/index.vue b/ui/src/components/generate-related-dialog/index.vue index a98ee255f..c1d5b8417 100644 --- a/ui/src/components/generate-related-dialog/index.vue +++ b/ui/src/components/generate-related-dialog/index.vue @@ -5,6 +5,7 @@ width="650" :close-on-click-modal="false" :close-on-press-escape="false" + @click.stop >
({}), actions: { - async asyncGetAllDocument(id: string, loading?: Ref) { + async asyncGetKnowledgeDocument(id: string, loading?: Ref) { return new Promise((resolve, reject) => { documentApi - .getAllDocument(id, loading) + .getDocumentList(id, loading) .then((res) => { resolve(res) }) diff --git a/ui/src/views/document/component/SelectKnowledgeDialog.vue b/ui/src/views/document/component/SelectKnowledgeDialog.vue index f42d996a2..4b51ad42f 100644 --- a/ui/src/views/document/component/SelectKnowledgeDialog.vue +++ b/ui/src/views/document/component/SelectKnowledgeDialog.vue @@ -1,29 +1,22 @@