From cc3157c578167273fa68d069d373dfb9d5fc2e93 Mon Sep 17 00:00:00 2001 From: changcode Date: Wed, 23 Nov 2022 16:51:38 +0800 Subject: [PATCH] =?UTF-8?q?CN-811=20feat:=20networkoverview=E4=B8=8B?= =?UTF-8?q?=E9=92=BB=E7=AC=AC=E4=B8=89=E7=BA=A7=E8=8F=9C=E5=8D=95=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 16a255be50ee14680d09c14cdfa6d1694de24b54) --- src/components/layout/Header.vue | 4 +++- .../networkOverview/NetworkOverviewLine.vue | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/components/layout/Header.vue b/src/components/layout/Header.vue index caec6129..5a5f8375 100644 --- a/src/components/layout/Header.vue +++ b/src/components/layout/Header.vue @@ -546,7 +546,9 @@ export default { this.urlChangeParams[this.curTabState.tabOperationBeforeType] = this.getUrlParam(this.curTabState.tabOperationType, '', true) this.urlChangeParams[this.curTabState.tabOperationType] = opeType if (opeType === 3) { - this.urlChangeParams.queryCondition = '' + if (route !== '/panel/networkOverview') { + this.urlChangeParams.queryCondition = '' + } } } else { this.urlChangeParams[this.curTabState.tabOperationType] = operationType.mainMenu diff --git a/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue b/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue index 1a073290..d5ec7766 100644 --- a/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue +++ b/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue @@ -81,10 +81,14 @@ export default { const lineRefer = ref(query.lineRefer || 'Average') const lineTab = ref(query.lineTab || '') const queryCondition = ref(query.queryCondition || '') + const tabOperationType = ref(query.tabOperationType) + const networkOverviewBeforeTab = ref(query.networkOverviewBeforeTab) return { lineRefer, lineTab, queryCondition, + tabOperationType, + networkOverviewBeforeTab, myChart: shallowRef(null) } }, @@ -171,10 +175,22 @@ export default { startTime: getSecond(this.timeFilter.startTime), endTime: getSecond(this.timeFilter.endTime) } - // const condition = this.$store.getters.getQueryCondition - // const condition = this.$route.query.queryCondition ? this.$route.query.queryCondition : '' - if (this.queryCondition) { + let condition = '' + if (this.queryCondition && this.tabOperationType !== '3') { params.q = this.queryCondition + } else if (this.tabOperationType == '3' && this.queryCondition) { + if (this.queryCondition.indexOf(' OR ') > -1) { + if (this.networkOverviewBeforeTab === 'isp') { + condition = this.queryCondition.split(/["|'= ](.*?)["|'= ]/) + params.q = `notEmpty(${condition[0]}) OR notEmpty(${condition[9]})` + } else { + condition = this.queryCondition.split(/["|'= ](.*?)["|'= ]/) + params.q = `notEmpty(${condition[0]}) OR notEmpty(${condition[5]})` + } + } else { + condition = this.queryCondition.split(/['=](.*?)['=]/) + params.q = `notEmpty(${condition[0]})` + } } this.toggleLoading(true) get(api.netWorkOverview.totalTrafficAnalysis, params).then((res) => {