mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
fix:修复点击不同 tab 标签时刷新页面后 tab 标签丢失或变为同一个的问题
This commit is contained in:
@@ -56,8 +56,6 @@
|
||||
import Page from '../Page/'
|
||||
import { toSentenceCase } from '@/utils/common'
|
||||
|
||||
const ACTIVE_TAB_KEY = 'tab'
|
||||
|
||||
export default {
|
||||
name: 'TabPage',
|
||||
components: {
|
||||
@@ -125,18 +123,22 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
activated() {
|
||||
this.iActiveMenu = this.getPropActiveTab()
|
||||
},
|
||||
mounted() {
|
||||
this.iActiveMenu = this.getPropActiveTab()
|
||||
},
|
||||
methods: {
|
||||
handleTabClick(tab) {
|
||||
this.$emit('tab-click', tab)
|
||||
this.$emit('update:activeMenu', tab.name)
|
||||
this.$cookie.set(ACTIVE_TAB_KEY, tab.name, 1)
|
||||
|
||||
if (this.$router.currentRoute.query[ACTIVE_TAB_KEY]) {
|
||||
this.$cookie.set(this.$route.path, tab.name, 1)
|
||||
|
||||
if (this.$router.currentRoute.query[this.$route.path]) {
|
||||
this.$router.push({
|
||||
query: { ...this.$route.query, [ACTIVE_TAB_KEY]: '' }
|
||||
query: { ...this.$route.query, [this.$route.path]: '' }
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -144,8 +146,8 @@ export default {
|
||||
let activeTab = ''
|
||||
|
||||
const preActiveTabs = [
|
||||
this.$route.query[ACTIVE_TAB_KEY],
|
||||
this.$cookie.get(ACTIVE_TAB_KEY),
|
||||
this.$route.query[this.$route.path],
|
||||
this.$cookie.get(this.$route.path),
|
||||
this.activeMenu
|
||||
]
|
||||
|
||||
|
||||
@@ -32,6 +32,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
@@ -33,6 +33,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
@@ -101,7 +101,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -165,7 +165,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -44,6 +44,9 @@ export default {
|
||||
return this.$t('RoleList')
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
this.switchGlobalOrg(this.config.activeMenu === 'OrgRoleList')
|
||||
},
|
||||
mounted() {
|
||||
this.switchGlobalOrg(this.config.activeMenu === 'OrgRoleList')
|
||||
},
|
||||
@@ -63,7 +66,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user