From 80c44fa37242ecb7f745e60674adb7527baaecc8 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Tue, 29 Aug 2023 16:24:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=93=BE=E8=B7=AF?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charts2/charts/linkMonitor/LinkBlock.vue | 62 ++++---- .../charts/linkMonitor/LinkDirectionGrid.vue | 140 +++++++++--------- .../charts/linkMonitor/LinkTrafficLine.vue | 4 +- .../charts/linkMonitor/LinkTrafficSankey.vue | 12 +- .../LinkTrafficDrillDownList.vue | 32 ++-- 5 files changed, 125 insertions(+), 125 deletions(-) diff --git a/src/views/charts2/charts/linkMonitor/LinkBlock.vue b/src/views/charts2/charts/linkMonitor/LinkBlock.vue index 27a1bbfe..7db3507c 100644 --- a/src/views/charts2/charts/linkMonitor/LinkBlock.vue +++ b/src/views/charts2/charts/linkMonitor/LinkBlock.vue @@ -39,13 +39,13 @@ - {{ convertValue(item.egressUsage) }} + {{ convertValue(item.outUsage) }}
- {{ convertValue(item.ingressUsage) }} + {{ convertValue(item.inUsage) }}
@@ -92,13 +92,13 @@ - {{ convertValue(item.egressUsage) }} + {{ convertValue(item.outUsage) }}
- {{ convertValue(item.ingressUsage) }} + {{ convertValue(item.inUsage) }}
@@ -207,11 +207,11 @@ export default { if (hit) { hit.outBitsRate += d.outBitsRate hit.inBitsRate += d.inBitsRate - if (info.direction === 'egress') { - hit.egressBandwidth = info.bandwidth + if (info.direction === 'out') { + hit.outBandwidth = info.bandwidth hit.outLinkId = d.linkId - } else if (info.direction === 'ingress') { - hit.ingressBandwidth = info.bandwidth + } else if (info.direction === 'in') { + hit.inBandwidth = info.bandwidth hit.inLinkId = d.linkId } } else { @@ -220,11 +220,11 @@ export default { outBitsRate: d.outBitsRate, inBitsRate: d.inBitsRate } - if (info.direction === 'egress') { - hit.egressBandwidth = info.bandwidth + if (info.direction === 'out') { + hit.outBandwidth = info.bandwidth hit.outLinkId = d.linkId - } else if (info.direction === 'ingress') { - hit.ingressBandwidth = info.bandwidth + } else if (info.direction === 'in') { + hit.inBandwidth = info.bandwidth hit.inLinkId = d.linkId } data.push(hit) @@ -240,9 +240,9 @@ export default { const linkColors = colorGradientCalculation(this.gradientColor[0], this.gradientColor[1], sorted.map(s => s.totalBitsRate)) sorted.forEach((s, i) => { s.color = linkColors[i] - s.egressUsage = this.computeUsage(s.outBitsRate, s.egressBandwidth) - s.ingressUsage = this.computeUsage(s.inBitsRate, s.ingressBandwidth) - s.popoverWidth = this.computePopoverWidth(s.egressUsage, s.ingressUsage) + s.outUsage = this.computeUsage(s.outBitsRate, s.outBandwidth) + s.inUsage = this.computeUsage(s.inBitsRate, s.inBandwidth) + s.popoverWidth = this.computePopoverWidth(s.outUsage, s.inUsage) }) this.linkData = sorted } @@ -298,12 +298,12 @@ export default { }) // 上行使用情况计算 - const egressUsage = this.computeUsage(s.outBitsRate, sum) + const outUsage = this.computeUsage(s.outBitsRate, sum) // 下行使用情况计算 - const ingressUsage = this.computeUsage(s.inBitsRate, sum) - s.egressUsage = egressUsage - s.ingressUsage = ingressUsage - s.popoverWidth = this.computePopoverWidth(egressUsage, ingressUsage) + const inUsage = this.computeUsage(s.inBitsRate, sum) + s.outUsage = outUsage + s.inUsage = inUsage + s.popoverWidth = this.computePopoverWidth(outUsage, inUsage) }) this.nextHopData = nextHopSorted @@ -340,27 +340,27 @@ export default { * 计算popover弹窗的宽度 * 最小宽度为252px,百分比每大一位,popover弹窗宽度增加7px */ - computePopoverWidth (egress, ingress) { + computePopoverWidth (out, _in) { let width = 252 let length = 0 // 将上下行乘100保留2位转换,即10.00为5位,100.00为6位,popover弹窗宽度就增加7px // 最小宽度为252px,最少位数为上下行相加为8位 - let egressUsage = '' - let ingressUsage = '' + let outUsage = '' + let inUsage = '' - if (egress < 0.0001 && egress !== 0) { - egressUsage = '< 0.01%' + if (out < 0.0001 && out !== 0) { + outUsage = '< 0.01%' } else { - egressUsage = JSON.stringify(parseFloat((egress * 100).toFixed(2))) + outUsage = JSON.stringify(parseFloat((out * 100).toFixed(2))) } - if (ingress < 0.0001 && ingress !== 0) { - ingressUsage = '< 0.01%' + if (_in < 0.0001 && _in !== 0) { + inUsage = '< 0.01%' } else { - ingressUsage = JSON.stringify(parseFloat((ingress * 100).toFixed(2))) + inUsage = JSON.stringify(parseFloat((_in * 100).toFixed(2))) } - length = egressUsage.length + ingressUsage.length + length = outUsage.length + inUsage.length if (length > 8) { width = 252 + (length - 8) * 7 @@ -381,7 +381,7 @@ export default { }) }, drillNextHop (item) { - const queryCondition = `egress_link_direction = '${item.linkDirection}' or ingress_link_direction = '${item.linkDirection}'` + const queryCondition = `out_link_direction = '${item.linkDirection}' or in_link_direction = '${item.linkDirection}'` this.$router.push({ query: { ...this.$route.query, diff --git a/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue b/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue index 140ad1bd..85d24b3d 100644 --- a/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue +++ b/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue @@ -1,7 +1,7 @@