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

@@ -0,0 +1,33 @@
import { getTaskidResult } from '@/api/flow-canvas'
interface NodeOptions {
id?: string
position?: { x: number, y: number }
positionX?: number
positionY?: number
component?: any
}
export class GenerateManager {
stateManager: any
taskIds: string[] = []
constructor(options) {
this.stateManager = options.stateManager;
}
/** 删除taskId */
deleteTaskId(taskId: string) {
}
/** 添加taskId */
addTaskId(TaskId: any) {
this.stateManager.addTaskId(TaskId)
}
/** 添加taskId */
async getTasksIdImg(list) {
let taskIds = list.map((item)=>item.taskId)
getTaskidResult({taskIds}).then((rv)=>{
console.log(rv)
})
}
}

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,