增加企业点位显示

This commit is contained in:
wgx 2026-09-10 19:13:32 +08:00
parent 3ac1c6f49f
commit 2f8aeabaa1
4 changed files with 139 additions and 29 deletions

View File

@ -112,6 +112,15 @@ export function getSoilSummry(data) {
headers: {},
})
}
// 获取企业列表
export function getCompanyList() {
return requests({
url: '/zh-applet-admin/appmana/bigScreen/getEntList',
method: 'get',
headers: {},
})
}
// 查询设备下各检测项的历史数据
export function survItemSummary(obj) {
return requests({

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -203,6 +203,10 @@
<!-- <img src="@/assets/image/soil.png" class="xcdimg" alt="">-->
<!-- <span class="scdlist_tit">长期定位监测站</span>-->
<!-- </div>-->
<div class="scdlist" @click="switchIcon('ent')">
<img src="@/assets/image/enticon.png" class="xcdimg" alt="">
<span class="scdlist_tit">企业信息</span>
</div>
</div>
<transition enter-active-class="animate__animated animate__backInUp"
leave-active-class="animate__animated animate__backOutDown">
@ -450,7 +454,7 @@
</div>
<el-row>
<el-col :span="12">
<div class="grid-content bg-purple" style="width:80%;margin-left:10%;">
<div class="grid-content bg-purple" style="">
<el-carousel indicator-position="outside">
<el-carousel-item v-for="(item,index) in qyinformation.extPics" :key="index">
<viewer :images="qyinformation.extPics">
@ -462,8 +466,8 @@
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple-light">
<span class="tctit">{{ qyinformation.name }}</span>
<span class="tcgldw">{{ qyinformation.notes }}</span>
<span class="tctit">{{ qyinformation.entName }}</span>
<span class="tcgldw">{{ qyinformation.entIntro }}</span>
</div>
</el-col>
</el-row>
@ -482,7 +486,7 @@ import ScaleBox from 'vue2-scale-box'
import {
displayInfo,
fwlist,
getAllstationAndPestLight,
getAllstationAndPestLight,getCompanyList,
getIndexSummry,
getNewestData,
getPollutionDict,
@ -626,10 +630,36 @@ export default {
// })
// }, 2000)
//
let that = this;
setTimeout(() => {
this.$nextTick(() => {
this.initMap(this.zoomData, this.isShowLightNumber);
})
getCompanyList().then(res => {
that.entList = res.result.map(item => {
item.type = 'ent';
item.longitude = item.entLong;
item.latitude = item.entLat;
item.name = item.entName;
item.picUrl = '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);
})
});
}, 2000)
//
this.getNowTime();
@ -773,6 +803,7 @@ export default {
},
initMap(zoomnum, isShowLight) {
let that = this;
let defaultLng = 110.719361, defaultLat = 36.068184;
// let isShowLight = this.isShowLightNumber
getAllstationAndPestLight(isShowLight).then(res => {
//
@ -780,7 +811,7 @@ export default {
viewMode: '3D',
resizeEnable: true,
zoom: zoomnum,
center: [110.719361, 36.068184],//
center: [defaultLng, defaultLat],//
mapStyle: 'amap://styles/blue',
dragEnable: true,//truesetStatus/getStatus
jogEnable: true,//使truesetStatus/getStatus
@ -795,20 +826,25 @@ export default {
scale: (2, 2.5)
});
that.aMap.on('complete', (e) => {
var markerData = res.result;
let Marker = markerData.filter(ele => ele.type != 'light').sort((a,b) => {
let Marker = res.result.filter(ele => ele.type != 'light').sort((a,b) => {
if (b.type=='soil') return 1;
if (b.type!='soil') return -1;
return 0;
});//
console.log(Marker,'Marker')
});//
// console.log(Marker,'Marker')
Marker.push(...this.entList);
console.log("初始化地图。2", Marker)
Marker.map(item => {
let marker = new AMap.Marker({
zIndex: item.type == 'soil' ? that.lastZIndex : (that.lastZIndex+1),
zIndex: (item.type == 'orient' || item.type == 'livestock' || item.type == 'watershed') ? (that.lastZIndex+1): (that.lastZIndex),
icon: this.urlimg + item.picUrl,
position: [item.longitude, item.latitude],
position: [item.longitude || defaultLng, item.latitude || defaultLat],
offset: new AMap.Pixel(item.width, item.height),//
title: item.name,
label: {
content: item.type == "ent"? item.name : '',
direction: 'top'
},
extData: {
ids: item.ids,
extPics: item.extPics,
@ -823,7 +859,6 @@ export default {
let indexnumb = e.target.getExtData().ids.slice(-1);
this.qcdtinfor = this.stationInfoList[indexnumb]
this.qcdtdialogTableVisible = true
// console.log('livestock or orient', this.qyinformation)
})
this.markersOrient.push(marker)
} else if(item.type == 'soil'){//
@ -833,7 +868,19 @@ export default {
// console.log('soil click', )
})
this.markersSoil.push(marker);
} else {
} else if(item.type == "ent"){//
marker.on("click", e => {
this.qyinformation= e.target.getExtData().item
if(this.qyinformation.entPics){
this.qyinformation.extPics = this.qyinformation.entPics.split(",");
}else {
this.qyinformation.extPics = []
}
console.log("this.qyinformation",this.qyinformation)
this.qyinfordtdialogTableVisible = true
})
this.markersOrient.push(marker);
} else {
this.markersOther.push(marker)
}
marker.setMap(that.aMap);
@ -1128,27 +1175,34 @@ export default {
this.lastClickIcon = ''
} else {
this.lastClickIcon = flag;
if (flag == 'livestock') {
arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("livestock") != -1);
} else if (flag == 'orient') {
arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("orient") != -1);
} else if (flag == 'watershed') {
arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("watershed") != -1);
} else if (flag == 'soil') {
if (flag == 'soil') {
arr = this.markersSoil;
} else {
arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf(flag) != -1);
}
// if (flag == 'livestock') {
// arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("livestock") != -1);
// } else if (flag == 'orient') {
// arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("orient") != -1);
// } else if (flag == 'watershed') {
// arr = this.markersOrient.filter(item => item.getExtData().stationType.indexOf("watershed") != -1);
// } else if (flag == 'soil') {
// arr = this.markersSoil;
// } else if (flag == 'ent') {
// arr = this.markersSoil;
// }
}
if (arr && arr.length > 0) {
arr.map(item => {
item.setzIndex((that.lastZIndex+=2));
});
that.aMap.setFitView(arr, false, [300, 500, 360, 360], 16);
that.aMap.setFitView(arr, false, [300, 500, 360, 360], that.focusZoomData);
// setTimeout(() => {
// let temp = that.aMap.getCenter();//
// that.aMap.setZoomAndCenter(that.aMap.getZoom()-2, [temp.lng, temp.lat - 0.15]);
// },2000)
} else {
that.aMap.setFitView(null, false, [100, 400, 360, 360], 16);
that.aMap.setFitView(null, false, [100, 400, 360, 360], that.normalZoomData);
}
}
},
@ -1767,20 +1821,23 @@ a:hover {
/* 企业弹窗样式 */
.tctit {
font-size: 1.2vw;
color: #fff;
color: #0bf373;
font-weight: bold;
display: block;
margin-bottom: 1.6vw;
margin: 5px auto;
text-align: center;
}
.tcgldw {
font-size: 1vw;
font-size: 0.8vw;
color: #fff;
line-height: 2vw;
display: block;
padding-right: 3%;
height: 15vw;
overflow: auto;
text-indent: 2em;
}
/* 定义滚动条样式 */
@ -1944,5 +2001,49 @@ a:hover {
.mywrcov_onenumjx{
font-size: 1.2vw;
}
.amap-marker-label{
//width: 60px;
font-size: 16px;
line-height: 18px;
text-align: center;
height: 18px;
font-family: STLiti;
color: #bbd6f1;
border-radius: 15px;
padding: 5px;
background-color: rgba(77, 140, 241, 0.84);
border: solid 2px rgba(100,255,200,0.8);
}
.tz_cov{
width: 100%;
height: 30vw;
margin: 0 auto;
/* margin-top: 4vw; */
border: 1px solid #0169d0;
position: relative;
background: rgba(16, 45, 80, 1);
box-shadow: inset 0px 0px 16px 0px rgba(0, 145, 255, 1);
padding: 20px;
}
.tz_cov_top{
width: 40%;
height: 3vw;
margin: 0 auto;
background: url(../../assets/image/tz_tltle_bg.png)no-repeat;
background-size: cover;
text-align: center;
line-height: 3vw;
margin-bottom: 2vw;
}
.tz_cov_top_tit{
font-size: 1vw;
color: #fff;
text-shadow: 0px 2px 0px rgba(4,49,52,0.55);
font-family: douyuFont;
}
.grid-content{
padding: 10px
}
</style>

View File

@ -392,7 +392,7 @@
</el-timeline>
</el-collapse-transition>
<div v-if="alertList && alertList.length <= 0">
<div style="margin:60px auto; width: 100%;font-size: 40px;color: #edd792; text-align: center;">暂无预警数据</div>
<div style="margin:60px auto; width: 100%;font-size: 40px;color: #edd792; text-align: center;">暂无预警</div>
</div>
<div v-if="!alertList">
<div style="margin:60px auto; width: 100%;font-size: 30px;color: #edd792; text-align: center;">
@ -591,7 +591,7 @@ export default {
doGetAlertRecord({stationCode: this.stationCode, pageSize: 3}).then(res => {
console.warn('监测预警数据',res)
if (res.code === 200) {
if(res.result.records.length === 0 && this.stationDetail.latestData !== 0){
if(res.result.records.length === 0 && this.stationDetail && this.stationDetail.latestData && this.stationDetail.latestData.length !== 0){
//itemName survValue survUnit normalValue survUnit readStatus alertTime
let tempData = [];
this.stationDetail.latestData.map(item => {