Skip to content

Commit 505ef00

Browse files
committed
fix: Defects that can be saved multiple times
--bug=1054039 --user=王孝刚 【飞书知识库】-导入文档时,快速点击开始导入按钮,会触发多次import请求,并且会跳离文档列表页 https://www.tapd.cn/57709429/s/1677588
1 parent 0a3b9ee commit 505ef00

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ui/src/views/dataset/ImportDocumentDataset.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<div class="create-dataset__footer text-right border-t">
8585
<el-button @click="router.go(-1)">{{ $t('common.cancel') }}</el-button>
8686

87-
<el-button @click="submit" type="primary">
87+
<el-button @click="submit" type="primary" :disabled="disabled">
8888
{{ $t('views.document.buttons.import') }}
8989
</el-button>
9090
</div>
@@ -174,6 +174,7 @@ const handleAllCheckChange = (checked: boolean) => {
174174
175175
function submit() {
176176
loading.value = true
177+
disabled.value = true
177178
// 选中的节点的token
178179
const checkedNodes = treeRef.value?.getCheckedNodes() || []
179180
const filteredNodes = checkedNodes.filter((node: any) => !node.is_exist)
@@ -188,11 +189,15 @@ function submit() {
188189
.importLarkDocument(datasetId, newList, loading)
189190
.then((res) => {
190191
MsgSuccess(t('views.document.tip.importMessage'))
192+
disabled.value = false
191193
router.go(-1)
192194
})
193195
.catch((err) => {
194196
console.error('Failed to load tree nodes:', err)
195197
})
198+
.finally(() => {
199+
disabled.value = false
200+
})
196201
loading.value = false
197202
}
198203

0 commit comments

Comments
 (0)