fix
This commit is contained in:
@@ -9,6 +9,7 @@ interface NodeData {
|
||||
superiorID?: string// 上级节点ID
|
||||
disableDelete?: boolean// 是否禁用删除
|
||||
disableCopy?: boolean// 是否禁用复制
|
||||
originalImage?: string// 要进行生成的图片
|
||||
}
|
||||
interface NodeOptions {
|
||||
id?: string
|
||||
@@ -113,13 +114,15 @@ export class NodeManager {
|
||||
return this.createNode(options_)
|
||||
}
|
||||
|
||||
copyNodeById(id: string) {
|
||||
copyNodeById(clickTaskId:string, id: string) {
|
||||
const node = this.stateManager.getNodeById(id)
|
||||
let copyNode = JSON.parse(JSON.stringify(node))
|
||||
copyNode.data.data.imageProcessTasks = copyNode.data.data.imageProcessTasks.filter((item:any)=>item.taskId == clickTaskId)
|
||||
const flowNode = this.stateManager.flowManager.getNodeById(id)
|
||||
if (!node) return console.warn(`${id}找不到对应节点`)
|
||||
if (node.data?.disableCopy) return console.warn(`${id}节点已禁用复制`)
|
||||
const node_ = {
|
||||
...JSON.parse(JSON.stringify(node)),
|
||||
...copyNode,
|
||||
id: createId(),
|
||||
position: {
|
||||
x: node.position.x,
|
||||
|
||||
Reference in New Issue
Block a user