[代码完善](v2.5): 角色管理获取所有菜单之前先置灰保存按钮

避免在superior接口返回前保存导致菜单丢失
This commit is contained in:
ZhengJie
2020-06-17 09:45:39 +08:00
parent 211f045d63
commit cd01e3a21b
2 changed files with 5 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ export default {
title: '提示', title: '提示',
message: '当前登录状态已过期,请重新登录!', message: '当前登录状态已过期,请重新登录!',
type: 'warning', type: 'warning',
duration: 8000 duration: 5000
}) })
Cookies.remove('point') Cookies.remove('point')
} }

View File

@@ -235,12 +235,13 @@ export default {
// 触发单选 // 触发单选
handleCurrentChange(val) { handleCurrentChange(val) {
if (val) { if (val) {
// 先将保存按钮置灰
this.showButton = false
const _this = this const _this = this
// 清空菜单的选中 // 清空菜单的选中
this.$refs.menu.setCheckedKeys([]) this.$refs.menu.setCheckedKeys([])
// 保存当前的角色id // 保存当前的角色id
this.currentId = val.id this.currentId = val.id
this.showButton = this.level <= val.level
// 初始化 // 初始化
this.menuIds = [] this.menuIds = []
// 菜单数据需要特殊处理 // 菜单数据需要特殊处理
@@ -249,6 +250,8 @@ export default {
}) })
getMenuSuperior(this.menuIds).then(res => { getMenuSuperior(this.menuIds).then(res => {
this.menus = res this.menus = res
// 待所有菜单加载完再允许点击保存按钮
this.showButton = this.level <= val.level
}) })
} }
}, },