From 40115f448f9b1732e0f428b859c5593248cf5227 Mon Sep 17 00:00:00 2001 From: renpy Date: Mon, 28 Aug 2023 20:18:09 +0800 Subject: [PATCH] =?UTF-8?q?station=E6=A8=A1=E5=9D=97=EF=BC=8C=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stationOperation/components/MapMarker.vue | 39 ++++++++++++++++--- src/views/stationOperation/index.vue | 35 ++++++++++++----- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/src/views/stationOperation/components/MapMarker.vue b/src/views/stationOperation/components/MapMarker.vue index 4e840a2..0dee9cb 100644 --- a/src/views/stationOperation/components/MapMarker.vue +++ b/src/views/stationOperation/components/MapMarker.vue @@ -28,6 +28,10 @@ export default { type: Array, required: true }, + currList: { + type: Array, + required: true + }, markerType: { type: Number, default: 1 @@ -151,11 +155,12 @@ export default { // 初始化波纹 initRipples() { - this.list - .filter( - stationInfo => - stationInfo.stationType !== MarkerType.NuclearFacility && stationInfo.stationType !== MarkerType.NRL - ) + console.log("xuanran",this.currList); + this.currList + // .filter( + // stationInfo => + // stationInfo.stationType !== MarkerType.NuclearFacility && stationInfo.stationType !== MarkerType.NRL + // ) .forEach(stationInfo => { this.map.addOverlay(this.getRipple(stationInfo)) }) @@ -236,6 +241,14 @@ export default { } }, watch: { + // list: { + // // 数据变化时执行的逻辑代码 + // handler(newName, oldName) { + // console.log(newName); + // }, + // // 开启深度监听 + // deep: true + // } list() { this.map.getOverlays().clear() this.initMapPopup() @@ -244,6 +257,22 @@ export default { if (this.markerType == 2) { this.initCircles() } + }, + currList: { + handler(newVal, oldVal) { + console.log(newVal); + newVal.forEach(item => { + var layer = this.map.getOverlays().getArray().find(layer=> { + return layer.id === `ripple_${item.stationType}_${item.stationId}`; + }); + console.log("adfasdfadsf",layer); + if (layer) { + this.map.removeOverlay(layer); + } + }) + this.initRipples() + }, + deep:true } } } diff --git a/src/views/stationOperation/index.vue b/src/views/stationOperation/index.vue index 3484244..86f36e2 100644 --- a/src/views/stationOperation/index.vue +++ b/src/views/stationOperation/index.vue @@ -144,7 +144,7 @@ ref="mapRef" token="AAPK2b935e8bbf564ef581ca3c6fcaa5f2a71ZH84cPqqFvyz3KplFRHP8HyAwJJkh6cnpcQ-qkWh5aiyDQsGJbsXglGx0QM2cPm" > - + { setTimeout(() => { this.getDataProvisionEfficiency(this.markerList_clone) + // this.upDateStationList.forEach(item => { + // if (item.quality=="excellent") { + // item.quality="bad" + // } + // }) }, 0); }, 15000); this.$nextTick(() => { @@ -244,19 +250,28 @@ export default { // 查询台站数据提供率及有效率 async getDataProvisionEfficiency(arr) { - this.markerList=[] try { const res = await getAction('/stationOperation/getDataProvisionEfficiency') - console.log("getDataProvisionEfficiency", res); - arr.forEach(item => { - res.result.forEach(data => { - if (parseInt(data.id) == item.stationId) { - item.quality = data.quality + // console.log("getDataProvisionEfficiency", res); + res.result.forEach(item => { + arr.forEach(el => { + if (parseInt(item.id) == el.stationId) { + item.stationType = el.stationType + item.stationId = el.stationId } }) - this.markerList.push(item) }) - console.log("this.markerListthis.markerListthis.markerList",this.markerList); + // console.log(res.result); + this.upDateStationList = res.result + // arr.forEach(item => { + // res.result.forEach(data => { + // if (parseInt(data.id) == item.stationId) { + // item.quality = data.quality + // } + // }) + // this.markerList.push(item) + // }) + // console.log("this.markerListthis.markerListthis.markerList",this.markerList); } catch (error) { console.error(error) }