From 0efb041c71843cf48121535cf331a98ecce85447 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Mon, 14 Jul 2025 23:34:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E4=B8=8D=E5=A4=AA=E4=BC=98?= =?UTF-8?q?=E9=9B=85=E5=9C=B0=E4=BF=AE=E5=A4=8D=E5=BE=AA=E7=8E=AF=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=88=9D=E5=A7=8B=E5=8C=96=E9=AB=98=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/flow/component/AddNodeButton.tsx | 10 +++++----- .../client/src/components/flow/node/LoopNode.tsx | 11 +++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/service-web/client/src/components/flow/component/AddNodeButton.tsx b/service-web/client/src/components/flow/component/AddNodeButton.tsx index fc27538..d3e0e47 100644 --- a/service-web/client/src/components/flow/component/AddNodeButton.tsx +++ b/service-web/client/src/components/flow/component/AddNodeButton.tsx @@ -9,7 +9,7 @@ import {useFlowStore} from '../store/FlowStore.ts' import type {ButtonProps} from 'antd/lib' export type AddNodeButtonProps = { - parentId?: string + parent?: string } & ButtonProps const AddNodeButton = (props: AddNodeButtonProps) => { @@ -25,7 +25,7 @@ const AddNodeButton = (props: AddNodeButtonProps) => { children: NodeRegistry .filter(i => isEqual(group, i.group)) // 循环节点里不能再嵌套循环节点 - .filter(i => !props.parentId || (props.parentId && !isEqual(i.key, 'loop-node'))) + .filter(i => !props.parent || (props.parent && !isEqual(i.key, 'loop-node'))) .map(i => ({key: i.key, label: i.name, icon: i.icon})), })), onClick: ({key}) => { @@ -51,11 +51,11 @@ const AddNodeButton = (props: AddNodeButtonProps) => { addNode({ id: nodeId, type: key, - position: {x: 100, y: 130}, + position: {x: 50, y: 130}, data: {}, // 如果是循环节点就将节点加入到循环节点中 - ...(props.parentId ? { - parentId: props.parentId, + ...(props.parent ? { + parentId: props.parent, extent: 'parent', } : {}) }) diff --git a/service-web/client/src/components/flow/node/LoopNode.tsx b/service-web/client/src/components/flow/node/LoopNode.tsx index 1611b95..7992236 100644 --- a/service-web/client/src/components/flow/node/LoopNode.tsx +++ b/service-web/client/src/components/flow/node/LoopNode.tsx @@ -11,16 +11,11 @@ const LoopNode = (props: NodeProps) => { className={classnames('w-full', 'h-full', nodeClassName('loop'))} style={{ minWidth: '350px', - minHeight: '200px' + minHeight: '290px' }} nodeProps={props} extraNodeDescription={ -
+
{ color={flowDotColor} bgColor={flowBackgroundColor} /> - +
} handler={}