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

@@ -31,10 +31,11 @@
:active="stateManager.activeNodeID.value === node.id"
:node="node"
:config="node.data"
:sketchId="config.imgId"
:data="node.data.data"
v-bind="node.data"
@delete-node="deleteNode(node.id)"
@copy-node="copyNode(node.id)"
@copy-node="copyNode($event,node.id)"
@update-data="(v) => (node.data.data = v)"
@bring-to-font="bringToFont(node.id)"
@send-to-back="sendToBack(node.id)"
@@ -157,8 +158,8 @@
nodeManager.deleteNode(id)
}
/** 复制节点 */
const copyNode = (id) => {
nodeManager.copyNodeById(id)
const copyNode = (clickTaskId,id) => {
nodeManager.copyNodeById(clickTaskId,id)
}
/** 节点zIndex设置最大 */
const bringToFont = (id) => {
@@ -171,11 +172,11 @@
// 导出流程
const exportFlow = () => {
// flowManager.exportFlow()
const str = JSON.stringify(stateManager.nodes.value)
const json = JSON.parse(str)
putSketchFlowCanvas({
id: props.config.id || '==========',
id: props.config.imgId,
canvasData: str
}).then((res) => {
if (res) {
@@ -214,10 +215,9 @@
// window['nodes'] = nodes
let json = []
await new Promise((resolve) => {
getSketchFlowCanvas({ id: props.config.id || '==========' }).then((res) => {
getSketchFlowCanvas({ id: props.config.imgId }).then((res:any) => {
if (res) {
console.log(res)
json = res.data
json = JSON.parse(res)
}
resolve(true)
}).catch(() => {
@@ -227,12 +227,21 @@
if(json.length > 0){
importFlow(json)
}else{
const timestamp = Date.now()
nodeManager.createResultNode({
data: {
disableDelete: true,
isHeader: false,
data: {
url: props.config.url
imageProcessTasks:[
{
id: props.config.imgId,
url: props.config.url,
state:'success',
taskId: timestamp + '',
},
],
selectTaskId: timestamp + '',
}
}
})