feat:修改闲可以选择虚线实线,以及虚线的间距

This commit is contained in:
zhangyu
2020-09-07 17:29:18 +08:00
parent 92d3fb967d
commit ab2341d76b
18 changed files with 17 additions and 3 deletions

View File

@@ -37,6 +37,16 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.topology.width')" prop="width" class="line-width">
<el-select v-model="form.dashes" placeholder="" :popper-append-to-body="false" size="small">
<div slot="prefix">
{{form.dashes}}
</div>
<el-option v-for="(item,index) in dashesOption" :label="item+'px'" :value="item" :key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('project.topology.arrows')" prop="arrows" class="arrows"> <el-form-item :label="$t('project.topology.arrows')" prop="arrows" class="arrows">
<el-select v-model="form.arrows" placeholder="" :popper-append-to-body="false" size="small"> <el-select v-model="form.arrows" placeholder="" :popper-append-to-body="false" size="small">
<div slot="prefix"> <div slot="prefix">
@@ -213,6 +223,7 @@
width:n.width, width:n.width,
lineName:n.label, lineName:n.label,
name:[], name:[],
dashes:!n.dashes?n.dashes:JSON.stringify(n.dashes),
}; };
if( n.expressions){ if( n.expressions){
n.expressions.forEach((item,index)=>{ n.expressions.forEach((item,index)=>{
@@ -241,6 +252,7 @@
type:'', type:'',
roundness:'', roundness:'',
name:[], name:[],
dashes:''
}, },
predefineColors: [ predefineColors: [
'#ff4500', '#ff4500',
@@ -259,6 +271,7 @@
elementIds:[], elementIds:[],
legends:[], legends:[],
widthOption:['1','2','3','4'], widthOption:['1','2','3','4'],
dashesOption:[false,'[3,3]','[9,9]','[15,15]','[21,21]'],
unit:[], unit:[],
rules:{ rules:{
// arrows: [ // arrows: [
@@ -289,6 +302,7 @@
roundness:(Math.random()*8 +1)/10 ,//获取0.1-0.9之间的随机数 roundness:(Math.random()*8 +1)/10 ,//获取0.1-0.9之间的随机数
type:'curvedCW', type:'curvedCW',
}; };
model.dashes=!model.dashes?model.dashes:JSON.parse(model.dashes);
model.expressions=[]; model.expressions=[];
this.promqlKeys.forEach((item,index)=>{ this.promqlKeys.forEach((item,index)=>{
model.expressions.push({ model.expressions.push({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

View File

@@ -170,7 +170,7 @@
color:'#1e90ff', color:'#1e90ff',
lineId:'', lineId:'',
width:'1', width:'1',
dashed:'[5,5]', dashes:false,
id:'', id:'',
}; };
this.addLineShow=true; this.addLineShow=true;
@@ -229,6 +229,7 @@
color:'#1e90ff', color:'#1e90ff',
lineId:'', lineId:'',
id:'', id:'',
dashes:[],
}, },
hoverEdge:false, hoverEdge:false,
isLineAdd:true, isLineAdd:true,
@@ -321,6 +322,7 @@
"target": item.to, "target": item.to,
"smooth": item.smooth, "smooth": item.smooth,
"expressions": item.expressions, "expressions": item.expressions,
"dashes":item.dashes,
}; };
arr1.push(obj) arr1.push(obj)
}); });
@@ -488,7 +490,6 @@
}else{ }else{
edges.from=this.NodeArr[0]; edges.from=this.NodeArr[0];
edges.to=this.NodeArr[1]; edges.to=this.NodeArr[1];
edges.dashes=[15,15];
} }
edgesArray.push(edges); edgesArray.push(edges);
this.$emit("setTopologyData",this.nodesArray,edgesArray); this.$emit("setTopologyData",this.nodesArray,edgesArray);

View File

@@ -265,7 +265,6 @@
let arr1=[]; let arr1=[];
if(!arr){return arr1} if(!arr){return arr1}
arr.forEach((item)=>{ arr.forEach((item)=>{
item.dashes=[5,5];
item.from=item.source; item.from=item.source;
item.to=item.target; item.to=item.target;
item.label=item.name; item.label=item.name;