完成改造
This commit is contained in:
parent
3376e0fb53
commit
c823be81ff
|
|
@ -207,10 +207,19 @@
|
|||
<!-- <img src="@/assets/image/soil.png" class="xcdimg" alt="">-->
|
||||
<!-- <span class="scdlist_tit">长期定位监测站</span>-->
|
||||
<!-- </div>-->
|
||||
<div class="scdlist" @click="switchIcon('light')">
|
||||
<img src="@/assets/image/address4.png" class="xcdimg" alt="">
|
||||
<span class="scdlist_tit">联网式太阳能杀虫灯</span>
|
||||
<div class="scdlist">
|
||||
<img src="@/assets/image/address4.png" class="xcdimg" alt="" @click="switchLightIcon('light')">
|
||||
<span class="scdlist_tit" @click="switchIcon('light')">联网式太阳能杀虫灯</span>
|
||||
</div>
|
||||
<el-tooltip content="杀虫灯显示开关" effect="dark" placement="top">
|
||||
<el-switch
|
||||
v-model="switchValue"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="switchLightIcon"
|
||||
style="position: fixed;bottom:17.2vw;right:25%;z-index: 999;">
|
||||
</el-switch>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<transition enter-active-class="animate__animated animate__backInUp"
|
||||
leave-active-class="animate__animated animate__backOutDown">
|
||||
|
|
@ -647,24 +656,11 @@ export default {
|
|||
item.longitude = item.entLong;
|
||||
item.latitude = item.entLat;
|
||||
item.name = item.entName;
|
||||
item.picUrl = 'temp/enticon.png';
|
||||
item.picUrl = item.entMapIcon||'temp/enticon.png';
|
||||
item.width = 0 ;
|
||||
item.height = 0;
|
||||
// zIndex: item.type == 'soil' ? that.lastZIndex : (that.lastZIndex+1),
|
||||
// icon: this.urlimg + item.picUrl,
|
||||
// position: [item.longitude, item.latitude],
|
||||
// offset: new AMap.Pixel(item.width, item.height),//偏移量
|
||||
// title: item.name,
|
||||
return item;
|
||||
});
|
||||
// ids: item.ids,
|
||||
// extPics: item.extPics,
|
||||
// notes: item.notes,
|
||||
// name: item.name,
|
||||
// item: item,
|
||||
// stationType: item.type
|
||||
//
|
||||
console.log(that.entList,'111222')
|
||||
that.$nextTick(() => {
|
||||
that.initMap(that.iniZoomData, that.isShowLightNumber);
|
||||
})
|
||||
|
|
@ -835,24 +831,23 @@ export default {
|
|||
});
|
||||
that.aMap.on('complete', (e) => {
|
||||
let Marker = res.result.filter(ele => {
|
||||
return ele.type != 'air' && ele.type != 'soil' && ele.type != 'light'
|
||||
return ele.type != 'air' && ele.type != 'soil' && ele.type != 'light' && ele.type != 'cusLocaltion'
|
||||
}
|
||||
).sort((a,b) => {
|
||||
if (b.type=='soil') return 1;
|
||||
if (b.type!='soil') return -1;
|
||||
return 0;
|
||||
if (b.type=='soil') return 1;
|
||||
if (b.type!='soil') return -1;
|
||||
return 0;
|
||||
});//其他类型
|
||||
let MarkerLight = res.result.filter(ele => ele.type == 'light' );
|
||||
// console.log(Marker,'Marker')
|
||||
// Marker.push(...this.entList);//加入企业点位数组
|
||||
Marker.push(...this.entList);//加入企业点位数组
|
||||
// console.log("初始化地图。2", Marker)
|
||||
Marker.map(item => {
|
||||
if(!item.longitude && !item.latitude){
|
||||
console.log("item = ", item)
|
||||
if(!item.longitude || !item.latitude){
|
||||
console.log("item坐标缺失:", item)
|
||||
return;
|
||||
}
|
||||
let marker = null;
|
||||
marker = new AMap.Marker({
|
||||
let marker = new AMap.Marker({
|
||||
zIndex: item.type == 'soil' ? that.lastZIndex : (that.lastZIndex+1),
|
||||
icon: this.urlimg + item.picUrl,
|
||||
position: [item.longitude, item.latitude],
|
||||
|
|
@ -887,6 +882,7 @@ export default {
|
|||
this.markersSoil.push(marker);
|
||||
} else if(item.type == "ent"){//企业类型
|
||||
marker.on("click", e => {
|
||||
console.log('click ent')
|
||||
this.qyinformation= e.target.getExtData().item
|
||||
if(this.qyinformation.entPics){
|
||||
this.qyinformation.extPics = this.qyinformation.entPics.split(",");
|
||||
|
|
@ -921,7 +917,7 @@ export default {
|
|||
}
|
||||
);
|
||||
that.markersLight.push(clusterMarker);
|
||||
clusterMarker.setMap(that.aMap);
|
||||
setTimeout(()=>{clusterMarker.setMap(that.aMap);}, 3500);
|
||||
}
|
||||
this.$forceUpdate();
|
||||
// that.aMap.setFitView(null, false, [100,400,200,200], 16);
|
||||
|
|
@ -1232,6 +1228,17 @@ export default {
|
|||
} else {
|
||||
that.aMap.setFitView(that.markersOrient, false, [100, 400, 360, 360], that.normalZoomData);
|
||||
}
|
||||
},
|
||||
switchLightIcon(){
|
||||
this.markersLight.map(item => {
|
||||
if(item.hide1){
|
||||
item.show();
|
||||
item.hide1 = false;
|
||||
} else {
|
||||
item.hide();
|
||||
item.hide1 = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
@ -2068,4 +2075,11 @@ a:hover {
|
|||
.grid-content{
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
.jctc_add {
|
||||
//height: 1vw;
|
||||
min-height: 1vw !important;
|
||||
padding-left: 18px;
|
||||
margin-top: 0.6vw;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue