|
10 | 10 | >
|
11 | 11 | <VueDraggable
|
12 | 12 | ref="el"
|
13 |
| - v-model="form_data.branch" |
| 13 | + v-bind:modelValue="form_data.branch" |
14 | 14 | :disabled="form_data.branch === 2"
|
15 | 15 | :filter="'.no-drag'"
|
16 | 16 | handle=".handle"
|
@@ -169,6 +169,7 @@ import { compareList } from '@/workflow/common/data'
|
169 | 169 | import { VueDraggable } from 'vue-draggable-plus'
|
170 | 170 |
|
171 | 171 | const props = defineProps<{ nodeModel: any }>()
|
| 172 | +
|
172 | 173 | const form = {
|
173 | 174 | branch: [
|
174 | 175 | {
|
@@ -248,13 +249,12 @@ function onEnd(event?: any) {
|
248 | 249 | if (oldIndex === undefined || newIndex === undefined) return
|
249 | 250 | const list = cloneDeep(props.nodeModel.properties.node_data.branch)
|
250 | 251 | if (oldIndex === list.length - 1 || newIndex === list.length - 1) {
|
251 |
| - list[newIndex] = list[oldIndex] |
252 |
| - list[oldIndex] = clonedData |
253 |
| - set(props.nodeModel.properties.node_data, 'branch', list) |
254 | 252 | return
|
255 | 253 | }
|
256 |
| - list[newIndex].type = list[oldIndex].type |
257 |
| - list[oldIndex].type = clonedData.type // 恢复原始 type |
| 254 | + const newInstance = { ...list[oldIndex], type: list[newIndex].type, id: list[newIndex].id } |
| 255 | + const oldInstance = { ...list[newIndex], type: list[oldIndex].type, id: list[oldIndex].id } |
| 256 | + list[newIndex] = newInstance |
| 257 | + list[oldIndex] = oldInstance |
258 | 258 | set(props.nodeModel.properties.node_data, 'branch', list)
|
259 | 259 | }
|
260 | 260 |
|
|
0 commit comments