fix: condition node supports drag and drop

This commit is contained in:
wangdan-fit2cloud 2025-04-09 11:52:54 +08:00 committed by GitHub
parent bbb63a5928
commit 675d2366da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -248,6 +248,9 @@ function onEnd(event?: any) {
if (oldIndex === undefined || newIndex === undefined) return
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
if (oldIndex === list.length - 1 || newIndex === list.length - 1) {
list[newIndex] = list[oldIndex]
list[oldIndex] = clonedData
set(props.nodeModel.properties.node_data, 'branch', list)
return
}
list[newIndex].type = list[oldIndex].type