From 66a87a32c9e5a07c92999c86c9e8b017a93cfd27 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 13 Dec 2024 12:05:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/Workflow/Definition/Design/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Workflow/Definition/Design/index.tsx b/frontend/src/pages/Workflow/Definition/Design/index.tsx index eeff5c26..0a20df13 100644 --- a/frontend/src/pages/Workflow/Definition/Design/index.tsx +++ b/frontend/src/pages/Workflow/Definition/Design/index.tsx @@ -98,11 +98,18 @@ const WorkflowDesign: React.FC = () => { // 根据节点类型动态注册 const nodeConfig = { inherit: nodeData.graph.shape === 'circle' ? 'circle' : - nodeData.graph.shape === 'polygon' ? 'polygon' : 'rect', + nodeData.graph.shape === 'polygon' ? 'polygon' : + nodeData.graph.shape === 'diamond' ? 'polygon' : 'rect', width: nodeData.graph.size.width, height: nodeData.graph.size.height, attrs: { - body: nodeData.graph.style, + body: { + ...nodeData.graph.style, + // 如果是菱形,添加 refPoints + ...(nodeData.graph.shape === 'diamond' ? { + refPoints: '50,0 100,50 50,100 0,50' + } : {}) + }, label: { text: nodeData.name, fill: '#000000',