fix: 修复曲线图在数据所有tab的max都为0的情况下会重复请求的问题
This commit is contained in:
@@ -192,6 +192,9 @@ export default {
|
||||
if (response.status === 200) {
|
||||
this.isNoData = res.data.result.length === 0
|
||||
this.showError = false
|
||||
if (!active) {
|
||||
this.tabs = _.cloneDeep(this.tabsTemplate)
|
||||
}
|
||||
if (this.isNoData) {
|
||||
this.lineTab = ''
|
||||
this.tabs = _.cloneDeep(this.tabsTemplate)
|
||||
@@ -512,6 +515,7 @@ export default {
|
||||
})
|
||||
this.tabs = tabs
|
||||
this.$nextTick(() => {
|
||||
this.lineRefer = 'Average'
|
||||
this.echartsInit(this.tabs, true)
|
||||
})
|
||||
} else {
|
||||
@@ -542,10 +546,15 @@ export default {
|
||||
if (parseFloat(e.analysis.max) <= 0) {
|
||||
self.lineTab = ''
|
||||
self.lineRefer = ''
|
||||
self.init()
|
||||
// self.init()
|
||||
}
|
||||
}
|
||||
})
|
||||
const emptyData = tabs.filter(d => parseFloat(d.analysis.max) === 0)
|
||||
this.isNoData = emptyData.length === tabs.length
|
||||
if (this.isNoData) {
|
||||
return true
|
||||
}
|
||||
this.tabs = tabs
|
||||
if (num === 5) {
|
||||
tabs[0].invertTab = false
|
||||
|
||||
Reference in New Issue
Block a user