From df8270676ac2e53bfd3629daf8c5dc4e4e268e2a Mon Sep 17 00:00:00 2001 From: v-zhangjc9 Date: Tue, 15 Jul 2025 11:11:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E5=A2=9E=E5=8A=A0=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E8=8A=82=E7=82=B9=E7=9A=84=E5=9F=BA=E6=9C=AC=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/component/AddNodeButton.tsx | 19 ++++++++++--------- .../src/components/flow/node/LoopNode.tsx | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/service-web/client/src/components/flow/component/AddNodeButton.tsx b/service-web/client/src/components/flow/component/AddNodeButton.tsx index d3e0e47..a668469 100644 --- a/service-web/client/src/components/flow/component/AddNodeButton.tsx +++ b/service-web/client/src/components/flow/component/AddNodeButton.tsx @@ -1,20 +1,21 @@ +import {PlusCircleFilled} from '@ant-design/icons' +import {Button, Dropdown} from 'antd' +import type {ButtonProps} from 'antd/lib' import {isEqual, randomId, unique} from 'licia' -import {NodeRegistry, NodeRegistryMap} from '../NodeRegistry.tsx' import {commonInfo} from '../../../util/amis.tsx' import {checkAddNode} from '../FlowChecker.tsx' -import {Button, Dropdown} from 'antd' -import {PlusCircleFilled} from '@ant-design/icons' +import {NodeRegistry, NodeRegistryMap} from '../NodeRegistry.tsx' import {useDataStore} from '../store/DataStore.ts' import {useFlowStore} from '../store/FlowStore.ts' -import type {ButtonProps} from 'antd/lib' -export type AddNodeButtonProps = { +export type AddNodeButtonProps = ButtonProps & { parent?: string -} & ButtonProps + onlyIcon?: boolean +} const AddNodeButton = (props: AddNodeButtonProps) => { const {data, setDataById} = useDataStore() - const {nodes, addNode, edges,} = useFlowStore() + const {nodes, addNode, edges} = useFlowStore() return ( { ...(props.parent ? { parentId: props.parent, extent: 'parent', - } : {}) + } : {}), }) } catch (e) { // @ts-ignore @@ -68,7 +69,7 @@ const AddNodeButton = (props: AddNodeButtonProps) => { > ) diff --git a/service-web/client/src/components/flow/node/LoopNode.tsx b/service-web/client/src/components/flow/node/LoopNode.tsx index 57a5daa..9a853c5 100644 --- a/service-web/client/src/components/flow/node/LoopNode.tsx +++ b/service-web/client/src/components/flow/node/LoopNode.tsx @@ -23,6 +23,21 @@ const LoopNode = (props: NodeProps) => { }, [props.id]) const columnsSchema = useCallback(() => [ + { + type: 'switch', + name: 'failFast', + label: '快速失败', + description: '执行过程中一旦出现错误,及时中断循环任务的执行', + }, + { + disabled: true, + type: 'switch', + name: 'parallel', + label: '并行执行', + }, + { + type: 'divider', + }, ...outputsFormColumns(false, true), ], [props.id]) @@ -48,7 +63,7 @@ const LoopNode = (props: NodeProps) => { color={flowDotColor} bgColor={flowBackgroundColor} /> - + } columnSchema={columnsSchema}