From cb391dc416fc77eed11308f1f9f1a0d2190e4599 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Tue, 18 Jun 2024 18:15:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=8C=E5=90=91?= =?UTF-8?q?=E9=93=BE=E8=B7=AF=E9=85=8D=E7=BD=AE=E4=B8=8B=EF=BC=8C=E9=93=BE?= =?UTF-8?q?=E8=B7=AF=E4=B8=8B=E9=92=BB=E5=90=8Eid=E4=B8=8D=E5=AF=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 2c703306954e79ff4ed500c111b4392130e792a8) --- src/views/charts2/Panel.vue | 4 +-- .../charts2/charts/linkMonitor/LinkBlock.vue | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/views/charts2/Panel.vue b/src/views/charts2/Panel.vue index d8d72ff6..f3bec690 100644 --- a/src/views/charts2/Panel.vue +++ b/src/views/charts2/Panel.vue @@ -122,7 +122,7 @@ export default { watch: { timeFilter: { handler () { - if (this.$route.path === '/panel/networkAppPerformance') { + if (this.$route.path === '/panel/networkAppPerformance' || this.$route.path === '/panel/linkMonitor') { this.$store.commit('resetScoreBase') this.queryScoreBase() if (this.lineQueryCondition || this.networkOverviewBeforeTab) { @@ -227,7 +227,7 @@ export default { this.scoreCalculation() } } - if (this.$route.path === '/panel/networkAppPerformance') { + if (this.$route.path === '/panel/networkAppPerformance' || this.$route.path === '/panel/linkMonitor') { this.$store.commit('resetScoreBase') this.queryScoreBase() } diff --git a/src/views/charts2/charts/linkMonitor/LinkBlock.vue b/src/views/charts2/charts/linkMonitor/LinkBlock.vue index a83f5d3a..d86f1ad4 100644 --- a/src/views/charts2/charts/linkMonitor/LinkBlock.vue +++ b/src/views/charts2/charts/linkMonitor/LinkBlock.vue @@ -237,12 +237,26 @@ export default { } }) this.linkNoData = data.length === 0 - data.forEach(item => { - item.totalBitsRate = item.outBitsRate + item.inBitsRate - linkConfig.filter(info => info.interfaceName === item.interfaceName).forEach(info => { - item.linkId = info.linkId + if (!isTwoWay) { + data.forEach(item => { + item.totalBitsRate = item.outBitsRate + item.inBitsRate + linkConfig.filter(info => info.interfaceName === item.interfaceName).forEach(info => { + item.linkId = info.linkId + }) }) - }) + } else { + data.forEach(item => { + item.totalBitsRate = item.outBitsRate + item.inBitsRate + item.isTwoWay = true + linkConfig.filter(info => info.interfaceName === item.interfaceName).forEach(info => { + if (info.direction === 0) { + item.outLinkId = info.linkId + } else if (info.direction === 1) { + item.inLinkId = info.linkId + } + }) + }) + } const sorted = data.sort((a, b) => b.totalBitsRate - a.totalBitsRate) const linkColors = colorGradientCalculation(this.gradientColor[0], this.gradientColor[1], sorted.map(s => s.totalBitsRate)) @@ -384,7 +398,9 @@ export default { return width }, drillLinkId (item) { - const queryCondition = `out_link_id = ${item.linkId} or in_link_id = ${item.linkId}` + const queryCondition = item.isTwoWay + ? `out_link_id = ${item.outLinkId} or in_link_id = ${item.inLinkId}` + : `out_link_id = ${item.linkId} or in_link_id = ${item.linkId}` beforeRouterPush() this.$router.push({ query: {