mirror of https://gitee.com/xiaonuobase/snowy
【更新】修复一个角色授权资源界面无法展示数据错误
parent
6cc720cfe2
commit
32f3f23916
|
@ -142,46 +142,48 @@
|
||||||
const echoModuleData = (data, resEcho) => {
|
const echoModuleData = (data, resEcho) => {
|
||||||
// 通过应用循环
|
// 通过应用循环
|
||||||
data.forEach((module) => {
|
data.forEach((module) => {
|
||||||
// 加入回显内容
|
if (module.menu) {
|
||||||
module.menu.forEach((item) => {
|
// 加入回显内容
|
||||||
const menueCheck = ref(0)
|
module.menu.forEach((item) => {
|
||||||
if (resEcho.grantInfoList.length > 0) {
|
const menueCheck = ref(0)
|
||||||
resEcho.grantInfoList.forEach((grant) => {
|
if (resEcho.grantInfoList.length > 0) {
|
||||||
if (item.id === grant.menuId) {
|
resEcho.grantInfoList.forEach((grant) => {
|
||||||
menueCheck.value++
|
if (item.id === grant.menuId) {
|
||||||
// 处理按钮
|
menueCheck.value++
|
||||||
if (grant.buttonInfo.length > 0) {
|
// 处理按钮
|
||||||
grant.buttonInfo.forEach((button) => {
|
if (grant.buttonInfo.length > 0) {
|
||||||
item.button.forEach((itemButton) => {
|
grant.buttonInfo.forEach((button) => {
|
||||||
if (button === itemButton.id) {
|
item.button.forEach((itemButton) => {
|
||||||
itemButton.check = true
|
if (button === itemButton.id) {
|
||||||
}
|
itemButton.check = true
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
}
|
// 回显前面的2个
|
||||||
// 回显前面的2个
|
if (menueCheck.value > 0) {
|
||||||
if (menueCheck.value > 0) {
|
item.parentCheck = true
|
||||||
item.parentCheck = true
|
item.nameCheck = true
|
||||||
item.nameCheck = true
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
|
|
||||||
// 排序
|
// 排序
|
||||||
module.menu = module.menu.sort((a, b) => {
|
module.menu = module.menu.sort((a, b) => {
|
||||||
return a.parentId - b.parentId
|
return a.parentId - b.parentId
|
||||||
})
|
})
|
||||||
// 缓存加入索引
|
// 缓存加入索引
|
||||||
module.menu.forEach((item, index) => {
|
module.menu.forEach((item, index) => {
|
||||||
// 下面就是用来知道不同的一级菜单里面有几个二级菜单,以及他们所在的索引
|
// 下面就是用来知道不同的一级菜单里面有几个二级菜单,以及他们所在的索引
|
||||||
if (firstShowMap[item.parentName]) {
|
if (firstShowMap[item.parentName]) {
|
||||||
firstShowMap[item.parentName].push(index)
|
firstShowMap[item.parentName].push(index)
|
||||||
} else {
|
} else {
|
||||||
firstShowMap[item.parentName] = [index]
|
firstShowMap[item.parentName] = [index]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue