From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/workflow/nodes/iteration/use-interactions.ts | 17 +++-------------- 1 files changed, 3 insertions(+), 14 deletions(-) diff --git a/app/components/workflow/nodes/iteration/use-interactions.ts b/app/components/workflow/nodes/iteration/use-interactions.ts index c294cfd..f8e3640 100644 --- a/app/components/workflow/nodes/iteration/use-interactions.ts +++ b/app/components/workflow/nodes/iteration/use-interactions.ts @@ -6,10 +6,7 @@ BlockEnum, Node, } from '../../types' -import { - generateNewNode, - getNodeCustomTypeByNodeDataType, -} from '../../utils' +import { generateNewNode } from '../../utils' import { ITERATION_PADDING, NODES_INITIAL_DATA, @@ -108,17 +105,15 @@ handleNodeIterationRerender(parentId) }, [store, handleNodeIterationRerender]) - const handleNodeIterationChildrenCopy = useCallback((nodeId: string, newNodeId: string, idMapping: Record<string, string>) => { + const handleNodeIterationChildrenCopy = useCallback((nodeId: string, newNodeId: string) => { const { getNodes } = store.getState() const nodes = getNodes() const childrenNodes = nodes.filter(n => n.parentId === nodeId && n.type !== CUSTOM_ITERATION_START_NODE) - const newIdMapping = { ...idMapping } - const copyChildren = childrenNodes.map((child, index) => { + return childrenNodes.map((child, index) => { const childNodeType = child.data.type as BlockEnum const nodesWithSameType = nodes.filter(node => node.data.type === childNodeType) const { newNode } = generateNewNode({ - type: getNodeCustomTypeByNodeDataType(childNodeType), data: { ...NODES_INITIAL_DATA[childNodeType], ...child.data, @@ -136,14 +131,8 @@ zIndex: child.zIndex, }) newNode.id = `${newNodeId}${newNode.id + index}` - newIdMapping[child.id] = newNode.id return newNode }) - - return { - copyChildren, - newIdMapping, - } }, [store, t]) return { -- Gitblit v1.8.0