From 8fad0019f8e0740339686f8d8f6788cbad78329b Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Tue, 25 Jun 2024 13:59:39 +0800 Subject: [PATCH] fixed: Fixed an issue where the correct tab could not be located after creating the platform --- src/layout/components/GenericCreateUpdateForm/index.vue | 2 ++ src/views/assets/Platform/PlatformList.vue | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/layout/components/GenericCreateUpdateForm/index.vue b/src/layout/components/GenericCreateUpdateForm/index.vue index cb08f29ab..2c014a6c6 100644 --- a/src/layout/components/GenericCreateUpdateForm/index.vue +++ b/src/layout/components/GenericCreateUpdateForm/index.vue @@ -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) diff --git a/src/views/assets/Platform/PlatformList.vue b/src/views/assets/Platform/PlatformList.vue index 1ffb23deb..9253f331d 100644 --- a/src/views/assets/Platform/PlatformList.vue +++ b/src/views/assets/Platform/PlatformList.vue @@ -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 {