From 77950e48c76f4a3b29d01831d43039caba29888a Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 18 十一月 2025 14:12:42 +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