逻辑判断
This commit is contained in:
zhujida 2021-01-28 10:21:26 +08:00
parent 00df0b006b
commit 5bcc8bf019

View File

@ -48,15 +48,37 @@ export default {
tryTarget tryTarget
}, },
created () { created () {
if (this.auth.evaluationSet) { const index = this.$route.query.activeIndex
this.activeIndex = '0' switch (index) {
} else if (!this.auth.roleSet) { case '0':
this.activeIndex = '1' if (this.auth.evaluationSet) {
} else if (!this.auth.setIndicatrix) { this.activeIndex = '0'
this.activeIndex = '2' }
} else { break
this.activeIndex = '0' 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) { if (this.auth.evaluationSet && this.auth.roleSet && this.auth.setIndicatrix) {
this.activeIndex = this.$route.query.activeIndex || '0' this.activeIndex = this.$route.query.activeIndex || '0'
} }
@ -65,8 +87,10 @@ export default {
mounted () { }, mounted () { },
methods: { methods: {
handleSelect (key, keyPath) { handleSelect (key, keyPath) {
this.activeIndex = key if (this.activeIndex !== key || !this.$route.query.activeIndex) {
this.$router.replace({ name: 'set', query: { activeIndex: key } }) this.activeIndex = key
this.$router.replace({ name: 'set', query: { activeIndex: key } })
}
} }
}, },
watch: {} watch: {}