feat:添加取消按钮
This commit is contained in:
@@ -106,6 +106,7 @@
|
||||
:allModuleInfo="allModuleInfo"
|
||||
v-loading="topologyLoading"
|
||||
@editVisNetworkChange="editVisNetworkChange"
|
||||
@reload="reload"
|
||||
>
|
||||
</topology>
|
||||
</div>
|
||||
@@ -216,6 +217,29 @@
|
||||
this.$refs['topology'].zoom=1;
|
||||
})
|
||||
},
|
||||
reload(){
|
||||
this.topologyLoading=true;
|
||||
this.editVisNetwork=false;
|
||||
this.$get('/project/topo',{projectId:this.projectInfo.id}).then(res=>{
|
||||
if(res.data.topo&&res.data.topo.nodes.length>0){
|
||||
this.nodesArray=[];
|
||||
this.edgesArray=[];
|
||||
this.nodesArrayOther=this.formatNodesArr(res.data.topo.nodes);
|
||||
this.edgesArrayOther=this.formatEdgesArr(res.data.topo.lines);
|
||||
}else{
|
||||
this.nodesArray=[];
|
||||
this.edgesArray=[];
|
||||
setTimeout(()=>{
|
||||
this.topologyLoading=false;
|
||||
this.$refs['topology'].setData();
|
||||
},500)
|
||||
}
|
||||
// res.data.topo.viewsCenter?res.data.topo.viewsCenter:
|
||||
this.$refs['topology'].viewsCenter={x:0,y:0};
|
||||
// res.data.topo.zoom?res.data.topo.zoom:
|
||||
this.$refs['topology'].zoom=1;
|
||||
})
|
||||
},
|
||||
formatNodesArr(arr){
|
||||
let arr1=[];
|
||||
if(!arr || arr.length==0){
|
||||
|
||||
Reference in New Issue
Block a user