ui: fix tab name in query params (#11590)

This commit is contained in:
Abhishek Kumar 2025-09-15 15:02:10 +05:30 committed by GitHub
parent 7c7497c624
commit 6a145358a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,17 +33,17 @@
:is="tabs[0].component" :is="tabs[0].component"
:resource="resource" :resource="resource"
:loading="loading" :loading="loading"
:tab="tabs[0].name" /> :tab="tabName(tabs[0])" />
</keep-alive> </keep-alive>
<a-tabs <a-tabs
v-else v-else
style="width: 100%; margin-top: -12px" style="width: 100%; margin-top: -12px"
:animated="false" :animated="false"
:activeKey="activeTab || tabs[0].name" :activeKey="activeTab || tabName(tabs[0])"
@change="onTabChange" > @change="onTabChange" >
<template v-for="tab in tabs" :key="tab.name"> <template v-for="tab in tabs" :key="tabName(tab)">
<a-tab-pane <a-tab-pane
:key="tab.name" :key="tabName(tab)"
:tab="$t('label.' + tabName(tab))" :tab="$t('label.' + tabName(tab))"
v-if="showTab(tab)"> v-if="showTab(tab)">
<keep-alive> <keep-alive>
@ -183,12 +183,12 @@ export default {
return return
} }
if (!this.historyTab || !this.$route.meta.tabs || this.$route.meta.tabs.length === 0) { if (!this.historyTab || !this.$route.meta.tabs || this.$route.meta.tabs.length === 0) {
this.activeTab = this.tabs[0].name this.activeTab = this.tabName(this.tabs[0])
return return
} }
const tabIdx = this.$route.meta.tabs.findIndex(tab => tab.name === this.historyTab) const tabIdx = this.$route.meta.tabs.findIndex(tab => this.tabName(tab) === this.historyTab)
if (tabIdx === -1) { if (tabIdx === -1) {
this.activeTab = this.tabs[0].name this.activeTab = this.tabName(this.tabs[0])
} else { } else {
this.activeTab = this.historyTab this.activeTab = this.historyTab
} }