From 54aa6218e0a44c42101b3000e2888505b9d18fb4 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Sun, 28 Sep 2025 18:41:44 +0800 Subject: [PATCH] fix: prevent loading state from triggering multiple requests in ParagraphList MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1062188 --user=刘瑞斌 【知识库】上传文档时,分段完成后编辑分段内容,编辑没有生效,控制台报错 https://www.tapd.cn/62980211/s/1780667 --- ui/src/views/knowledge/component/ParagraphList.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/src/views/knowledge/component/ParagraphList.vue b/ui/src/views/knowledge/component/ParagraphList.vue index 84110e0b9..70a53dca9 100644 --- a/ui/src/views/knowledge/component/ParagraphList.vue +++ b/ui/src/views/knowledge/component/ParagraphList.vue @@ -91,16 +91,18 @@ const paragraph_list = computed(() => { }) const next = () => { + if (loading.value) return loading.value = true setTimeout(() => { - current_page.value += 1 loading.value = false - }, 100) // 添加小延迟让UI有时间更新 + }, 100) } const editHandle = (item: any, cIndex: number) => { // 计算实际索引,考虑分页 - currentCIndex.value = cIndex + page_size.value * (current_page.value - 1) + currentCIndex.value = cIndex + // currentCIndex.value = cIndex + page_size.value * (current_page.value - 1) + // console.log('Edit index:', cIndex, page_size.value, current_page.value, currentCIndex.value) EditParagraphDialogRef.value.open(item) }