fix:修复topology 预览页面的bug

This commit is contained in:
zhangyu
2021-03-05 18:29:14 +08:00
parent 0b9a258821
commit ef3c2d8959
2 changed files with 30 additions and 28 deletions

View File

@@ -175,7 +175,7 @@
<button @click="editTopology" class="nz-btn nz-btn-size-normal nz-btn-style-light float-right" <button @click="editTopology" class="nz-btn nz-btn-size-normal nz-btn-style-light float-right"
style="border-right: 1px solid rgba(162,162,162,0.50);margin-right: 12px" type="button" v-has="'project_topo_save'" style="border-right: 1px solid rgba(162,162,162,0.50);margin-right: 12px;margin-top: -2px" type="button" v-has="'project_topo_save'"
> >
<i class="nz-icon nz-icon-edit" :title="$t('project.topology.edit')"></i> <i class="nz-icon nz-icon-edit" :title="$t('project.topology.edit')"></i>
</button> </button>

View File

@@ -50,7 +50,7 @@
<div class="flex middle special-select mb10" <div class="flex middle special-select mb10"
style="width: 75px;height: 28px;display: inline-block;margin: 0 40px 0 20px;background: #fff"> style="width: 75px;height: 28px;display: inline-block;margin: 0 40px 0 20px;background: #fff">
<div class="full pr10"> <div class="full pr10">
<el-select v-model="lineName" :placeholder="$t('el.select.placeholder')" size="small" <el-select v-model="lineName" size="small"
:popper-append-to-body="false" :popper-append-to-body="false"
@change="changeTopologyOpt(lineName,'lineName')"> @change="changeTopologyOpt(lineName,'lineName')">
<div slot="prefix"> <div slot="prefix">
@@ -58,7 +58,7 @@
<svg> <svg>
<g fill="none" stroke="black" stroke-width="1"> <g fill="none" stroke="black" stroke-width="1">
<path <path
:d="penLineType.find((item,i)=>item.name==lineName).d" :d="penLineType.find((item,i)=>item.id==lineName).d"
> >
</path> </path>
</g> </g>
@@ -66,7 +66,7 @@
</div> </div>
</div> </div>
<el-option :disabled="true" :value="false">{{$t('project.topology.defaultLineType')}}</el-option> <el-option :disabled="true" :value="false">{{$t('project.topology.defaultLineType')}}</el-option>
<el-option v-for="(item,index) in penLineType" :value="item.name" :key="index"> <el-option v-for="(item,index) in penLineType" :value="item.id" :key="index">
<div class="icon-item" style="position: relative;width: 100%;padding: 0"> <div class="icon-item" style="position: relative;width: 100%;padding: 0">
<svg> <svg>
<g fill="none" :stroke="(lineName==item.name)?'#ee9d3f':'black'" stroke-width="1"> <g fill="none" :stroke="(lineName==item.name)?'#ee9d3f':'black'" stroke-width="1">
@@ -375,7 +375,10 @@
</div> </div>
</el-dialog> </el-dialog>
<div class="right-bottom-zoom" v-if="!fromOverView&&!editTopologyFlag&&!fromPrev">
<div class="zoom-option" style="border-bottom: 1px solid #c5c8cb;" @click="zoomMap(0.25)"><span><i class="nz-icon nz-icon-enlarge"></i></span></div>
<div class="zoom-option" @click="zoomMap(-0.25)"><span><i class="nz-icon nz-icon-narrow"></i></span></div>
</div>
</div> </div>
</template> </template>
@@ -518,9 +521,9 @@
chartData:{}, chartData:{},
chartGetData:[], chartGetData:[],
penLineType:[ penLineType:[
{d:'M5 19 a50,100 0 0,1 40,0',"stroke-dasharray":"",name:this.$t('project.topology.curve')}, {d:'M5 19 a50,100 0 0,1 40,0',"stroke-dasharray":"",name:this.$t('project.topology.curve'),id:'curve'},
{d:'M5 8 l20 0 l0 12 l20 0',"stroke-dasharray":"",name:this.$t('project.topology.polyline')}, {d:'M5 8 l20 0 l0 12 l20 0',"stroke-dasharray":"",name:this.$t('project.topology.polyline'),id:'polyline'},
{d:'M5 14 l40 0',"stroke-dasharray":"",name:this.$t('project.topology.line')}, {d:'M5 14 l40 0',"stroke-dasharray":"",name:this.$t('project.topology.line'),id:'line'},
// {d:'M5 20 C0,8 50,0 85,0',"stroke-dasharray":"",name:'mind'}, // {d:'M5 20 C0,8 50,0 85,0',"stroke-dasharray":"",name:'mind'},
], ],
lineName:'curve', lineName:'curve',
@@ -1474,18 +1477,19 @@
case 'space': case 'space':
case 'scale': case 'scale':
case 'translate': case 'translate':
if(!this.timer2){ this.getNodesArr();
this.timer2=setTimeout(()=>{ // if(!this.timer2){
this.getNodesArr(); // this.timer2=setTimeout(()=>{
this.timer2=null // this.getNodesArr();
},300) // this.timer2=null
}else{ // },300)
clearTimeout(this.timer2); // }else{
this.timer2=setTimeout(()=>{ // clearTimeout(this.timer2);
this.getNodesArr(); // this.timer2=setTimeout(()=>{
this.timer2=null // this.getNodesArr();
},300) // this.timer2=null
} // },300)
// }
break; break;
} }
},0); },0);
@@ -1695,7 +1699,6 @@
}) })
}else{ }else{
this.imgageLoading=true; this.imgageLoading=true;
this.tools[1].children=[];
let promiseArr=[]; let promiseArr=[];
imgidList.forEach((item,index)=>{ imgidList.forEach((item,index)=>{
if(item.data.imageId){ if(item.data.imageId){
@@ -1775,13 +1778,9 @@
} }
if(item.data.gradientType===0){ if(item.data.gradientType===0){
item.bkType=0; item.bkType=0;
} }else{
if(item.data.gradientType===1 ||item.data.gradientType===3){
item.bkType=1; item.bkType=1;
} }
if(item.data.gradientType===2 ||item.data.gradientType===4){
item.bkType=2;
}
}else if(item.type===1){ }else if(item.type===1){
item.animateColor=item.data.animateColor; item.animateColor=item.data.animateColor;
item.strokeStyle=item.data.strokeStyle; item.strokeStyle=item.data.strokeStyle;
@@ -2054,9 +2053,12 @@
}); });
this.uploadPic.name=''; this.uploadPic.name='';
this.uploadPic.unit=''; this.uploadPic.unit='';
this.file=null this.file=null;
this.uploadPicShow=true; this.uploadPicShow=true;
} },
zoomMap(num){
getTopology(this.topologyIndex).scaleTo(getTopology(this.topologyIndex).data.scale+num);
},
}, },
destroyed(){ destroyed(){
getTopology(this.topologyIndex).destroy(); getTopology(this.topologyIndex).destroy();