CN-856 fix: 修复Dashboard - network overview Metric下拉默认不是第一个时,折线图无法加载

This commit is contained in:
@changcode
2023-01-09 18:40:43 +08:00
parent d84483c0dc
commit a31c408327

View File

@@ -703,9 +703,13 @@ export default {
this.chartOption = null this.chartOption = null
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
if (this.lineTab) { if (this.lineTab) {
const data = this.mpackets.find(t => t.class === this.lineTab) if (this.lineTab === 'total' && this.metric === 'Sessions/s') {
if (data && data.positioning) { this.init()
this.activeChange(data, data.positioning) } else {
const data = this.mpackets.find(t => t.class === this.lineTab)
if (data && data.positioning) {
this.activeChange(data, data.positioning)
}
} }
} else { } else {
this.init() this.init()