Merge pull request #438 from 1Panel-dev/pr@main@fix-bug

fix: 文档和问题批量删除问题修复
This commit is contained in:
wangdan-fit2cloud 2024-05-13 17:33:48 +08:00 committed by GitHub
commit 4e30c949f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-table" :class="quickCreate ? 'table-quick-append' : ''"> <div class="app-table" :class="quickCreate ? 'table-quick-append' : ''">
<el-table :max-height="tableHeight" v-bind="$attrs"> <el-table :max-height="tableHeight" v-bind="$attrs" ref="appTableRef">
<template #append v-if="quickCreate"> <template #append v-if="quickCreate">
<div v-if="showInput"> <div v-if="showInput">
<el-input <el-input
@ -80,6 +80,7 @@ const paginationConfig = computed(() => props.paginationConfig)
const pageSizes = [10, 20, 50, 100] const pageSizes = [10, 20, 50, 100]
const quickInputRef = ref() const quickInputRef = ref()
const appTableRef = ref()
const loading = ref(false) const loading = ref(false)
const showInput = ref(false) const showInput = ref(false)
@ -124,7 +125,13 @@ function handleCurrentChange() {
common.savePage(props.storeKey, props.paginationConfig) common.savePage(props.storeKey, props.paginationConfig)
} }
} }
defineExpose({})
function clearSelection() {
appTableRef.value?.clearSelection()
}
defineExpose({
clearSelection
})
onMounted(() => { onMounted(() => {
tableHeight.value = window.innerHeight - 300 tableHeight.value = window.innerHeight - 300

View File

@ -216,7 +216,7 @@
<ImportDocumentDialog ref="ImportDocumentDialogRef" :title="title" @refresh="refresh" /> <ImportDocumentDialog ref="ImportDocumentDialogRef" :title="title" @refresh="refresh" />
<SyncWebDialog ref="SyncWebDialogRef" @refresh="refresh" /> <SyncWebDialog ref="SyncWebDialogRef" @refresh="refresh" />
<!-- 选择知识库 --> <!-- 选择知识库 -->
<SelectDatasetDialog ref="SelectDatasetDialogRef" @refresh="refresh" /> <SelectDatasetDialog ref="SelectDatasetDialogRef" @refresh="refreshMigrate" />
</div> </div>
</LayoutContainer> </LayoutContainer>
</template> </template>
@ -418,6 +418,7 @@ function deleteMulDocument() {
}) })
documentApi.delMulDocument(id, arr, loading).then(() => { documentApi.delMulDocument(id, arr, loading).then(() => {
MsgSuccess('批量删除成功') MsgSuccess('批量删除成功')
multipleTableRef.value?.clearSelection()
getList() getList()
}) })
} }
@ -501,6 +502,11 @@ function getDetail() {
}) })
} }
function refreshMigrate() {
multipleTableRef.value?.clearSelection()
getList()
}
function refresh() { function refresh() {
paginationConfig.value.current_page = 1 paginationConfig.value.current_page = 1
getList() getList()

View File

@ -195,6 +195,7 @@ function deleteMulDocument() {
}) })
problemApi.delMulProblem(id, arr, loading).then(() => { problemApi.delMulProblem(id, arr, loading).then(() => {
MsgSuccess('批量删除成功') MsgSuccess('批量删除成功')
multipleTableRef.value?.clearSelection()
getList() getList()
}) })
} }