feat:topology 元素居中显示

This commit is contained in:
zhangyu
2021-02-25 10:35:05 +08:00
parent 726a27cad8
commit 4832f225af

View File

@@ -485,6 +485,7 @@
previewShow:false,
penId:undefined,
penToolTipScale:1,
oldScale:1,
};
},
components:{
@@ -662,7 +663,8 @@
let position={
x:this.$refs['topology-canvas'+this.topologyIndexF].offsetWidth,
y:this.$refs['topology-canvas'+this.topologyIndexF].offsetHeight,
}
};
this.oldScale=getTopology(this.topologyIndex).data.scale;
getTopology(this.topologyIndex).data.pens.forEach(item=>{
if(flag){
return
@@ -672,10 +674,8 @@
flag=true
}
});
if(this.fromOverView){
getTopology(this.topologyIndex).centerView(20);
}
this.penToolTipScale= getTopology(this.topologyIndex).data.scale;
getTopology(this.topologyIndex).centerView(20);
this.penToolTipScale = getTopology(this.topologyIndex).data.scale;
setTimeout(()=>{
getTopology(this.topologyIndex).data.pens.forEach(item=>{
if(item.animatePlay){
@@ -1757,6 +1757,9 @@
}
})
});
if(this.penToolTipScale==getTopology(this.topologyIndex).data.scale){
getTopology(this.topologyIndex).data.scale=this.oldScale;
}
this.$put('/project/topo',{topo:JSON.stringify(topologyData),projectId:this.projectInfo.id}).then(res=>{
this.prevent_opt.save=false;
if(res.code===200){
@@ -1851,9 +1854,7 @@
flag=true
}
});
if(this.fromOverView){
getTopology(this.topologyIndex).centerView(20);
}
getTopology(this.topologyIndex).centerView(20);
this.getNodesArr();
},100)
},