处理station页面加载的loading弹窗切换路由后依旧显示的问题

This commit is contained in:
renpy 2023-09-01 18:14:28 +08:00
parent 10d31adf6d
commit 08b707d45b

View File

@ -180,6 +180,17 @@ export default {
ScrollContainer,
DataListItem
},
watch: {
"$route": {
handler:function(val,oldVal) {
if (val.name!=="station-operation") {
this.$message.destroy()
}
},
deep:true,
immediate:true
}
},
data() {
return {
activeKey: '1',
@ -191,7 +202,7 @@ export default {
followedDataList: [], //
markerList: [], //
markerList_clone: [], //
upDateStationList: [], //
upDateStationList: [], //
orgStationList: [], //
markerType: 1, //
circleRadius: 0,
@ -254,13 +265,15 @@ export default {
//
async getDataProvisionEfficiency(arr, str) {
if (str) {
if (str && 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()
str&&this.$message.success({ content: 'Loaded!', key, duration: 2 })
if (str && this.$route.path == "/station-operation") {
this.$message.success({ content: 'Loaded!', key, duration: 2 })
}
res.result.forEach(item => {
arr.forEach(el => {
if (parseInt(item.id) == el.stationId&&el.stationType!="Nuclear Facility"&&el.stationType!="NRL") {