From 9ae166d778d10a003c65b6351ac208c66edc1d11 Mon Sep 17 00:00:00 2001 From: wgx <31655391@qq.com> Date: Mon, 11 May 2026 19:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A6=E4=B9=A1=E5=A4=A7=E5=B1=8F=E6=94=B9?= =?UTF-8?q?=E9=80=A0=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/index.vue | 62 +++++++++++++++++++++--------------- src/pages/MywrList/index.vue | 16 +++++++--- 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/src/pages/Home/index.vue b/src/pages/Home/index.vue index 381c771..89eb97a 100644 --- a/src/pages/Home/index.vue +++ b/src/pages/Home/index.vue @@ -187,15 +187,15 @@
-
+
畜禽污染监测站
-
+
农田污染监测站
-
+
小流域监测站
@@ -562,6 +562,7 @@ export default { soidShowFlag: false, soilDataId: '', tabsLoading: false, + lastZIndex: 1, }; }, created() { @@ -767,7 +768,7 @@ export default { viewMode: '3D', resizeEnable: true, zoom: zoomnum, - center: [111.436625, 36.771975],//默认的地图中心经纬度 + center: [112.83100231396601, 36.872032399813556],//默认的地图中心经纬度 mapStyle: 'amap://styles/blue', dragEnable: true,//地图是否可通过鼠标拖拽平移,默认为true。此属性可被setStatus/getStatus 方法控制 jogEnable: true,//地图是否使用缓动效果,默认值为true。此属性可被setStatus/getStatus 方法控制 @@ -783,10 +784,15 @@ export default { }); that.aMap.on('complete', (e) => { var markerData = res.result; - let Marker = markerData.filter(ele => ele.type != 'light');//其他类型 + let Marker = markerData.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') Marker.map(item => { let marker = new AMap.Marker({ - zIndex: item.type == 'orient' ? 1000 : 500, + 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),//偏移量 @@ -796,7 +802,8 @@ export default { extPics: item.extPics, notes: item.notes, name: item.name, - item: item + item: item, + stationType: item.type } }); if (item.type == 'orient' || item.type == 'livestock' || item.type == 'watershed') {//监测站弹窗 @@ -804,16 +811,16 @@ 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) + // console.log('livestock or orient', this.qyinformation) }) this.markersOrient.push(marker) } else if(item.type == 'soil'){//土壤弹窗,长期监测站 marker.on('click', e => { this.soilDataId = e.target.getExtData() this.soidShowFlag = true - console.log('soil click', ) + // console.log('soil click', ) }) - this.markersSoil.push(marker) + this.markersSoil.push(marker); } else { this.markersOther.push(marker) } @@ -823,7 +830,7 @@ export default { // that.aMap.setFitView(null, false, [100,400,200,200], 16); that.aMap.setFitView(); setTimeout(() => { - that.aMap.setFitView(null, false, [130, 380, 200, 200], 16); + that.aMap.setFitView(null, false, [130, 380, 480, 480], 16); // let temp = that.aMap.getCenter();//矫正显示标点位置在正中心 // that.aMap.setZoomAndCenter(that.aMap.getZoom()-1, [temp.lng, temp.lat - 0.15]); }, 2000) @@ -1046,15 +1053,15 @@ export default { // 跳转页面3 jumpStationPage(e) { let stationCode = e.stationCode - if (e.stationType == 'livestock') { - this.$router.push({path: '/CqyzList', query: {stationCode: stationCode}}) - // this.$message({ - // message: '站点正在建设中......', - // showClose: true, - // }); - } else { + // if (e.stationType == 'livestock') { + // this.$router.push({path: '/CqyzList', query: {stationCode: stationCode}}) + // // this.$message({ + // // message: '站点正在建设中......', + // // showClose: true, + // // }); + // } else { this.$router.push({path: '/MywrList', query: {stationCode: stationCode}}) - } + // } }, // 弹窗退出登录 handleClosetuichu(done) { @@ -1109,22 +1116,27 @@ export default { this.lastClickIcon = '' } else { this.lastClickIcon = flag; - if (flag == 'duizhuhe') { - arr = this.markersOrient.filter(item => item.getExtData().name.indexOf("对竹河") != -1); - } else if (flag == 'tuanbaihe') { - arr = this.markersOrient.filter(item => item.getExtData().name.indexOf("团柏河") != -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; } } if (arr && arr.length > 0) { - that.aMap.setFitView(arr, false, [200, 500, 300, 300], 16); + arr.map(item => { + item.setzIndex((that.lastZIndex+=2)); + }); + that.aMap.setFitView(arr, false, [200, 500, 360, 360], 16); // 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, 200, 200], 16); + that.aMap.setFitView(null, false, [100, 400, 360, 360], 16); } } }, diff --git a/src/pages/MywrList/index.vue b/src/pages/MywrList/index.vue index 7fc00b4..d3d5a60 100644 --- a/src/pages/MywrList/index.vue +++ b/src/pages/MywrList/index.vue @@ -370,7 +370,8 @@
- + +
@@ -389,9 +390,15 @@
-
+ +
暂无预警数据
+
+
+ +
+
@@ -499,7 +506,7 @@ export default { }], echartObj: null, animateObj: [], - alertList: [], + alertList: null, }; }, destroyed() { @@ -527,6 +534,8 @@ export default { }, methods: { doDestroyed(){ + let that = this; + that.alertList = null; //离开页面时销毁 Object.values(this.timer).map(item => { if(item){ @@ -540,7 +549,6 @@ export default { }); this.interval = {}; this.timer = {}; - let that = this; if(that.player){ Object.keys(that.player).forEach(key => { if(that.player[key]){