CN-1335 fix: Link Monitor的下钻页中Total、Ingress、Egress取值不正确
This commit is contained in:
@@ -167,9 +167,9 @@ export const dataForLinkTrafficLine = {
|
||||
}
|
||||
],
|
||||
tabs: [
|
||||
{ analysis: {}, name: 'network.total', class: 'total', show: true, invertTab: true, positioning: 0, data: [], unitType: '' },
|
||||
{ analysis: {}, name: 'linkMonitor.ingress', class: 'ingress', show: true, invertTab: true, positioning: 1, data: [], unitType: '' },
|
||||
{ analysis: {}, name: 'linkMonitor.egress', class: 'egress', show: true, invertTab: true, positioning: 2, data: [], unitType: '' }
|
||||
{ analysis: {}, name: 'network.total', class: 'total', label: 'total', show: true, invertTab: true, positioning: 0, data: [], unitType: '' },
|
||||
{ analysis: {}, name: 'linkMonitor.ingress', class: 'ingress', label: 'in', show: true, invertTab: true, positioning: 1, data: [], unitType: '' },
|
||||
{ analysis: {}, name: 'linkMonitor.egress', class: 'egress', label: 'out', show: true, invertTab: true, positioning: 2, data: [], unitType: '' }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +364,8 @@ export default {
|
||||
if (item.type === val) {
|
||||
lineData = Object.keys(item).map(t => {
|
||||
return {
|
||||
...item[t]
|
||||
...item[t],
|
||||
label: t
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -376,14 +377,17 @@ export default {
|
||||
this.legendInit(lineData, active, show, unit, tabs)
|
||||
},
|
||||
legendInit (data, active, show, type, linkData) {
|
||||
data.forEach((d, i) => {
|
||||
linkData[i].data = d.values
|
||||
linkData[i].analysis = d.analysis
|
||||
data.forEach(d => {
|
||||
const obj = linkData.find(item => d.label.includes(item.label))
|
||||
if (obj) {
|
||||
obj.data = d.values
|
||||
obj.analysis = d.analysis
|
||||
}
|
||||
})
|
||||
let num = 0
|
||||
linkData.forEach(e => {
|
||||
e.unitType = type
|
||||
if (e.name !== 'network.total' && parseFloat(e.analysis.avg) === 0) {
|
||||
if (parseFloat(e.analysis.avg) === 0 || isNaN(parseFloat(e.analysis.avg))) {
|
||||
e.show = false
|
||||
num += 1
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user