fix: 修复link下钻列表分数计算逻辑

This commit is contained in:
@changcode
2022-11-03 10:56:06 +08:00
parent 078ec2f69f
commit e5b636905f
2 changed files with 10 additions and 1 deletions

View File

@@ -785,7 +785,11 @@ export function computeScore (data) {
let k = 0
let totalScore = 0
const scoreArr = []
let num = 0
Object.keys(data).forEach(t => {
if (!data[t]) {
num += 1
}
if (t === 'establishLatencyMs' || t === 'tcpLostlenPercent' || t === 'pktRetransPercent') {
k = 0.3
} else if (t === 'httpResponseLatency' || t === 'sslConLatency') {
@@ -821,6 +825,9 @@ export function computeScore (data) {
if (totalScore > 6) {
totalScore = 6
}
if (num === 5) {
return '-'
}
return totalScore
}

View File

@@ -534,7 +534,9 @@ export default {
this.timer = setTimeout(() => {
if (this.lineTab) {
const data = this.mpackets.find(t => t.class === this.lineTab)
if (data && data.positioning) {
this.activeChange(data, data.positioning)
}
} else {
this.init()
}