This commit is contained in:
X1627315083@163.com
2026-03-04 15:40:30 +08:00
parent eb67982228
commit e96aa5dca8
4 changed files with 53 additions and 8 deletions

View File

@@ -100,4 +100,21 @@ export class NodeManager {
}
return this.createNode(options_)
}
copyNodeById(id: string) {
const node = this.stateManager.getNodeById(id)
const flowNode = this.stateManager.flowManager.getNodeById(id)
console.log(node,this.stateManager.flowManager.getNodeById(id))
if (!node) return console.warn(`copyNodeById: ${id}找不到对应节点`)
const node_ = {
...JSON.parse(JSON.stringify(node)),
id: createId(),
position: {
x: node.position.x,
y: node.position.y + (flowNode?.dimensions?.height || 0) + 50,
}
}
this.stateManager.addNode(node_)
// return this.createNode(options_)
}
}