diff --git a/nezha-fronted/src/components/common/project/addNode.vue b/nezha-fronted/src/components/common/project/addNode.vue index f5cca5d33..a5efaebb4 100644 --- a/nezha-fronted/src/components/common/project/addNode.vue +++ b/nezha-fronted/src/components/common/project/addNode.vue @@ -19,8 +19,8 @@ - - + + - - + + { if (valid) { - let module=this.moduleDataS.module.find(item=>item.id===this.form.modelId); - let img=this.iconArray.find(item=>item.id===this.form.imgId); - let model=Object.assign({...this.form},{...module},{...img},{id:this.form.modelId,shape:'image',shapeProperties:{useImageSize:false}},); + let module=this.moduleDataS.module.find(item=>item.id===this.form.moduleId); + let img=this.iconArray.find(item=>item.id===this.form.iconId); + let model=Object.assign({...this.form},{...module},{...img},{id:this.form.moduleId,shape:'image',shapeProperties:{useImageSize:false}},); model.label=model.name this.$emit('addModel',model) } diff --git a/nezha-fronted/src/components/common/project/topology.vue b/nezha-fronted/src/components/common/project/topology.vue index 925e519be..bbeabb196 100644 --- a/nezha-fronted/src/components/common/project/topology.vue +++ b/nezha-fronted/src/components/common/project/topology.vue @@ -12,7 +12,7 @@ Remove - save + save Please select two nodes Cancel @@ -66,7 +66,7 @@
- 123 +
123
@@ -203,6 +203,15 @@ {top:'56px', left:'-17px',className:'nz-icon-info-normal',id:'5'}, {top:'18px', left:'-38px',className:'nz-icon-gaojing',id:'6'}, ], + popDataShow:{ + endpoint:false, + asset:false, + total:false, + other:false, + info:false, + alert:false, + main:false, + }, modelTop:[], //viewsCenter viewsCenter:{ @@ -217,7 +226,12 @@ data:{} } }, - methods:{ + methods:{// 保存拓扑图数据 + saveTopology(){ + let nodes=[...this.nodesArray]; + let edges=[...this.edgesArray]; + console.log(nodes,edges); + }, //拓扑图方法 init(type){ let this_ = this; @@ -426,10 +440,7 @@ // 工具的点击 对应的操作 popClick(id){ - if(id=='edit'){ - this.nodeEdit() - } - + this.popDataShowUpdate(); }, modelTopUpdate(){//model上的图标 实时更新 this.modelTop=[]; @@ -452,7 +463,8 @@ }) }, modelTopMouseDown(e){ - if(!this.index){return}; + console.log(e); + if(!this.index&&this.index!==0){return}; this.relativeModelTop={ x:e.clientX-(parseFloat(this.$refs['modelTopId'+this.index][0].style.left)), y:e.clientY-(parseFloat(this.$refs['modelTopId'+this.index][0].style.top)), @@ -488,7 +500,9 @@ modelTopClick(item,index){ this.index=index; this.selNodeId=item.id; - this.setPopPosition(this.selNodeId); + if(this.selNodeId&&this.networkPopShow){ + this.setPopPosition(this.selNodeId); + } }, // 数组取差集 arrayDiff(){ @@ -497,7 +511,23 @@ this.nodesArray.forEach((item)=>{ this.moduleDataS.module=this.moduleDataS.module.filter((item1)=> item.id!==item1.id) }) - } + }, + //工具栏点击后显示对应内容 + popDataShowUpdate(key){ + this.popDataShow={ + endpoint:false, + asset:false, + total:false, + other:false, + info:false, + alert:false, + main:false, + }; + if(key){ + this.popDataShow[key]=true; + } + console.log(this.popDataShow); + }, }, mounted(){ setTimeout(()=>{ @@ -521,6 +551,7 @@ return } this_.setPopPosition(selId,params); + this_.popDataShowUpdate('main'); } });