Skip to content

Commit 54aa621

Browse files
committed
fix: prevent loading state from triggering multiple requests in ParagraphList
--bug=1062188 --user=刘瑞斌 【知识库】上传文档时,分段完成后编辑分段内容,编辑没有生效,控制台报错 https://www.tapd.cn/62980211/s/1780667
1 parent 942842e commit 54aa621

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/src/views/knowledge/component/ParagraphList.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,18 @@ const paragraph_list = computed(() => {
9191
})
9292
9393
const next = () => {
94+
if (loading.value) return
9495
loading.value = true
9596
setTimeout(() => {
96-
current_page.value += 1
9797
loading.value = false
98-
}, 100) // 添加小延迟让UI有时间更新
98+
}, 100)
9999
}
100100
101101
const editHandle = (item: any, cIndex: number) => {
102102
// 计算实际索引,考虑分页
103-
currentCIndex.value = cIndex + page_size.value * (current_page.value - 1)
103+
currentCIndex.value = cIndex
104+
// currentCIndex.value = cIndex + page_size.value * (current_page.value - 1)
105+
// console.log('Edit index:', cIndex, page_size.value, current_page.value, currentCIndex.value)
104106
EditParagraphDialogRef.value.open(item)
105107
}
106108

0 commit comments

Comments
 (0)