From ce7afda73c8114c67f96f5cf5420fe4db0e5cbd3 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 14 Jul 2025 17:22:23 +0800 Subject: [PATCH] fix: correct index calculation in deleteHandle function in ParagraphList.vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1058707 --user=刘瑞斌 【知识库】上传附件里的文档,在分段预览页面删除分段没有反应 https://www.tapd.cn/62980211/s/1730574 --- ui/src/views/knowledge/component/ParagraphList.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/src/views/knowledge/component/ParagraphList.vue b/ui/src/views/knowledge/component/ParagraphList.vue index 46de2e11c..b5862bb6c 100644 --- a/ui/src/views/knowledge/component/ParagraphList.vue +++ b/ui/src/views/knowledge/component/ParagraphList.vue @@ -126,8 +126,6 @@ const updateContent = (data: any) => { } const deleteHandle = (item: any, cIndex: number) => { - // 计算实际索引,考虑分页 - const actualIndex = cIndex + (page_size.value * (current_page.value - 1)); MsgConfirm( `${t('views.paragraph.delete.confirmTitle')}${item.title || '-'} ?`, @@ -139,7 +137,7 @@ const deleteHandle = (item: any, cIndex: number) => { ) .then(() => { const new_value = [...props.modelValue] - new_value.splice(actualIndex, 1) + new_value.splice(cIndex, 1) emit('update:modelValue', new_value) // 更新本地列表