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]') {