import {Background, BackgroundVariant, type NodeProps} from '@xyflow/react' import {classnames} from 'amis' import React, {useCallback, useEffect, useMemo} 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(() => [ { type: 'switch', name: 'failFast', label: '快速失败', description: '执行过程中一旦出现错误,及时中断循环任务的执行', }, { disabled: true, type: 'switch', name: 'parallel', label: '并行执行', }, { type: 'divider', }, ...outputsFormColumns(false, true), ], [props.id]) const extraNodeDescription = useMemo(() => { return (