From 35a6a5bc62043fa96059bd0a28225549acb32be4 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Wed, 9 Apr 2025 15:33:30 +0800 Subject: [PATCH] fix: Judgment tool drag and drop sorting --- ui/src/workflow/nodes/condition-node/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/workflow/nodes/condition-node/index.vue b/ui/src/workflow/nodes/condition-node/index.vue index c76844befa8..41ada1b5f15 100644 --- a/ui/src/workflow/nodes/condition-node/index.vue +++ b/ui/src/workflow/nodes/condition-node/index.vue @@ -10,7 +10,7 @@ > () + const form = { branch: [ { @@ -248,13 +249,12 @@ 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 - list[oldIndex].type = clonedData.type // 恢复原始 type + const newInstance = { ...list[oldIndex], type: list[newIndex].type, id: list[newIndex].id } + const oldInstance = { ...list[newIndex], type: list[oldIndex].type, id: list[oldIndex].id } + list[newIndex] = newInstance + list[oldIndex] = oldInstance set(props.nodeModel.properties.node_data, 'branch', list) }