From 43f99b02c4cbe75d580845ede2a874b20444ff39 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Thu, 26 Dec 2024 14:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 1 + src/store/modules/user.js | 1 + .../trials/trials-layout/components/trialsNavbar.vue | 9 +++++---- src/views/trials/trials-list/index.vue | 5 +++++ src/views/trials/trials-workbench/index.vue | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 968fbd18..3399587d 100644 --- a/src/main.js +++ b/src/main.js @@ -293,6 +293,7 @@ async function VueInit() { }() _vm.$forceUpdate() } + Vue.prototype.$EventBus = new Vue() Vue.prototype.$path = [] var t = function (key) { if (!~Vue.prototype.$path.indexOf(key)) { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index dae8780b..4ae41660 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -189,6 +189,7 @@ const actions = { commit('SET_PERMISSIONS', permissions.Result) zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result)) zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result)) + zzSessionStorage.removeItem('lastWorkbench') } catch (e) { console.log(e) } diff --git a/src/views/trials/trials-layout/components/trialsNavbar.vue b/src/views/trials/trials-layout/components/trialsNavbar.vue index 44b1e9b1..bb2b482c 100644 --- a/src/views/trials/trials-layout/components/trialsNavbar.vue +++ b/src/views/trials/trials-layout/components/trialsNavbar.vue @@ -270,15 +270,16 @@ export default { history.go(0) // this.$router.replace({ path: '/trials/trials-list' }) } else { - history.replaceState(null, null, '/trials') + history.replaceState(null, null, '/trials/trials-workbench') history.go(0) // this.$router.replace({ path: '/trials/trials-workbench' }) } this.toggleRoleVisible = false this.toggleRoleLoading = false - this.$nextTick(() => { - window.location.reload() - }) + this.$EventBus.$emit('reload') + // this.$nextTick(() => { + // window.location.reload() + // }) } else { // 此账户暂未配置菜单权限,请联系管理员处理后再登录。 this.toggleRoleLoading = false diff --git a/src/views/trials/trials-list/index.vue b/src/views/trials/trials-list/index.vue index 9a81a4c5..578850d7 100644 --- a/src/views/trials/trials-list/index.vue +++ b/src/views/trials/trials-list/index.vue @@ -788,6 +788,11 @@ export default { created() { this.initPage() }, + mounted(){ + this.$EventBus.$on("reload", (data) => { + window.location.reload() + }); + }, methods: { initPage() { this.getList() diff --git a/src/views/trials/trials-workbench/index.vue b/src/views/trials/trials-workbench/index.vue index b96ef01c..1f8e6886 100644 --- a/src/views/trials/trials-workbench/index.vue +++ b/src/views/trials/trials-workbench/index.vue @@ -487,6 +487,9 @@ export default { hoursTip=this.$t('common:date:good evening') } this.hoursTip = hoursTip + this.$EventBus.$on("reload", (data) => { + window.location.reload() + }); }, methods: { getUserInfo() {