Fixed: Change Secret Dashboard Jump

This commit is contained in:
zhaojisen 2025-03-18 15:21:16 +08:00 committed by ZhaoJiSen
parent 1d288f6212
commit 7c20d08ce2
3 changed files with 26 additions and 4 deletions

View File

@ -124,6 +124,13 @@ export default {
return needActiveComponent
}
},
watch: {
activeMenu: {
handler(newValue) {
this.iActiveMenu = newValue
}
}
},
created() {
this.iActiveMenu = this.getPropActiveTab()
this.loading = false

View File

@ -49,9 +49,11 @@ export default {
{
title: this.$t('Total'),
body: {
route: { name: 'AccountChangeSecret', query: { tab: 'AccountChangeSecretList' }},
canDirect: true,
count: this.data.total_count_change_secrets
count: this.data.total_count_change_secrets,
callback: () => {
this.$eventBus.$emit('change-tab', 'AccountChangeSecretList')
}
}
},
{
@ -73,9 +75,11 @@ export default {
{
title: this.$t('Total'),
body: {
route: { name: 'AccountChangeSecret', query: { tab: 'AccountChangeSecretExecutionList' }},
canDirect: true,
count: this.data.total_count_change_secret_executions
count: this.data.total_count_change_secret_executions,
callback: () => {
this.$eventBus.$emit('change-tab', 'AccountChangeSecretExecutionList')
}
}
},
{

View File

@ -45,6 +45,17 @@ export default {
},
computed: {
...mapGetters(['hasValidLicense'])
},
mounted() {
this.$eventBus.$on('change-tab', this.handleChangeTab)
},
beforeDestroy() {
this.$eventBus.$off('change-tab', this.handleChangeTab)
},
methods: {
handleChangeTab(tab) {
this.config.activeMenu = tab
}
}
}
</script>