From 37ce944dc12260b33bc9698ee126feabc14f6f15 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Fri, 11 Nov 2022 15:25:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20npm=20=E4=B8=8B=E9=92=BB=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=AF=B7=E6=B1=82=20side=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=20tabIndex=20=E5=88=A4=E6=96=AD=E8=B5=8B?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/charts2/charts/npm/NpmNetworkQuantity.vue | 12 +++++++----- src/views/charts2/charts/npm/NpmTrafficLine.vue | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/charts2/charts/npm/NpmNetworkQuantity.vue b/src/views/charts2/charts/npm/NpmNetworkQuantity.vue index 9d9a2bd9..3a227d81 100644 --- a/src/views/charts2/charts/npm/NpmNetworkQuantity.vue +++ b/src/views/charts2/charts/npm/NpmNetworkQuantity.vue @@ -25,9 +25,11 @@ export default { const { query } = useRoute() const queryCondition = ref(query.queryCondition || '') const dimensionType = ref(query.dimensionType || '') + const tabIndex = ref(query.tabIndex) return { queryCondition, - dimensionType + dimensionType, + tabIndex } }, data () { @@ -69,9 +71,9 @@ export default { endTime: getSecond(this.timeFilter.endTime), cycle: 0 } - if (this.chartData.name === 'npm-ip下钻-client-多单值') { + if (this.tabIndex == 0) { this.side = 'client' - } else if (this.chartData.name === 'npm-ip下钻-server-多单值') { + } else if (this.tabIndex == 1) { this.side = 'server' } if (condition && (typeof condition !== 'object') && type) { @@ -135,9 +137,9 @@ export default { endTime: getSecond(this.timeFilter.endTime), cycle: 1 } - if (this.chartData.name === 'npm-ip下钻-client-多单值') { + if (this.tabIndex == 0) { this.side = 'client' - } else if (this.chartData.name === 'npm-ip下钻-server-多单值') { + } else if (this.tabIndex == 1) { this.side = 'server' } if (condition && (typeof condition !== 'object') && type) { diff --git a/src/views/charts2/charts/npm/NpmTrafficLine.vue b/src/views/charts2/charts/npm/NpmTrafficLine.vue index 9335bedd..e2c0e4c0 100644 --- a/src/views/charts2/charts/npm/NpmTrafficLine.vue +++ b/src/views/charts2/charts/npm/NpmTrafficLine.vue @@ -51,10 +51,12 @@ export default { const metricFilter = ref(query.lineMetric || 'Bits/s') const queryCondition = ref(query.queryCondition || '') const dimensionType = ref(query.dimensionType || '') + const tabIndex = ref(query.tabIndex) return { metricFilter, queryCondition, dimensionType, + tabIndex, myChart: shallowRef(null) } }, @@ -142,10 +144,9 @@ export default { } else { condition = this.queryCondition } - // const type = this.$store.getters.getDimensionType - if (this.chartData.id === 24) { + if (this.tabIndex == 0) { this.side = 'client' - } else if (this.chartData.id === 29) { + } else if (this.tabIndex == 1) { this.side = 'server' } const params = {