This commit is contained in:
X1627315083@163.com
2026-03-11 16:57:27 +08:00
parent bb740dfd2e
commit ea3818fd2e
8 changed files with 257 additions and 82 deletions

View File

@@ -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,