fix:修改拖动后 再次选择节点 显示不正确的问题

This commit is contained in:
zhangyu
2020-10-16 13:09:06 +08:00
parent 8a106e2068
commit 4ae303d837
2 changed files with 20 additions and 12 deletions

View File

@@ -57,7 +57,9 @@
},
watch:{
moduleId(n){
this.init();
if(n){
this.init();
}
}
},
data(){

View File

@@ -63,12 +63,12 @@
<!--<div class="networkContent">33333</div>-->
<!--model上的图标-->
<div :style="{top:(item.y- 80 + 80*(1-zoom))+'px',left:(item.x- 26 + 26*(1-zoom))+'px',transform:'scale('+zoom+')',position:'absolute'}"
v-for="(item,index) in modelTop"
v-for="(item,indexj) in modelTop"
>
<i :class="{'nz-icon':true, 'nz-icon-shuidi':true,'model-error':item.error&&index!==activeIndex,'model-error-active':item.error&&index===activeIndex}"
<i :class="{'nz-icon':true, 'nz-icon-shuidi':true,'model-error':item.error&&(indexj!==activeIndex),'model-error-active':item.error&&indexj==activeIndex}"
v-show="item.show"
:ref="'modelTopId'+index"
@mousedown="modelTopClick(item,index)"
:ref="'modelTopId'+indexj"
@click="modelTopClick(item,indexj)"
>
<!--@mousedown="(e)=>modelTopMouseDown(item,index,e)"-->
<!--@mouseup="modelTopMouseUp(item,index)"-->
@@ -210,15 +210,9 @@
handler(n){
this.allModuleInfos={...n};
this.arrayDiff();
this.topologyReset();
},
},
// nodesArray:{
// immediate: true,
// deep: true,
// handler(n){
// this.setNetworkData(n,this.edgesArray);
// },
// },
},
data(){
return {
@@ -831,6 +825,12 @@
}
return false;
},
topologyReset(){//重置topology默认数据
this.index='';
this.activeIndex='';
this.selNodeId='';
this.NodeArr=[];
},
qqq(){
let nodesArray=[...this.nodesArray];
let edgesArray=[...this.edgesArray];
@@ -967,6 +967,9 @@
this.network.on("dragStart", function (params) {//节点移动开始
this_.NodeArrShow=false;
this_.networkPopShow=false;
this_.index='';
this_.activeIndex='';
let selId=params.nodes[0];
if(selId){
this_.selNodeId=selId
@@ -1005,6 +1008,9 @@
if(this_.NodeArr.length>0){
this_.NodeArrShow=true;
}
if(!this_.networkPopShow){
this_.selNodeId=''
}
this_.modelTopUpdate();
this_.selNodeArrUpdate();
});