【更新】修复一个角色授权资源界面无法展示数据错误

pull/48/MERGE
小诺 2022-10-18 02:05:13 +08:00 committed by 俞宝山
parent 6cc720cfe2
commit 32f3f23916
1 changed files with 39 additions and 37 deletions

View File

@ -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
} }