diff --git a/ui/src/api/knowledge/document.ts b/ui/src/api/knowledge/document.ts index 94f8bc782..f841e5517 100644 --- a/ui/src/api/knowledge/document.ts +++ b/ui/src/api/knowledge/document.ts @@ -374,8 +374,8 @@ const postQADocument: ( * 分段预览(上传文档) * @param 参数 file:file,limit:number,patterns:array,with_filter:boolean */ -const postSplitDocument: (data: any) => Promise> = (data) => { - return post(`${prefix.value}/document/split`, data, undefined, undefined, 1000 * 60 * 60) +const postSplitDocument: (data: any, id: string) => Promise> = (data, id) => { + return post(`${prefix.value}/${id}/document/split`, data, undefined, undefined, 1000 * 60 * 60) } /** diff --git a/ui/src/api/knowledge/knowledge.ts b/ui/src/api/knowledge/knowledge.ts index fb28d0ba3..bd8b44261 100644 --- a/ui/src/api/knowledge/knowledge.ts +++ b/ui/src/api/knowledge/knowledge.ts @@ -232,11 +232,8 @@ const getKnowledgeEmdeddingModel: ( * @query { query_text: string, top_number: number, similarity: number } * @returns */ -const getKnowledgeModel: ( - knowledge_id: string, - loading?: Ref, -) => Promise>> = (knowledge_id, loading) => { - return get(`${prefix.value}/${knowledge_id}/model`, loading) +const getKnowledgeModel: (loading?: Ref) => Promise>> = (loading) => { + return get(`${prefix.value}/model`, loading) } /** diff --git a/ui/src/api/shared/knowledge.ts b/ui/src/api/shared/knowledge.ts index 4bd92e7a0..2a5b6d0e2 100644 --- a/ui/src/api/shared/knowledge.ts +++ b/ui/src/api/shared/knowledge.ts @@ -226,11 +226,8 @@ const getKnowledgeEmdeddingModel: ( * @query { query_text: string, top_number: number, similarity: number } * @returns */ -const getKnowledgeModel: ( - knowledge_id: string, - loading?: Ref, -) => Promise>> = (knowledge_id, loading) => { - return get(`${prefix}/${knowledge_id}/model`, loading) +const getKnowledgeModel: (loading?: Ref) => Promise>> = (loading) => { + return get(`${prefix}/knowledge/model`, loading) } /** diff --git a/ui/src/components/generate-related-dialog/index.vue b/ui/src/components/generate-related-dialog/index.vue index 7bb3a3d47..c1977fb44 100644 --- a/ui/src/components/generate-related-dialog/index.vue +++ b/ui/src/components/generate-related-dialog/index.vue @@ -188,7 +188,7 @@ const submitHandle = async (formEl: FormInstance) => { function getModel() { loading.value = true knowledgeApi - .getKnowledgeModel(id ? id : knowledgeId.value) + .getKnowledgeModel() .then((res: any) => { modelOptions.value = groupBy(res?.data, 'provider') loading.value = false diff --git a/ui/src/components/generate-related-shared-dialog/index.vue b/ui/src/components/generate-related-shared-dialog/index.vue new file mode 100644 index 000000000..b513492a7 --- /dev/null +++ b/ui/src/components/generate-related-shared-dialog/index.vue @@ -0,0 +1,203 @@ + + + diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index 94553facf..51381ff9b 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -602,9 +602,11 @@ const title = ref('') const selectKnowledgeDialogRef = ref() const exportDocument = (document: any) => { - documentApi.exportDocument(document.name, document.knowledge_id, document.id, loading).then(() => { - MsgSuccess(t('common.exportSuccess')) - }) + documentApi + .exportDocument(document.name, document.knowledge_id, document.id, loading) + .then(() => { + MsgSuccess(t('common.exportSuccess')) + }) } const exportDocumentZip = (document: any) => { documentApi @@ -712,8 +714,7 @@ const closeInterval = () => { } function syncDocument(row: any) { - console.log('row', row) - if (row.type === '1') { + if (+row.type === 1) { syncWebDocument(row) } else { syncLarkDocument(row) diff --git a/ui/src/views/document/upload/SetRules.vue b/ui/src/views/document/upload/SetRules.vue index 840a4dfc3..6dccd94d2 100644 --- a/ui/src/views/document/upload/SetRules.vue +++ b/ui/src/views/document/upload/SetRules.vue @@ -121,6 +121,7 @@