fix: correct index calculation in deleteHandle function in ParagraphList.vue
--bug=1058707 --user=刘瑞斌 【知识库】上传附件里的文档,在分段预览页面删除分段没有反应 https://www.tapd.cn/62980211/s/1730574
This commit is contained in:
parent
fdc9f9eb0b
commit
ce7afda73c
@ -126,8 +126,6 @@ const updateContent = (data: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deleteHandle = (item: any, cIndex: number) => {
|
const deleteHandle = (item: any, cIndex: number) => {
|
||||||
// 计算实际索引,考虑分页
|
|
||||||
const actualIndex = cIndex + (page_size.value * (current_page.value - 1));
|
|
||||||
|
|
||||||
MsgConfirm(
|
MsgConfirm(
|
||||||
`${t('views.paragraph.delete.confirmTitle')}${item.title || '-'} ?`,
|
`${t('views.paragraph.delete.confirmTitle')}${item.title || '-'} ?`,
|
||||||
@ -139,7 +137,7 @@ const deleteHandle = (item: any, cIndex: number) => {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const new_value = [...props.modelValue]
|
const new_value = [...props.modelValue]
|
||||||
new_value.splice(actualIndex, 1)
|
new_value.splice(cIndex, 1)
|
||||||
emit('update:modelValue', new_value)
|
emit('update:modelValue', new_value)
|
||||||
|
|
||||||
// 更新本地列表
|
// 更新本地列表
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user