feat: document
This commit is contained in:
parent
45908b91ff
commit
85138e4e2b
@ -78,7 +78,7 @@ const delDocument: (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消文档任务
|
* 批量取消文档任务
|
||||||
* @param 参数 knowledge_id, document_id,
|
* @param 参数 knowledge_id,
|
||||||
*{
|
*{
|
||||||
"id_list": [
|
"id_list": [
|
||||||
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||||
@ -89,12 +89,11 @@ const delDocument: (
|
|||||||
|
|
||||||
const putBatchCancelTask: (
|
const putBatchCancelTask: (
|
||||||
knowledge_id: string,
|
knowledge_id: string,
|
||||||
document_id: string,
|
|
||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>,
|
loading?: Ref<boolean>,
|
||||||
) => Promise<Result<boolean>> = (knowledge_id, document_id, data, loading) => {
|
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
|
||||||
return put(
|
return put(
|
||||||
`${prefix.value}/${knowledge_id}/document/${document_id}/batch_cancel_task`,
|
`${prefix.value}/${knowledge_id}/document/batch_cancel_task`,
|
||||||
data,
|
data,
|
||||||
undefined,
|
undefined,
|
||||||
loading,
|
loading,
|
||||||
|
|||||||
@ -71,7 +71,7 @@ const delDocument: (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消文档任务
|
* 批量取消文档任务
|
||||||
* @param 参数 knowledge_id, document_id,
|
* @param 参数 knowledge_id,
|
||||||
*{
|
*{
|
||||||
"id_list": [
|
"id_list": [
|
||||||
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||||
@ -85,7 +85,7 @@ const putBatchCancelTask: (
|
|||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>,
|
loading?: Ref<boolean>,
|
||||||
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
|
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
|
||||||
return put(`${prefix}/${knowledge_id}/document/cancel_task/_batch`, data, undefined, loading)
|
return put(`${prefix}/${knowledge_id}/document/batch_cancel_task`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -367,7 +367,7 @@ const postQADocument: (
|
|||||||
* 分段预览(上传文档)
|
* 分段预览(上传文档)
|
||||||
* @param 参数 file:file,limit:number,patterns:array,with_filter:boolean
|
* @param 参数 file:file,limit:number,patterns:array,with_filter:boolean
|
||||||
*/
|
*/
|
||||||
const postSplitDocument: (data: any, id:string) => Promise<Result<any>> = (data, id) => {
|
const postSplitDocument: (data: any, id: string) => Promise<Result<any>> = (data, id) => {
|
||||||
return post(`${prefix}/${id}/document/split`, data, undefined, undefined, 1000 * 60 * 60)
|
return post(`${prefix}/${id}/document/split`, data, undefined, undefined, 1000 * 60 * 60)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ const delDocument: (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消文档任务
|
* 批量取消文档任务
|
||||||
* @param 参数 knowledge_id, document_id,
|
* @param 参数 knowledge_id,
|
||||||
*{
|
*{
|
||||||
"id_list": [
|
"id_list": [
|
||||||
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||||
@ -82,12 +82,11 @@ const delDocument: (
|
|||||||
|
|
||||||
const putBatchCancelTask: (
|
const putBatchCancelTask: (
|
||||||
knowledge_id: string,
|
knowledge_id: string,
|
||||||
document_id: string,
|
|
||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>,
|
loading?: Ref<boolean>,
|
||||||
) => Promise<Result<boolean>> = (knowledge_id, document_id, data, loading) => {
|
) => Promise<Result<boolean>> = (knowledge_id, data, loading) => {
|
||||||
return put(
|
return put(
|
||||||
`${prefix}/${knowledge_id}/document/${document_id}/batch_cancel_task`,
|
`${prefix}/${knowledge_id}/document/batch_cancel_task`,
|
||||||
data,
|
data,
|
||||||
undefined,
|
undefined,
|
||||||
loading,
|
loading,
|
||||||
|
|||||||
@ -580,7 +580,7 @@
|
|||||||
<div class="mul-operation w-full flex" v-if="multipleSelection.length !== 0">
|
<div class="mul-operation w-full flex" v-if="multipleSelection.length !== 0">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="multipleSelection.length === 0"
|
:disabled="multipleSelection.length === 0"
|
||||||
@click="cancelTaskHandle(1, row)"
|
@click="cancelTaskHandle(1)"
|
||||||
v-hasPermission="[
|
v-hasPermission="[
|
||||||
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
||||||
PermissionConst.KNOWLEDGE_DOCUMENT_VECTOR.getWorkspacePermission,
|
PermissionConst.KNOWLEDGE_DOCUMENT_VECTOR.getWorkspacePermission,
|
||||||
@ -590,7 +590,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="multipleSelection.length === 0"
|
:disabled="multipleSelection.length === 0"
|
||||||
@click="cancelTaskHandle(2, row)"
|
@click="cancelTaskHandle(2)"
|
||||||
v-hasPermission="[
|
v-hasPermission="[
|
||||||
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
||||||
PermissionConst.KNOWLEDGE_DOCUMENT_GENERATE.getWorkspacePermission,
|
PermissionConst.KNOWLEDGE_DOCUMENT_GENERATE.getWorkspacePermission,
|
||||||
@ -705,7 +705,7 @@ const exportDocumentZip = (document: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelTaskHandle(val: any, row: any) {
|
function cancelTaskHandle(val: any) {
|
||||||
const arr: string[] = []
|
const arr: string[] = []
|
||||||
multipleSelection.value.map((v) => {
|
multipleSelection.value.map((v) => {
|
||||||
if (v) {
|
if (v) {
|
||||||
@ -716,7 +716,7 @@ function cancelTaskHandle(val: any, row: any) {
|
|||||||
id_list: arr,
|
id_list: arr,
|
||||||
type: val,
|
type: val,
|
||||||
}
|
}
|
||||||
documentApi.putBatchCancelTask(id, row.id, obj, loading).then(() => {
|
documentApi.putBatchCancelTask(id, obj, loading).then(() => {
|
||||||
MsgSuccess(t('views.document.tip.cancelSuccess'))
|
MsgSuccess(t('views.document.tip.cancelSuccess'))
|
||||||
multipleTableRef.value?.clearSelection()
|
multipleTableRef.value?.clearSelection()
|
||||||
})
|
})
|
||||||
@ -1081,9 +1081,7 @@ onBeforeUnmount(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.document-main {
|
.document {
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.mul-operation {
|
.mul-operation {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
margin-left: var(--sidebar-width);
|
margin-left: var(--sidebar-width);
|
||||||
|
|||||||
@ -511,10 +511,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="mul-operation w-full flex" v-if="multipleSelection.length !== 0">
|
<div class="mul-operation w-full flex" v-if="multipleSelection.length !== 0">
|
||||||
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(1, row)">
|
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(1)">
|
||||||
{{ $t('views.document.setting.cancelVectorization') }}
|
{{ $t('views.document.setting.cancelVectorization') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(2, row)">
|
<el-button :disabled="multipleSelection.length === 0" @click="cancelTaskHandle(2)">
|
||||||
{{ $t('views.document.setting.cancelGenerate') }}
|
{{ $t('views.document.setting.cancelGenerate') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-text type="info" class="secondary ml-24">
|
<el-text type="info" class="secondary ml-24">
|
||||||
@ -622,7 +622,7 @@ const exportDocumentZip = (document: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelTaskHandle(val: any, row: any) {
|
function cancelTaskHandle(val: any) {
|
||||||
const arr: string[] = []
|
const arr: string[] = []
|
||||||
multipleSelection.value.map((v) => {
|
multipleSelection.value.map((v) => {
|
||||||
if (v) {
|
if (v) {
|
||||||
@ -633,7 +633,7 @@ function cancelTaskHandle(val: any, row: any) {
|
|||||||
id_list: arr,
|
id_list: arr,
|
||||||
type: val,
|
type: val,
|
||||||
}
|
}
|
||||||
documentApi.putBatchCancelTask(id, row.id, obj, loading).then(() => {
|
documentApi.putBatchCancelTask(id, obj, loading).then(() => {
|
||||||
MsgSuccess(t('views.document.tip.cancelSuccess'))
|
MsgSuccess(t('views.document.tip.cancelSuccess'))
|
||||||
multipleTableRef.value?.clearSelection()
|
multipleTableRef.value?.clearSelection()
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user