fix: 修复link下钻列表分数计算逻辑
This commit is contained in:
@@ -785,7 +785,11 @@ export function computeScore (data) {
|
|||||||
let k = 0
|
let k = 0
|
||||||
let totalScore = 0
|
let totalScore = 0
|
||||||
const scoreArr = []
|
const scoreArr = []
|
||||||
|
let num = 0
|
||||||
Object.keys(data).forEach(t => {
|
Object.keys(data).forEach(t => {
|
||||||
|
if (!data[t]) {
|
||||||
|
num += 1
|
||||||
|
}
|
||||||
if (t === 'establishLatencyMs' || t === 'tcpLostlenPercent' || t === 'pktRetransPercent') {
|
if (t === 'establishLatencyMs' || t === 'tcpLostlenPercent' || t === 'pktRetransPercent') {
|
||||||
k = 0.3
|
k = 0.3
|
||||||
} else if (t === 'httpResponseLatency' || t === 'sslConLatency') {
|
} else if (t === 'httpResponseLatency' || t === 'sslConLatency') {
|
||||||
@@ -821,6 +825,9 @@ export function computeScore (data) {
|
|||||||
if (totalScore > 6) {
|
if (totalScore > 6) {
|
||||||
totalScore = 6
|
totalScore = 6
|
||||||
}
|
}
|
||||||
|
if (num === 5) {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
return totalScore
|
return totalScore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -534,7 +534,9 @@ export default {
|
|||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
if (this.lineTab) {
|
if (this.lineTab) {
|
||||||
const data = this.mpackets.find(t => t.class === this.lineTab)
|
const data = this.mpackets.find(t => t.class === this.lineTab)
|
||||||
this.activeChange(data, data.positioning)
|
if (data && data.positioning) {
|
||||||
|
this.activeChange(data, data.positioning)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.init()
|
this.init()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user