From accd88982ef4a6de59a2f6d7c337dd93a060542a Mon Sep 17 00:00:00 2001 From: linziguan Date: Mon, 26 May 2025 14:34:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(designer):=20=E4=BF=AE=E5=A4=8D=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=A0=87=E9=A2=98=E6=98=BE=E7=A4=BA=E5=92=8C=E8=BE=B9?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在BaseNode.vue中修复未设置节点标题时使用默认标题的问题 - 在EdgeFormDialog.vue中将JsonInputField替换为MetaInputField - 在Index.vue中重构导入逻辑,移除简单模式并优化边连接处理 - 在ActivityNodeForm.vue中添加调试日志 --- .../src/views/designer/Index.vue | 35 ++++++++++++------- .../src/views/designer/editor/BaseNode.vue | 9 ++++- .../views/designer/editor/EdgeFormDialog.vue | 5 +-- .../designer/nodeForm/ActivityNodeForm.vue | 1 + 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/solon-flow-designer/src/views/designer/Index.vue b/solon-flow-designer/src/views/designer/Index.vue index 9c04af5..f6ab20b 100644 --- a/solon-flow-designer/src/views/designer/Index.vue +++ b/solon-flow-designer/src/views/designer/Index.vue @@ -111,8 +111,8 @@ function handleImport() { const graphData = { cells: [], // 存储节点和边的数组 }; - // 简化模式,只有节点信息,没有边信息 - let isSimpleMode = true; // 标记为非简单模式 + + let preNode = null; // 记录上一个节点 let temp_x = 10; let temp_y = 10; @@ -148,7 +148,6 @@ function handleImport() { graphData.cells.push(nodeData); // 将节点数据添加到数组中 if(node.link){ - isSimpleMode = false; if(Array.isArray(node.link)){ node.link.forEach(link => { if(typeof link == 'object'){ @@ -191,19 +190,29 @@ function handleImport() { graphData.cells.push(edgeData); // 将边数据添加到数组中 } } + + if(preNode && (!preNode.link || preNode.link.length==0)){ + const cell = preNode + const nextCell = node + + const edgeData = buildEdgeForStringType(cell.id,nextCell.id) // 构建边数据的函数 + graphData.cells.push(edgeData); + } + + preNode=node; }) - if(isSimpleMode){ - let edges = [] - for(let i = 0;i { const nodeData = props.node.getData() const nodeType = nodeTypeDef[nodeData.type]; + if(!nodeData.title){ + // 如果没有title,就使用type的title + nodeData.title = nodeType.title + props.node.setData({ + title: nodeData.title + }) + } nodeInfo = Object.assign(nodeInfo,{}, nodeData,{ "color": nodeType.color, "icon": nodeType.icon, - title: nodeData.title || nodeType.title + title: nodeData.title }) props.node.on("node:data:changed", () => { const nodeData = props.node.getData() diff --git a/solon-flow-designer/src/views/designer/editor/EdgeFormDialog.vue b/solon-flow-designer/src/views/designer/editor/EdgeFormDialog.vue index 7e1571f..65df961 100644 --- a/solon-flow-designer/src/views/designer/editor/EdgeFormDialog.vue +++ b/solon-flow-designer/src/views/designer/editor/EdgeFormDialog.vue @@ -18,8 +18,8 @@ - - + + @@ -28,6 +28,7 @@