fix
This commit is contained in:
@@ -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_)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user