Skip to content

Commit 85138e4

Browse files
feat: document
1 parent 45908b9 commit 85138e4

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

ui/src/api/knowledge/document.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const delDocument: (
7878

7979
/**
8080
* 批量取消文档任务
81-
* @param 参数 knowledge_id, document_id,
81+
* @param 参数 knowledge_id,
8282
*{
8383
"id_list": [
8484
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -89,12 +89,11 @@ const delDocument: (
8989

9090
const putBatchCancelTask: (
9191
knowledge_id: string,
92-
document_id: string,
9392
data: any,
9493
loading?: Ref<boolean>,
95-
) => Promise<Result<boolean>> = (knowledge_id, document_id, data, loading) => {
94+
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
9695
return put(
97-
`${prefix.value}/${knowledge_id}/document/${document_id}/batch_cancel_task`,
96+
`${prefix.value}/${knowledge_id}/document/batch_cancel_task`,
9897
data,
9998
undefined,
10099
loading,

ui/src/api/resource-management/document.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const delDocument: (
7171

7272
/**
7373
* 批量取消文档任务
74-
* @param 参数 knowledge_id, document_id,
74+
* @param 参数 knowledge_id,
7575
*{
7676
"id_list": [
7777
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -85,7 +85,7 @@ const putBatchCancelTask: (
8585
data: any,
8686
loading?: Ref<boolean>,
8787
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
88-
return put(`${prefix}/${knowledge_id}/document/cancel_task/_batch`, data, undefined, loading)
88+
return put(`${prefix}/${knowledge_id}/document/batch_cancel_task`, data, undefined, loading)
8989
}
9090

9191
/**
@@ -367,7 +367,7 @@ const postQADocument: (
367367
* 分段预览(上传文档)
368368
* @param 参数 file:file,limit:number,patterns:array,with_filter:boolean
369369
*/
370-
const postSplitDocument: (data: any, id:string) => Promise<Result<any>> = (data, id) => {
370+
const postSplitDocument: (data: any, id: string) => Promise<Result<any>> = (data, id) => {
371371
return post(`${prefix}/${id}/document/split`, data, undefined, undefined, 1000 * 60 * 60)
372372
}
373373

ui/src/api/shared/document.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const delDocument: (
7171

7272
/**
7373
* 批量取消文档任务
74-
* @param 参数 knowledge_id, document_id,
74+
* @param 参数 knowledge_id,
7575
*{
7676
"id_list": [
7777
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
@@ -82,12 +82,11 @@ const delDocument: (
8282

8383
const putBatchCancelTask: (
8484
knowledge_id: string,
85-
document_id: string,
8685
data: any,
8786
loading?: Ref<boolean>,
88-
) => Promise<Result<boolean>> = (knowledge_id, document_id, data, loading) => {
87+
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
8988
return put(
90-
`${prefix}/${knowledge_id}/document/${document_id}/batch_cancel_task`,
89+
`${prefix}/${knowledge_id}/document/batch_cancel_task`,
9190
data,
9291
undefined,
9392
loading,

ui/src/views/document/index.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@
580580
<div class="mul-operation w-full flex" v-if="multipleSelection.length !== 0">
581581
<el-button
582582
:disabled="multipleSelection.length === 0"
583-
@click="cancelTaskHandle(1, row)"
583+
@click="cancelTaskHandle(1)"
584584
v-hasPermission="[
585585
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
586586
PermissionConst.KNOWLEDGE_DOCUMENT_VECTOR.getWorkspacePermission,
@@ -590,7 +590,7 @@
590590
</el-button>
591591
<el-button
592592
:disabled="multipleSelection.length === 0"
593-
@click="cancelTaskHandle(2, row)"
593+
@click="cancelTaskHandle(2)"
594594
v-hasPermission="[
595595
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
596596
PermissionConst.KNOWLEDGE_DOCUMENT_GENERATE.getWorkspacePermission,
@@ -705,7 +705,7 @@ const exportDocumentZip = (document: any) => {
705705
})
706706
}
707707
708-
function cancelTaskHandle(val: any, row: any) {
708+
function cancelTaskHandle(val: any) {
709709
const arr: string[] = []
710710
multipleSelection.value.map((v) => {
711711
if (v) {
@@ -716,7 +716,7 @@ function cancelTaskHandle(val: any, row: any) {
716716
id_list: arr,
717717
type: val,
718718
}
719-
documentApi.putBatchCancelTask(id, row.id, obj, loading).then(() => {
719+
documentApi.putBatchCancelTask(id, obj, loading).then(() => {
720720
MsgSuccess(t('views.document.tip.cancelSuccess'))
721721
multipleTableRef.value?.clearSelection()
722722
})
@@ -1081,9 +1081,7 @@ onBeforeUnmount(() => {
10811081
})
10821082
</script>
10831083
<style lang="scss" scoped>
1084-
.document-main {
1085-
box-sizing: border-box;
1086-
1084+
.document {
10871085
.mul-operation {
10881086
position: fixed;
10891087
margin-left: var(--sidebar-width);

ui/src/views/shared/document-shared/index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@
511511
</div>
512512
</el-card>
513513
<div class="mul-operation w-full flex" v-if="multipleSelection.length !== 0">
514-
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(1, row)">
514+
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(1)">
515515
{{ $t('views.document.setting.cancelVectorization') }}
516516
</el-button>
517-
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(2, row)">
517+
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(2)">
518518
{{ $t('views.document.setting.cancelGenerate') }}
519519
</el-button>
520520
<el-text type="info" class="secondary ml-24">
@@ -622,7 +622,7 @@ const exportDocumentZip = (document: any) => {
622622
})
623623
}
624624
625-
function cancelTaskHandle(val: any, row: any) {
625+
function cancelTaskHandle(val: any) {
626626
const arr: string[] = []
627627
multipleSelection.value.map((v) => {
628628
if (v) {
@@ -633,7 +633,7 @@ function cancelTaskHandle(val: any, row: any) {
633633
id_list: arr,
634634
type: val,
635635
}
636-
documentApi.putBatchCancelTask(id, row.id, obj, loading).then(() => {
636+
documentApi.putBatchCancelTask(id, obj, loading).then(() => {
637637
MsgSuccess(t('views.document.tip.cancelSuccess'))
638638
multipleTableRef.value?.clearSelection()
639639
})

0 commit comments

Comments
 (0)