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