fix: 下钻表格切换tab时loading不对的问题

This commit is contained in:
chenjinsong
2022-10-11 17:08:25 +08:00
parent f659cf60a3
commit 19206b8144

View File

@@ -303,30 +303,28 @@ export default {
methods: { methods: {
/* 参数 extraParams 额外请求参数 */ /* 参数 extraParams 额外请求参数 */
getChartData (extraParams = {}) { getChartData (extraParams = {}) {
try { this.initState()
this.initState() // const chartParams = this.chart.params
// const chartParams = this.chart.params const queryParams = {
const queryParams = { ...this.handleQueryParams(extraParams),
...this.handleQueryParams(extraParams), startTime: getSecond(this.timeFilter.startTime),
startTime: getSecond(this.timeFilter.startTime), endTime: getSecond(this.timeFilter.endTime)
endTime: getSecond(this.timeFilter.endTime) }
const requestUrl = this.getCurUrl()
get(requestUrl, queryParams).then(response => {
if (response.code === 200) {
this.chartData = response.data.result
this.initData()
} else {
this.isNoData = true
this.toggleLoading(false)
} }
const requestUrl = this.getCurUrl() }).catch(e => {
get(requestUrl, queryParams).then(response => {
if (response.code === 200) {
this.chartData = response.data.result
this.initData()
} else {
this.isNoData = true
this.toggleLoading(false)
}
})
} catch (e) {
console.error(e) console.error(e)
} finally { }).finally(() => {
this.changeUrlTabState() this.changeUrlTabState()
this.toggleLoading(false) this.toggleLoading(false)
} })
}, },
sortable (title) { sortable (title) {
const excludeName = ['queriesFromIE'] const excludeName = ['queriesFromIE']