From b0e4f5853e37dede49d5978736e64d60beaf481f Mon Sep 17 00:00:00 2001 From: v-zhangjc9 Date: Tue, 15 Jul 2025 09:09:23 +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=E8=BE=93=E5=87=BA=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/flow/node/LoopNode.tsx | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/service-web/client/src/components/flow/node/LoopNode.tsx b/service-web/client/src/components/flow/node/LoopNode.tsx index 7992236..57a5daa 100644 --- a/service-web/client/src/components/flow/node/LoopNode.tsx +++ b/service-web/client/src/components/flow/node/LoopNode.tsx @@ -1,17 +1,37 @@ import {Background, BackgroundVariant, type NodeProps} from '@xyflow/react' import {classnames} from 'amis' -import React from 'react' -import {flowBackgroundColor, flowDotColor} from '../types.ts' -import AmisNode, {nodeClassName, NormalNodeHandler} from './AmisNode.tsx' +import React, {useCallback, useEffect} from 'react' import AddNodeButton from '../component/AddNodeButton.tsx' +import {useDataStore} from '../store/DataStore.ts' +import {flowBackgroundColor, flowDotColor} from '../types.ts' +import AmisNode, {nodeClassName, NormalNodeHandler, outputsFormColumns} from './AmisNode.tsx' const LoopNode = (props: NodeProps) => { + const {mergeDataById} = useDataStore() + + useEffect(() => { + mergeDataById( + props.id, + { + outputs: { + output: { + type: 'array-object', + }, + }, + }, + ) + }, [props.id]) + + const columnsSchema = useCallback(() => [ + ...outputsFormColumns(false, true), + ], [props.id]) + return ( { } + columnSchema={columnsSchema} handler={} resize={{ minWidth: 350,