From cd01e3a21b08980300895e092e30dd7b21ffd35d Mon Sep 17 00:00:00 2001 From: ZhengJie <201507802@qq.com> Date: Wed, 17 Jun 2020 09:45:39 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BB=A3=E7=A0=81=E5=AE=8C=E5=96=84](v2.5):?= =?UTF-8?q?=20=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=89=80=E6=9C=89=E8=8F=9C=E5=8D=95=E4=B9=8B=E5=89=8D=E5=85=88?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免在superior接口返回前保存导致菜单丢失 --- src/views/login.vue | 2 +- src/views/system/role/index.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 837b5b5..8a40cf1 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -150,7 +150,7 @@ export default { title: '提示', message: '当前登录状态已过期,请重新登录!', type: 'warning', - duration: 8000 + duration: 5000 }) Cookies.remove('point') } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index cbb2434..e8803af 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -235,12 +235,13 @@ export default { // 触发单选 handleCurrentChange(val) { if (val) { + // 先将保存按钮置灰 + this.showButton = false const _this = this // 清空菜单的选中 this.$refs.menu.setCheckedKeys([]) // 保存当前的角色id this.currentId = val.id - this.showButton = this.level <= val.level // 初始化 this.menuIds = [] // 菜单数据需要特殊处理 @@ -249,6 +250,8 @@ export default { }) getMenuSuperior(this.menuIds).then(res => { this.menus = res + // 待所有菜单加载完再允许点击保存按钮 + this.showButton = this.level <= val.level }) } },