Merge pull request #4108 from jumpserver/pr@dev@fix_plateform_tab

fixed: Fixed an issue where the correct tab could not be located after creating the platform
This commit is contained in:
ZhaoJiSen
2024-06-25 14:03:55 +08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -198,10 +198,12 @@ export default {
type: Function,
default(res, method, vm, addContinue) {
const route = this.getNextRoute(res, method)
if (!(route.params && route.params.id)) {
route['params'] = deepmerge(route['params'] || {}, { 'id': res.id })
}
route['query'] = deepmerge(route['query'], { 'order': this.extraQueryOrder, 'updated': new Date().getTime() })
this.$emit('submitSuccess', res)
this.emitPerformSuccessMsg(method, res, addContinue)

View File

@@ -125,7 +125,8 @@ export default {
},
dropdown: []
}
}
},
lastTab: ''
}
},
computed: {
@@ -133,10 +134,14 @@ export default {
return `/api/v1/assets/platforms/?category=${this.tab.activeMenu}`
}
},
deactivated() {
window.localStorage.setItem('lastTab', this.tab.activeMenu)
},
activated() {
setTimeout(() => {
this.tab.activeMenu = window.localStorage.getItem('lastTab')
this.$refs.genericListTable.reloadTable()
}, 500)
}, 300)
},
async mounted() {
try {