From 4dd6754e1bffe21e2c815f2edb6b59d54026c97c Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Wed, 25 Aug 2021 13:57:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../page/dashboard/explore/exploreItem.vue | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index cc5fed4c2..9fb9c6774 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -28,7 +28,7 @@ {{item.label}} @@ -353,8 +353,8 @@ export default { icon: 'nz-icon nz-icon-logs' } ], - selectValue: '', - selectIcon: '', + selectValue: this.$t('project.metrics.metrics'), + selectIcon: 'nz-icon nz-icon-Metrics', fromData: { status: '' }, @@ -404,26 +404,14 @@ export default { this.selectMetricsLogs() }, methods: { - selectMetricsLogs (val, icon) { - if (this.selectValue === 'Metrics') { - this.selectValue = val + selectMetricsLogs (val, icon, label) { + if (val) { this.selectIcon = icon - this.showMetrics = val === 'Metrics' - this.showIntroduce = true - this.resetExpression() - } else if (this.selectValue === 'Logs') { this.selectValue = val - this.selectIcon = icon - this.showMetrics = val === 'Metrics' - this.showIntroduce = true - this.resetExpression() } else { - this.selectValue = 'Metrics' - this.selectIcon = 'nz-icon nz-icon-Metrics' - this.showMetrics = 'Metrics' - this.showIntroduce = true - this.resetExpression() + label = 'Metrics' } + this.changeType(label) }, changeType (value) { this.showMetrics = value === 'Metrics'