style: 格式化代码

This commit is contained in:
zhangyu
2020-08-21 15:33:44 +08:00
parent 92cfd0117d
commit edf7329165
3 changed files with 105 additions and 64 deletions

View File

@@ -1,4 +1,5 @@
<template> <template>
<!--<div class="mc" @click.self="clickOutside">-->
<div class="right-box right-box-edit-endpoint"> <div class="right-box right-box-edit-endpoint">
<!-- begin--顶部按钮--> <!-- begin--顶部按钮-->
<div class="right-box-top-btns"> <div class="right-box-top-btns">
@@ -19,8 +20,12 @@
<el-form-item label="Line Name" prop="lineName" class="line-name"> <el-form-item label="Line Name" prop="lineName" class="line-name">
<el-input v-model="form.lineName"></el-input> <el-input v-model="form.lineName"></el-input>
</el-form-item> </el-form-item>
<el-row class="form-title">Option</el-row>
<el-form-item label="width" prop="width" class="line-name">
<el-input v-model="form.width"></el-input>
</el-form-item>
<el-form-item label="箭头方向" prop="arrows" @change="iconChange" class="arrows"> <el-form-item label="箭头方向" prop="arrows" @change="iconChange" class="arrows">
<el-select v-model="form.arrows" placeholder=""> <el-select v-model="form.arrows" placeholder="" :popper-append-to-body="false">
<div slot="prefix"> <div slot="prefix">
<img v-if="form.arrows=='from'" src="./leftArrow.png" /> <img v-if="form.arrows=='from'" src="./leftArrow.png" />
<img v-if="form.arrows=='to'" src="./rightArrow.png" /> <img v-if="form.arrows=='to'" src="./rightArrow.png" />
@@ -38,7 +43,7 @@
<div class="color-show-left" :style="{background:form.color}"></div> <div class="color-show-left" :style="{background:form.color}"></div>
<span> {{form.color}}</span> <span> {{form.color}}</span>
</div> </div>
<div class="color-content"> <div class="color-content" ref="color-content">
<el-color-picker <el-color-picker
v-model="form.color" v-model="form.color"
:predefine="predefineColors" :predefine="predefineColors"
@@ -62,6 +67,7 @@
</button> </button>
</div> </div>
</div> </div>
<!--</div>-->
</template> </template>
<script> <script>
@@ -91,6 +97,7 @@
color:'#1e90ff', color:'#1e90ff',
lineName:'', lineName:'',
lineId:'', lineId:'',
width:''
}, },
predefineColors: [ predefineColors: [
'#ff4500', '#ff4500',
@@ -117,6 +124,7 @@
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let model=Object.assign({id:Math.random()*100},{...this.form},{color: {color:this.form.color,highlight:this.form.color,hover:this.form.color,opacity:1.0}}); let model=Object.assign({id:Math.random()*100},{...this.form},{color: {color:this.form.color,highlight:this.form.color,hover:this.form.color,opacity:1.0}});
model.width = parseInt(model.width) || 4;
this.$emit('addLine',model); this.$emit('addLine',model);
} }
}); });
@@ -133,7 +141,6 @@
this.esc(); this.esc();
}, },
colorPickerClick(){ colorPickerClick(){
console.log(this.$refs['colorPicker']);
this.$refs['colorPicker'].showPicker=true; this.$refs['colorPicker'].showPicker=true;
}, },
iconChange (val) { iconChange (val) {
@@ -159,6 +166,13 @@
</script> </script>
<style scoped> <style scoped>
/*.mc{*/
/*position: fixed;*/
/*width: 100vw;*/
/*height: 100vh;*/
/*top: 0;*/
/*left: 0;*/
/*}*/
.color-content{ .color-content{
height: 0; height: 0;
width: 0; width: 0;
@@ -187,8 +201,16 @@
.line-name{ .line-name{
width: calc(100% - 30px); width: calc(100% - 30px);
} }
.arrows{ .form-title{
font-size: 14px;
color: #333333;
padding-left: 28px;
margin-bottom: 15px;
}
/deep/ .el-form-item__label{
font-size: 14px;
color: #666666;
opacity: 0.6;
} }
.arrows /deep/ .el-input.el-input--prefix.el-input--suffix{ .arrows /deep/ .el-input.el-input--prefix.el-input--suffix{
border: 1px solid #DCDFE6; border: 1px solid #DCDFE6;

View File

@@ -40,7 +40,7 @@
</div> </div>
<div class="facade-top-right" v-loading="alertData.loading"> <div class="facade-top-right" v-loading="alertData.loading">
<div class="facade-top-title"> <div class="facade-top-title">
<span class="label">{{alertData.title}}:</span> <span class="label">{{alertData.title}}</span>
{{alertData.sssObj.total}} {{alertData.sssObj.total}}
</div> </div>
<div class="facade-top-right-content"> <div class="facade-top-right-content">

View File

@@ -71,10 +71,27 @@
</div> </div>
<transition name="right-box"> <transition name="right-box">
<add-model v-if="addNodeShow" @addModel="addModel" :nodeData="nodeData" @close="addNodeShow=false" @del="nodeDel" :isAdd="isNodeAdd" :moduleDataS="moduleDataS"></add-model> <add-model
v-if="addNodeShow"
@addModel="addModel"
:nodeData="nodeData"
@close="addNodeShow=false"
@del="nodeDel"
:isAdd="isNodeAdd"
:moduleDataS="moduleDataS"
></add-model>
</transition> </transition>
<transition name="right-box"> <transition name="right-box">
<add-line v-if="addLineShow" @addLine="addLine" @lineDel="lineDel" :selectNode="NodeArr" :lineData="lineData" :isAdd="isLineAdd" @close="closeAddLine" @del="lineDel"></add-line> <add-line
v-if="addLineShow"
@addLine="addLine"
@lineDel="lineDel"
:selectNode="NodeArr"
:lineData="lineData"
:isAdd="isLineAdd"
@close="closeAddLine"
@del="lineDel"
></add-line>
</transition> </transition>
</div> </div>
</template> </template>
@@ -318,7 +335,9 @@
nodesArray.push(model); nodesArray.push(model);
this.$emit("setTopologyData",nodesArray,this.edgesArray); this.$emit("setTopologyData",nodesArray,this.edgesArray);
this.setNetworkData(nodesArray,this.edgesArray); this.setNetworkData(nodesArray,this.edgesArray);
this.$nextTick(()=>{
this.arrayDiff(); this.arrayDiff();
})
}, },
addModelShow(){ // 显示添加节点弹窗 addModelShow(){ // 显示添加节点弹窗
this.addNodeShow=true; this.addNodeShow=true;
@@ -495,7 +514,7 @@
this_.NodeArr=this_.NodeArr.filter((item,i)=> i != index); this_.NodeArr=this_.NodeArr.filter((item,i)=> i != index);
return return
} }
if(this_.selectNodeTitle){ if(this_.selectNodeTitle&&this_.NodeArrShow){
this_.NodeArr.push(selId); this_.NodeArr.push(selId);
this_.network.selectNodes(this_.NodeArr,true); this_.network.selectNodes(this_.NodeArr,true);
return return
@@ -505,7 +524,7 @@
}); });
this.network.on("selectEdge", function (params) { // 选择边 this.network.on("selectEdge", function (params) { // 选择边
// this_.lineData=this_.edgesArray.find((item)=>item.id===params.edges[0]); this_.lineData=this_.edgesArray.find((item)=>item.id===params.edges[0]);
// this_.lineData.color=this_.lineData.color.color; // this_.lineData.color=this_.lineData.color.color;
// this_.addLineShow=true; // this_.addLineShow=true;
// this_.isLineAdd=false; // this_.isLineAdd=false;