This commit is contained in:
X1627315083@163.com
2026-03-30 10:02:59 +08:00
parent c1aff5b566
commit 4c7cb4e01d
3 changed files with 5 additions and 6 deletions

View File

@@ -122,7 +122,7 @@
{ immediate: true }
)
const menus = ref([
{ label: 'Copy', tip: 'Ctrl+C', on: () => emit('copy-node', clickTaskId.value) },
{ label: 'Copy', tip: 'Ctrl+C', on: () => emit('copy-node') },
{
label: 'Delete',
tip: 'Del',

View File

@@ -38,7 +38,7 @@
:data="node.data.data"
v-bind="node.data"
@delete-node="deleteNode(node.id)"
@copy-node="copyNode($event, node.id)"
@copy-node="copyNode(node.id)"
@update-data="(v) => (node.data.data = v)"
@bring-to-font="bringToFont(node.id)"
@send-to-back="sendToBack(node.id)"
@@ -179,8 +179,8 @@
nodeManager.deleteNode(id)
}
/** 复制节点 */
const copyNode = (clickTaskId, id) => {
nodeManager.copyNodeById(clickTaskId, id)
const copyNode = (id) => {
nodeManager.copyNodeById(id)
}
/** 节点zIndex设置最大 */
const bringToFont = (id) => {

View File

@@ -139,10 +139,9 @@ export class NodeManager {
return this.createNode(options_)
}
copyNodeById(clickTaskId:string, id: string) {
copyNodeById(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}节点已禁用复制`)