diff --git a/nezha-fronted/src/components/common/project/addLine.vue b/nezha-fronted/src/components/common/project/addLine.vue
index c58d44319..b924ad325 100644
--- a/nezha-fronted/src/components/common/project/addLine.vue
+++ b/nezha-fronted/src/components/common/project/addLine.vue
@@ -223,6 +223,7 @@
this.$refs['form'].validate((valid) => {
if (valid) {
let model=Object.assign({id:undefined},{...this.form},{color: {color:this.form.color,highlight:this.form.color,hover:this.form.color,opacity:1.0}});
+ model.label=this.form.lineName;
model.width = parseInt(model.width) || 4;
model.smooth={
roundness:(Math.random()*8 +1)/10 ,//获取0.1-0.9之间的随机数
diff --git a/nezha-fronted/src/components/common/project/topology.vue b/nezha-fronted/src/components/common/project/topology.vue
index 8fd566b36..c2fe84d0a 100644
--- a/nezha-fronted/src/components/common/project/topology.vue
+++ b/nezha-fronted/src/components/common/project/topology.vue
@@ -70,7 +70,7 @@
@@ -195,6 +195,8 @@
},
data(){
return {
+ totalId:'',
+ totalArray:[],
allModuleInfos:[],
relativeModelTop:{},
moduleDataS:[],
@@ -263,7 +265,7 @@
saveTopology(){
let nodes=this.formatNodes([...this.nodesArray]);
let edges=this.formatEdges([...this.edgesArray]);
- this.$put('/project/topo',{topo:JSON.stringify({nodes:nodes,lines:edges}),projectId:this.allModuleInfo.basic.id}).then(res=>{
+ this.$put('/project/topo',{topo:JSON.stringify({nodes:nodes,lines:edges,viewsCenter:this.viewsCenter,zoom:this.zoom}),projectId:this.allModuleInfo.basic.id}).then(res=>{
if(res.code==200){
this.$message({
message: this.$t("tip.saveSuccess"),
@@ -505,7 +507,9 @@
//工具栏
nodeDel(){
let nodesArray=this.nodesArray.filter((item)=>item.id!==this.selNodeId);
- let edgesArray=this.edgesArray.filter((item)=>item.from!==this.selNodeId || this.to!==this.selNodeId);
+ let edgesArray=this.edgesArray.filter((item)=>!(item.from===this.selNodeId || item.to===this.selNodeId));
+ console.log(edgesArray,"edgesArray");
+ this.selNodeId='';
this.$emit('setTopologyData',nodesArray, edgesArray);
this.setNetworkData(nodesArray, edgesArray);
this.networkPopClose();
@@ -524,6 +528,7 @@
// 工具的点击 对应的操作
popClick(id){
+ this.lineData='';
this.popDataShowUpdate(id);
},
modelTopUpdate(){//model上的图标 实时更新
@@ -590,6 +595,14 @@
main:false,
};
if(key&&!this.editVisNetwork){
+ if(key==='total'&&this.selNodeId){
+ this.totalId=this.selNodeId
+ this.totalArray=this.nodesArray;
+ }
+ if(key==='total'&&this.lineData){
+ this.totalId=this.lineData.id;
+ this.totalArray=this.edgesArray;
+ }
this.popDataShow[key]=true;
}
},
@@ -624,7 +637,14 @@
});
this.network.on("selectEdge", function (params) { // 选择边
+ this_.selNodeId='';
this_.lineData=this_.edgesArray.find((item)=>item.id===params.edges[0]);
+ console.log(this_.lineData);
+ if(this_.lineData.expressions&&this_.lineData.expressions.length){
+ this_.popDataShowUpdate('total')
+ }else{
+ this_.popDataShowUpdate()
+ }
// this_.lineData.color=this_.lineData.color.color;
// this_.addLineShow=true;
// this_.isLineAdd=false;
diff --git a/nezha-fronted/src/components/common/project/visNetwork.vue b/nezha-fronted/src/components/common/project/visNetwork.vue
index 2ed4346bf..43612002e 100644
--- a/nezha-fronted/src/components/common/project/visNetwork.vue
+++ b/nezha-fronted/src/components/common/project/visNetwork.vue
@@ -210,7 +210,9 @@
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;
})
},
@@ -246,6 +248,7 @@
item.dashes=[15,15];
item.from=item.source;
item.to=item.target;
+ item.label=item.name;
});
return arr
},