CN-668 601图表:loading显示和消失的时机问题修改

This commit is contained in:
hyx
2022-08-25 15:14:39 +08:00
parent 7623839097
commit ebcc77312b

View File

@@ -67,7 +67,7 @@
</el-table-column> </el-table-column>
</template> </template>
<template v-slot:empty> <template v-slot:empty>
<div class="table-no-data" v-show="isNoData"> <div class="table-no-data" v-if="isNoData">
<div class="table-no-data__title">{{ $t('npm.noData') }}</div> <div class="table-no-data__title">{{ $t('npm.noData') }}</div>
</div> </div>
</template> </template>
@@ -472,9 +472,9 @@ export default {
return otherData return otherData
}) })
this.toggleLoading(false)
if(!this.chartData || this.chartData.length === 0){ if(!this.chartData || this.chartData.length === 0){
this.isNoData = true this.isNoData = true
this.toggleLoading(false)
}else { }else {
this.isNoData = false this.isNoData = false
} }
@@ -542,6 +542,7 @@ export default {
console.log(e) console.log(e)
}).finally(e => { }).finally(e => {
this.tableData = tableDataTmp this.tableData = tableDataTmp
this.toggleLoading(false)
// 查询需要单独查询的,且需要展示环比图标,列的当前周期的数据 // 查询需要单独查询的,且需要展示环比图标,列的当前周期的数据
let scoreNum = 0 let scoreNum = 0
this.customTableTitles.forEach(tableColumn => { this.customTableTitles.forEach(tableColumn => {
@@ -639,6 +640,7 @@ export default {
}) })
}, },
tabChange (index) { tabChange (index) {
this.tableData = []
this.toggleLoading(true) this.toggleLoading(true)
this.isNoData = false this.isNoData = false
const beforeType = this.$store.getters.getTabOperationBeforeType const beforeType = this.$store.getters.getTabOperationBeforeType
@@ -852,6 +854,7 @@ export default {
q: condition q: condition
} }
} }
this.tableData = []
this.toggleLoading(true) this.toggleLoading(true)
this.$emit('getChartData', this.getCurUrl(), queryParams) this.$emit('getChartData', this.getCurUrl(), queryParams)
} }
@@ -881,6 +884,8 @@ export default {
} }
}, },
handleQueryParams (extraParams) { handleQueryParams (extraParams) {
this.isNoData = false
this.tableData = []
this.toggleLoading(true) this.toggleLoading(true)
let queryType = '' let queryType = ''
const name = this.$store.getters.getBreadcrumbColumnName const name = this.$store.getters.getBreadcrumbColumnName
@@ -1048,8 +1053,10 @@ export default {
}, 250) }, 250)
}) })
}, },
setup (props) {}, setup (props) {
},
unmounted () { unmounted () {
this.isNoData = false
this.$store.commit('setNetworkOverviewTabList', this.list)// 保存状态 this.$store.commit('setNetworkOverviewTabList', this.list)// 保存状态
} }
} }