This is an automated email from the ASF dual-hosted git repository. xxyu pushed a commit to branch kylin5 in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 734a26e4930cc24fbae33eab4664a7c4694f332d Author: Qian Xia <lauraxiaq...@gmail.com> AuthorDate: Thu Jul 27 16:18:24 2023 +0800 KYLIN-5668 refine mode edit jump issue --- .../src/components/studio/StudioModel/ModelEdit/index.vue | 13 +++++++++++-- kystudio/src/store/model.js | 6 +++++- kystudio/src/store/types.js | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue index 8b9a9a4919..c2556ea17a 100644 --- a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue +++ b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue @@ -496,6 +496,10 @@ import { NamedRegex, columnTypeIcon } from '../../../../config' vm.$router.replace({name: 'ModelList', params: { ignoreIntercept: true }}) return } + // 切换过系统管理界面,默认回退为上一次的fromRoute,如果fromRoute没有,则返回模型列表页 + if (from.path.indexOf('/admin') !== -1) { + vm.fromRoute = vm.$store.state.model.fromRoute || {name: 'ModelList', params: { ignoreIntercept: true }} + } vm.initEditModel() }) }, @@ -518,6 +522,10 @@ import { NamedRegex, columnTypeIcon } from '../../../../config' }) return } + // 如果跳去系统管理界面缓存一下上一次的fromRoute + if (to.path.indexOf('/admin') !== -1) { + this.cacheFromRoute(this.fromRoute) + } next() }).catch(() => { if (to.name === 'refresh') { // 取消刷新逻辑,所有上一个project相关的要撤回 @@ -556,7 +564,8 @@ import { NamedRegex, columnTypeIcon } from '../../../../config' methods: { ...mapMutations({ clearDatasourceCache: 'CLEAR_DATASOURCE_CACHE', - resetOtherColumns: 'RESET_OTHER_COLUMNS' + resetOtherColumns: 'RESET_OTHER_COLUMNS', + cacheFromRoute: 'CACHE_FROM_ROUTE' }), ...mapActions({ getModelByModelName: 'LOAD_MODEL_INFO', @@ -2120,7 +2129,7 @@ export default class ModelEdit extends Vue { goModelList () { this.toggleFullScreen(false) if (this.fromRoute && this.fromRoute.name) { - this.$router.push({name: this.fromRoute.name, params: {modelName: this.currentModel}}) + this.$router.push({name: this.fromRoute.name, params: {modelName: this.currentModel || this.extraoption.modelName}}) return } this.$router.push({name: 'ModelList'}) diff --git a/kystudio/src/store/model.js b/kystudio/src/store/model.js index b8f2f3a54b..b45235fb27 100644 --- a/kystudio/src/store/model.js +++ b/kystudio/src/store/model.js @@ -15,7 +15,8 @@ export default { reachThreshold: false, circleSpeedInfoLock: false, otherColumns: [], - filterModelNameByKC: '' + filterModelNameByKC: '', + fromRoute: null }, mutations: { [types.SAVE_MODEL_LIST]: function (state, result) { @@ -54,6 +55,9 @@ export default { }, [types.UPDATE_FILTER_MODEL_NAME_CLOUD]: (state, name) => { state.filterModelNameByKC = name + }, + [types.CACHE_FROM_ROUTE]: (state, fromRoute) => { + state.fromRoute = fromRoute } }, actions: { diff --git a/kystudio/src/store/types.js b/kystudio/src/store/types.js index f88d6607c7..a0e53351bd 100644 --- a/kystudio/src/store/types.js +++ b/kystudio/src/store/types.js @@ -229,6 +229,7 @@ export const UPDATE_MODEL = 'UPDATE_MODEL' export const GET_AVAILABLE_MODEL_OWNERS = 'GET_AVAILABLE_MODEL_OWNERS' export const UPDATE_MODEL_OWNER = 'UPDATE_MODEL_OWNER' export const CACHE_MODEL_EDIT = 'CACHE_MODEL_EDIT' +export const CACHE_FROM_ROUTE = 'CACHE_FROM_ROUTE' export const COLLECT_MODEL_STATS = 'COLLECT_MODEL_STATS' export const DIAGNOSE = 'DIAGNOSE' export const DIAGNOSELIST = 'DIAGNOSELIST'