From 9b21964136d37e62fe819104aeee2eec9c00a644 Mon Sep 17 00:00:00 2001 From: haha Date: Sun, 14 Jul 2024 23:30:29 +0800 Subject: [PATCH] update code --- src/views/connection/detail.vue | 281 ++++++++++++++++---------- src/views/connection/detailFlow.vue | 8 +- src/views/connection/edit.vue | 11 +- src/views/connection/editFlow.vue | 39 +--- src/views/connection/editParamDlg.vue | 6 +- 5 files changed, 200 insertions(+), 145 deletions(-) diff --git a/src/views/connection/detail.vue b/src/views/connection/detail.vue index 29e4497..b8c7d7c 100644 --- a/src/views/connection/detail.vue +++ b/src/views/connection/detail.vue @@ -12,7 +12,7 @@ 模型版本: - {{ info.data.connection_version}} + {{ info.data.connection_version }} @@ -49,57 +49,73 @@ 算子互联信息
- - -
-
- 互联设置 + + +
+
+ 互联设置 +
+
+ +
-
- -
-
-
-
- 算子基本信息 -
-
- -
- 算子名称: - {{ info.selNode.operator_name }} +
+
+ 算子基本信息
-
- 算子版本: - {{ info.selNode.operator_version }} +
+ +
+ 算子名称: + {{ info.selNode.operator_name }} +
+
+ 算子版本: + {{ info.selNode.operator_version }} +
+
+ 算子说明: + {{ info.selNode.operator_desc }} +
+
+ 输入参数: +
+
+ {{ it.input_id }} +
+ + + + + +
+
+
+ 输出参数: +
+
+ {{ it.output_id + }} +
+ + + + + +
+
+
+ 处理参数: + + + +
+
-
- 算子说明: - {{ info.selNode.operator_desc }} -
- -
- 参数: - - {{ it.key }}:{{it.value }} - -
- -
@@ -109,43 +125,61 @@
- diff --git a/src/views/connection/detailFlow.vue b/src/views/connection/detailFlow.vue index 97fc0da..849a043 100644 --- a/src/views/connection/detailFlow.vue +++ b/src/views/connection/detailFlow.vue @@ -85,13 +85,7 @@ defineExpose({ }) const initEvent=(lf)=>{ lf.on("element:click",node=>{ - let nodeId=node.data.properties.node; - let nd=null; - if(nodeId){ - let tmps=info.opers.filter(d=>d.operator_id==nodeId); - nd=tmps.length>0?tmps[0]:null; - } - emit("nodeClick",nd); + emit("nodeClick",node.data); }); } onMounted(() => { diff --git a/src/views/connection/edit.vue b/src/views/connection/edit.vue index 9a58c8d..cce6758 100644 --- a/src/views/connection/edit.vue +++ b/src/views/connection/edit.vue @@ -151,7 +151,8 @@ const info = reactive({ editObj: null, }) const selNode = reactive({ - info: null + info: null, + node:null, }) let lf = ref(null) let edFlow = ref() @@ -174,7 +175,7 @@ const doEditSuccess = (obj) => { if(cobjs.length>0){ let cobj=cobjs[0]; o.attrs.forEach(oo=>{ - if(oo.name=="dataType"){ + if(oo.name=="oper_inout_data_type"){ cobj.oper_inout_data_type=oo.value; }else{ cobj[oo.name].value=oo.value; @@ -189,7 +190,7 @@ const doEditSuccess = (obj) => { if(cobjs.length>0){ let cobj=cobjs[0]; o.attrs.forEach(oo=>{ - if(oo.name=="dataType"){ + if(oo.name=="oper_inout_data_type"){ cobj.oper_inout_data_type=oo.value; }else{ cobj[oo.name].value=oo.value; @@ -211,6 +212,7 @@ const doEditSuccess = (obj) => { tmps[0].outputs = selNode.info.parameters.outputs; tmps[0].process = selNode.info.parameters.process; } + edFlow.value.updateNode(selNode.info,selNode.node); }; const doEdit = (obj, title, t) => { info.editObj = { @@ -238,7 +240,8 @@ const doUpdateNode = (data) => { } const doNodeClick = (node) => { if (node) { - selNode.info = node.data.properties.data; + selNode.info = node.data.properties.data; + selNode.node=node; let tmps = info.nodes.filter(d => d.id == selNode.info.id); if (tmps.length == 0) { info.nodes.push(selNode.info); diff --git a/src/views/connection/editFlow.vue b/src/views/connection/editFlow.vue index e7cb5d2..d41771c 100644 --- a/src/views/connection/editFlow.vue +++ b/src/views/connection/editFlow.vue @@ -99,7 +99,7 @@ const doUpdateState=()=>{ emit("updateNode",lf.value.getGraphData()) } -const getFLowData=()=>{ +const getFlowData=()=>{ return lf.value.getGraphData(); } onMounted(() => { @@ -114,39 +114,20 @@ onMounted(() => { emit("initLf",lf); window.lf = lf; logicFlow.render({ - nodes: [ - /* { - id: 'node_1', - type: 'ai-node', - x: 150, - y: 40, - fill:'#409effaa', - text: '图像缩放', - properties:{ - node:201 - } - }, - { - id: 'node_2', - type: 'ai-node', - x: 150, - y: 540, - fill:'#3CB371', - text: '目标绘图', - properties:{ - node:900 - } - }*/ - ], - edges: [ - - ] + nodes: [], + edges: [] }) doUpdateState(); }); +const updateNode=(info,node)=>{ + lf.value.setProperties(node.data.id,{ + data:info + }) +} defineExpose({ doEdit, - getFLowData + getFlowData, + updateNode })