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