diff --git a/src/layout/components/TabPage/index.vue b/src/layout/components/TabPage/index.vue index 978b1447e..8b4824a79 100644 --- a/src/layout/components/TabPage/index.vue +++ b/src/layout/components/TabPage/index.vue @@ -124,6 +124,13 @@ export default { return needActiveComponent } }, + watch: { + activeMenu: { + handler(newValue) { + this.iActiveMenu = newValue + } + } + }, created() { this.iActiveMenu = this.getPropActiveTab() this.loading = false diff --git a/src/views/accounts/AccountChangeSecret/Overview/CardSummary.vue b/src/views/accounts/AccountChangeSecret/Overview/CardSummary.vue index f1c421784..9088e707e 100644 --- a/src/views/accounts/AccountChangeSecret/Overview/CardSummary.vue +++ b/src/views/accounts/AccountChangeSecret/Overview/CardSummary.vue @@ -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') + } } }, { diff --git a/src/views/accounts/AccountChangeSecret/index.vue b/src/views/accounts/AccountChangeSecret/index.vue index a3257f1aa..39dc8c014 100644 --- a/src/views/accounts/AccountChangeSecret/index.vue +++ b/src/views/accounts/AccountChangeSecret/index.vue @@ -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 + } } }