From 5bcc8bf019868eab759633f92123949cc28b9752 Mon Sep 17 00:00:00 2001 From: zhujida Date: Thu, 28 Jan 2021 10:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/kpi/set/index.vue | 44 ++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/src/views/kpi/set/index.vue b/src/views/kpi/set/index.vue index 4da330b..e95f585 100644 --- a/src/views/kpi/set/index.vue +++ b/src/views/kpi/set/index.vue @@ -48,15 +48,37 @@ export default { tryTarget }, created () { - if (this.auth.evaluationSet) { - this.activeIndex = '0' - } else if (!this.auth.roleSet) { - this.activeIndex = '1' - } else if (!this.auth.setIndicatrix) { - this.activeIndex = '2' - } else { - this.activeIndex = '0' + const index = this.$route.query.activeIndex + switch (index) { + case '0': + if (this.auth.evaluationSet) { + this.activeIndex = '0' + } + break + case '1': + if (this.auth.roleSet) { + this.activeIndex = '1' + } + break + case '2': + if (this.auth.setIndicatrix) { + this.activeIndex = '2' + } + break + default: + console.log('错误***************************') + this.activeIndex = '0' + break } + // } else if (this.auth.evaluationSet) { + // this.activeIndex = '0' + // } else if (!this.auth.roleSet) { + // this.activeIndex = '1' + // } else if (!this.auth.setIndicatrix) { + // this.activeIndex = '2' + // } else { + // this.activeIndex = '0' + // } if (this.auth.evaluationSet && this.auth.roleSet && this.auth.setIndicatrix) { this.activeIndex = this.$route.query.activeIndex || '0' } @@ -65,8 +87,10 @@ export default { mounted () { }, methods: { handleSelect (key, keyPath) { - this.activeIndex = key - this.$router.replace({ name: 'set', query: { activeIndex: key } }) + if (this.activeIndex !== key || !this.$route.query.activeIndex) { + this.activeIndex = key + this.$router.replace({ name: 'set', query: { activeIndex: key } }) + } } }, watch: {}