Skip to content

Commit bfdf7f7

Browse files
perf: Add Batch Delete Confirm
1 parent 6c7ae3f commit bfdf7f7

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

ui/src/views/document/index.vue

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -633,17 +633,28 @@ function syncMulDocument() {
633633
}
634634
635635
function deleteMulDocument() {
636-
const arr: string[] = []
637-
multipleSelection.value.map((v) => {
638-
if (v) {
639-
arr.push(v.id)
636+
MsgConfirm(
637+
`是否批量删除 ${multipleSelection.value.length} 个文档?`,
638+
`所选文档中的分段会跟随删除,请谨慎操作。`,
639+
{
640+
confirmButtonText: '删除',
641+
confirmButtonClass: 'danger'
640642
}
641-
})
642-
documentApi.delMulDocument(id, arr, loading).then(() => {
643-
MsgSuccess('批量删除成功')
644-
multipleTableRef.value?.clearSelection()
645-
getList()
646-
})
643+
)
644+
.then(() => {
645+
const arr: string[] = []
646+
multipleSelection.value.map((v) => {
647+
if (v) {
648+
arr.push(v.id)
649+
}
650+
})
651+
documentApi.delMulDocument(id, arr, loading).then(() => {
652+
MsgSuccess('批量删除成功')
653+
multipleTableRef.value?.clearSelection()
654+
getList()
655+
})
656+
})
657+
.catch(() => {})
647658
}
648659
649660
function batchRefresh() {

0 commit comments

Comments
 (0)