diff --git a/frontend/src/views/flow/FlowCanvas.vue b/frontend/src/views/flow/FlowCanvas.vue index 274dbd9..ea145bf 100644 --- a/frontend/src/views/flow/FlowCanvas.vue +++ b/frontend/src/views/flow/FlowCanvas.vue @@ -1,42 +1,45 @@ - - - - - - - + $emit('node-click', e)" + @pane-click="onPaneClickLocal" + @connect="handleConnect" + @drop="(e: any) => $emit('drop', e)" + @dragover.prevent + @edge-click="onEdgeClick" + @contextmenu="onContextMenu" + > + + + - - + + + + + + + \ No newline at end of file diff --git a/frontend/src/views/flow/FlowEditor.vue b/frontend/src/views/flow/FlowEditor.vue index 84db651..dca30e6 100644 --- a/frontend/src/views/flow/FlowEditor.vue +++ b/frontend/src/views/flow/FlowEditor.vue @@ -10,8 +10,6 @@ 保存 验证 - 撤销 - 重做 上架到企微 @@ -56,6 +54,8 @@ @pane-click="onPaneClick" @drop="onDrop" @node-delete="removeNode" + @update:nodes="(v: any) => nodes = v" + @update:edges="(v: any) => edges = v" /> @@ -160,11 +160,6 @@ const colorMap: Record = { output: '#722ed1', } -function undo() { canvasRef.value?.undo() } -function redo() { canvasRef.value?.redo() } -const canUndo = computed(() => canvasRef.value?.canUndo ?? false) -const canRedo = computed(() => canvasRef.value?.canRedo ?? false) - const selectedNode = computed(() => nodes.value.find((n: any) => n.id === selectedNodeId.value) || null) function getMiniMapColor(node: any) { @@ -183,7 +178,7 @@ function onDrop(event: DragEvent) { if (!dataStr) return const nodeData = JSON.parse(dataStr) const id = `node_${++nodeCounter}` - canvasRef.value?.addNodes?.([{ + nodes.value.push({ id, type: 'custom', position: { x: 100 + nodeCounter * 50, y: 100 + nodeCounter * 30 }, @@ -196,7 +191,7 @@ function onDrop(event: DragEvent) { }, draggable: true, connectable: true, - }]) + }) } function getDefaultConfig(type: string) { diff --git a/frontend/src/views/flow/FlowNode.vue b/frontend/src/views/flow/FlowNode.vue index b3fbeb7..8fb113c 100644 --- a/frontend/src/views/flow/FlowNode.vue +++ b/frontend/src/views/flow/FlowNode.vue @@ -5,6 +5,7 @@ {{ data?.typeDesc || '' }} + {{ configSummary }} × @@ -24,13 +25,18 @@ 否 + + + + \ No newline at end of file + diff --git a/frontend/src/views/flow/node-configs/ConditionConfig.vue b/frontend/src/views/flow/node-configs/ConditionConfig.vue index 47a53bf..39a2d8f 100644 --- a/frontend/src/views/flow/node-configs/ConditionConfig.vue +++ b/frontend/src/views/flow/node-configs/ConditionConfig.vue @@ -3,7 +3,7 @@ 条件配置 - + @@ -11,28 +11,28 @@ - + update('condition', e)" placeholder="如: status == 'done'" /> 支持变量: {{input_data}}, {{status}}, {{result}} 分支配置 - + update('true_label', e)" placeholder="条件满足时的输出标签" /> - + update('false_label', e)" placeholder="条件不满足时的输出标签" /> 高级选项 - + - + @@ -41,18 +41,16 @@
{{ data?.typeDesc || '' }}
{{ configSummary }}