11<template >
2- <LayoutContainer header =" 文档" >
2+ <LayoutContainer header =" 文档" class = " document-main " >
33 <div class =" main-calc-height" >
44 <div class =" p-24" >
55 <div class =" flex-between" >
403403 </el-table-column >
404404 </app-table >
405405 </div >
406+
406407 <ImportDocumentDialog ref =" ImportDocumentDialogRef" :title =" title" @refresh =" refresh" />
407408 <SyncWebDialog ref =" SyncWebDialogRef" @refresh =" refresh" />
408409 <!-- 选择知识库 -->
409410 <SelectDatasetDialog ref =" SelectDatasetDialogRef" @refresh =" refreshMigrate" />
410411 <GenerateRelatedDialog ref =" GenerateRelatedDialogRef" @refresh =" refresh" />
411412 </div >
413+ <div class =" mul-operation w-full flex" v-if =" multipleSelection.length !== 0" >
414+ <el-button :disabled =" multipleSelection.length === 0" @click =" cancelTaskHandel(1)" >
415+ 取消向量化
416+ </el-button >
417+ <el-button :disabled =" multipleSelection.length === 0" @click =" cancelTaskHandel(2)" >
418+ 取消生成
419+ </el-button >
420+ <el-text type =" info" class =" secondary ml-24" >
421+ 已选 {{ multipleSelection.length }} 项
422+ </el-text >
423+ <el-button class =" ml-16" type =" primary" link @click =" clearSelection" > 清空 </el-button >
424+ </div >
412425 </LayoutContainer >
413426</template >
414427<script setup lang="ts">
@@ -478,6 +491,7 @@ const multipleSelection = ref<any[]>([])
478491const title = ref (' ' )
479492
480493const SelectDatasetDialogRef = ref ()
494+
481495const exportDocument = (document : any ) => {
482496 documentApi .exportDocument (document .name , document .dataset_id , document .id , loading ).then (() => {
483497 MsgSuccess (' 导出成功' )
@@ -490,6 +504,28 @@ const exportDocumentZip = (document: any) => {
490504 MsgSuccess (' 导出成功' )
491505 })
492506}
507+
508+ function cancelTaskHandel(val : any ) {
509+ const arr: string [] = []
510+ multipleSelection .value .map ((v ) => {
511+ if (v ) {
512+ arr .push (v .id )
513+ }
514+ })
515+ const obj = {
516+ id_list: arr ,
517+ type: val
518+ }
519+ documentApi .batchCancelTask (id , obj , loading ).then (() => {
520+ MsgSuccess (' 批量取消成功' )
521+ multipleTableRef .value ?.clearSelection ()
522+ })
523+ }
524+
525+ function clearSelection() {
526+ multipleTableRef .value ?.clearSelection ()
527+ }
528+
493529function openDatasetDialog(row ? : any ) {
494530 const arr: string [] = []
495531 if (row ) {
@@ -813,4 +849,20 @@ onBeforeUnmount(() => {
813849 closeInterval ()
814850})
815851 </script >
816- <style lang="scss" scoped></style >
852+ <style lang="scss" scoped>
853+ .document-main {
854+ box-sizing : border-box ;
855+ .mul-operation {
856+ position : fixed ;
857+ margin-left : var (--sidebar-width );
858+ bottom : 0 ;
859+ right : 24px ;
860+ width : calc (100% - var (--sidebar-width ) - 48px );
861+ padding : 16px 24px ;
862+ box-sizing : border-box ;
863+ background : #ffffff ;
864+ z-index : 22 ;
865+ box-shadow : 0px -2px 4px 0px rgba (31 , 35 , 41 , 0.08 );
866+ }
867+ }
868+ </style >
0 commit comments