fix: 修复判断器删除其中一个条件后,前端序号未更新的缺陷

https://github.com/1Panel-dev/MaxKB/issues/753
(cherry picked from commit 1eace87463)
This commit is contained in:
wxg0103 2024-07-15 15:26:21 +08:00 committed by shaohuzhang1
parent 601d19d7ad
commit a5ca97ac06

View File

@ -277,6 +277,12 @@ function deleteCondition(index: number, cIndex: number) {
.map((item: any) => item.id)
)
refreshBranchAnchor(list, false)
list.forEach((item: any, index: number) => {
if (item.type === 'ELSE IF ' + (index + 1)) {
item.type = 'ELSE IF ' + index
}
})
}
set(props.nodeModel.properties.node_data, 'branch', list)
}