mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Defects that can be saved multiple times
--bug=1054039 --user=王孝刚 【飞书知识库】-导入文档时,快速点击开始导入按钮,会触发多次import请求,并且会跳离文档列表页 https://www.tapd.cn/57709429/s/1677588
This commit is contained in:
parent
0a3b9ee02b
commit
d47295aa36
|
|
@ -84,7 +84,7 @@
|
|||
<div class="create-dataset__footer text-right border-t">
|
||||
<el-button @click="router.go(-1)">{{ $t('common.cancel') }}</el-button>
|
||||
|
||||
<el-button @click="submit" type="primary">
|
||||
<el-button @click="submit" type="primary" :disabled="disabled">
|
||||
{{ $t('views.document.buttons.import') }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -174,6 +174,7 @@ const handleAllCheckChange = (checked: boolean) => {
|
|||
|
||||
function submit() {
|
||||
loading.value = true
|
||||
disabled.value = true
|
||||
// 选中的节点的token
|
||||
const checkedNodes = treeRef.value?.getCheckedNodes() || []
|
||||
const filteredNodes = checkedNodes.filter((node: any) => !node.is_exist)
|
||||
|
|
@ -188,11 +189,15 @@ function submit() {
|
|||
.importLarkDocument(datasetId, newList, loading)
|
||||
.then((res) => {
|
||||
MsgSuccess(t('views.document.tip.importMessage'))
|
||||
disabled.value = false
|
||||
router.go(-1)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Failed to load tree nodes:', err)
|
||||
})
|
||||
.finally(() => {
|
||||
disabled.value = false
|
||||
})
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue