Skip to content

Commit ce7afda

Browse files
committed
fix: correct index calculation in deleteHandle function in ParagraphList.vue
--bug=1058707 --user=刘瑞斌 【知识库】上传附件里的文档,在分段预览页面删除分段没有反应 https://www.tapd.cn/62980211/s/1730574
1 parent fdc9f9e commit ce7afda

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ const updateContent = (data: any) => {
126126
}
127127
128128
const deleteHandle = (item: any, cIndex: number) => {
129-
// 计算实际索引,考虑分页
130-
const actualIndex = cIndex + (page_size.value * (current_page.value - 1));
131129
132130
MsgConfirm(
133131
`${t('views.paragraph.delete.confirmTitle')}${item.title || '-'} ?`,
@@ -139,7 +137,7 @@ const deleteHandle = (item: any, cIndex: number) => {
139137
)
140138
.then(() => {
141139
const new_value = [...props.modelValue]
142-
new_value.splice(actualIndex, 1)
140+
new_value.splice(cIndex, 1)
143141
emit('update:modelValue', new_value)
144142
145143
// 更新本地列表

0 commit comments

Comments
 (0)