fix: npm 下钻折线图切换数据展示错误问题

This commit is contained in:
@changcode
2022-10-20 13:56:39 +08:00
parent 75dd68f403
commit c38b5ef000

View File

@@ -198,15 +198,15 @@ export default {
this.mpackets = mpackets this.mpackets = mpackets
this.echartsInit(this.mpackets) this.echartsInit(this.mpackets)
} else if (t.type === 'sessions' && val === 'Sessions/s') { } else if (t.type === 'sessions' && val === 'Sessions/s') {
const npmQuantity = _.cloneDeep(this.npmQuantity) const mpackets = _.cloneDeep(this.mpackets)
npmQuantity[0].data = t.sessionsRate.values ? t.sessionsRate.values : [] mpackets[0].data = t.sessionsRate.values ? t.sessionsRate.values : []
npmQuantity.forEach((e, i) => { mpackets.forEach((e, i) => {
if (i !== 0) { if (i !== 0) {
e.show = false e.show = false
} }
}) })
this.npmQuantity = npmQuantity this.mpackets = mpackets
this.echartsInit(this.npmQuantity) this.echartsInit(this.mpackets)
} else if (t.type === 'establishLatencyMs' && val === 'establishLatencyMs') { } else if (t.type === 'establishLatencyMs' && val === 'establishLatencyMs') {
const npmQuantity = _.cloneDeep(this.npmQuantity) const npmQuantity = _.cloneDeep(this.npmQuantity)
npmQuantity[0].data = t.establishLatencyMsAvg.values ? t.establishLatencyMsAvg.values : [] npmQuantity[0].data = t.establishLatencyMsAvg.values ? t.establishLatencyMsAvg.values : []
@@ -223,7 +223,6 @@ export default {
const npmQuantity = _.cloneDeep(this.npmQuantity) const npmQuantity = _.cloneDeep(this.npmQuantity)
npmQuantity[1].data = t.httpResponseLatencyAvg.values ? t.httpResponseLatencyAvg.values : [] npmQuantity[1].data = t.httpResponseLatencyAvg.values ? t.httpResponseLatencyAvg.values : []
npmQuantity.forEach((e, i) => { npmQuantity.forEach((e, i) => {
console.log(e)
if (i !== 1) { if (i !== 1) {
e.show = false e.show = false
} else { } else {