From fa9ad25892c63699f47284fc1b518b6bdba3f64a Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Tue, 12 Mar 2024 14:01:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=E5=8F=B0=E7=AB=99=E5=9C=B0=E5=9B=BE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8F=B0=E7=AB=99=E5=88=97=E8=A1=A8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B0=8F=E8=BD=A6=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E8=AF=B7=E6=B1=82=E7=9A=84=E6=97=A5=E6=9C=9F=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stationOperation/components/MapPane.vue | 10 +++---- src/views/stationOperation/index.vue | 26 +++++-------------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/views/stationOperation/components/MapPane.vue b/src/views/stationOperation/components/MapPane.vue index e250db4..ade94d8 100644 --- a/src/views/stationOperation/components/MapPane.vue +++ b/src/views/stationOperation/components/MapPane.vue @@ -169,18 +169,16 @@
Start Date
End Date
diff --git a/src/views/stationOperation/index.vue b/src/views/stationOperation/index.vue index 40b78d6..ebdc8c5 100644 --- a/src/views/stationOperation/index.vue +++ b/src/views/stationOperation/index.vue @@ -183,19 +183,6 @@ export default { ScrollContainer, DataListItem, }, - watch: { - $route: { - handler: function (val, oldVal) { - console.log('fasdfasde12312', val) - console.log('8765432', oldVal) - if (val.name === 'station-operation') { - this.getDataProvisionEfficiency(this.markerList_clone) - } - }, - deep: true, - // immediate: true, - }, - }, deactivated() { //等同于 销毁的生命周期 console.log('切换出发了3') @@ -205,6 +192,8 @@ export default { }, activated() { this.getFollowedStationList() + this.getStationList() + this.getStationTree() }, data() { return { @@ -246,9 +235,7 @@ export default { } }, created() { - this.getStationList() this.getStationTypeList() - this.getStationTree() }, beforeDestroy() { clearInterval(this.timer) @@ -270,7 +257,7 @@ export default { this.markerList = cloneDeep(res).filter((stationInfo) => stationInfo.stationType !== MarkerType.NuclearFacility) // 去除核设施 this.markerList_clone = cloneDeep(res) - this.getDataProvisionEfficiency(this.markerList_clone, 'one') + this.getDataProvisionEfficiency(this.markerList_clone) // this.timer = setInterval(() => { // setTimeout(() => { // this.getDataProvisionEfficiency(this.markerList_clone) @@ -287,17 +274,18 @@ export default { }, // 查询台站数据提供率及有效率 - async getDataProvisionEfficiency(arr, str) { + async getDataProvisionEfficiency(arr) { this.httpNum++ - if (str && this.$route.path == '/station-operation') { + if (!this.loaded && this.$route.path == '/station-operation') { this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 }) } getAction('/stationOperation/getDataProvisionEfficiency') .then((res) => { if (res.success) { this.$message.destroy() - if (str && this.$route.path == '/station-operation') { + if (!this.loaded && this.$route.path == '/station-operation') { this.$message.success({ content: 'Loaded!', key, duration: 2 }) + this.loaded = true } res.result.forEach((item) => { if (Object.prototype.toString.call(item) == '[object Object]') {