From d487c40dd483e78bf68923e20aac015029d18f0a Mon Sep 17 00:00:00 2001 From: ZLY Date: Wed, 22 Oct 2025 16:35:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(flowEditor):=20=E6=94=AF=E6=8C=81=E5=A4=8D?= =?UTF-8?q?=E5=90=88=E7=BB=84=E4=BB=B6=E8=8A=82=E7=82=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8E=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flowEditor/components/addNodeMenu.tsx | 34 +++++++++---------- .../flowEditor/components/paneContextMenu.tsx | 1 + 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/pages/flowEditor/components/addNodeMenu.tsx b/src/pages/flowEditor/components/addNodeMenu.tsx index a5ddcd4..ac66fbc 100644 --- a/src/pages/flowEditor/components/addNodeMenu.tsx +++ b/src/pages/flowEditor/components/addNodeMenu.tsx @@ -53,24 +53,25 @@ const AddNodeMenu: React.FC = ({ } }; }); - // groupedNodes['composite'] = projectFlowList.map((v: any) => { - // return { - // ...v, - // nodeName: v.name, - // nodeType: 'BASE', - // nodeGroup: 'application', - // data: { - // parameters: { - // apiIns: v.def.apis, - // apiOuts: v.def.apiOut, - // dataIns: v.def.dataIns, - // dataOuts: v.def.dataOuts - // } - // } - // }; - // }); + initialGroupedNodes['composite'] = projectFlowList.map((v: any) => { + return { + ...v, + nodeName: v?.main?.name || '复合组件', + nodeType: 'BASIC', + nodeGroup: 'composite', + data: { + parameters: { + apiIns: [{ id: 'start', desc: '', dataType: '', defaultValue: '' }], + apiOuts: [{ id: 'done', desc: '', dataType: '', defaultValue: '' }], + dataIns: v.flowHousVO.dataIns, + dataOuts: v.flowHousVO.dataOuts + } + } + }; + }); } + // 更新状态以触发重新渲染 setGroupedNodes(initialGroupedNodes); }, [projectComponentData, info.id]); @@ -113,7 +114,6 @@ const AddNodeMenu: React.FC = ({
= ({ borderRadius: 4, boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)' }} + triggerProps={{ trigger: 'click' }} >