提交 db61482d 编写于 作者: tony001's avatar tony001

增加判断指定菜单是否显示多模式逻辑

上级 cec768a3
......@@ -32,23 +32,56 @@ export const getEnablePermissionValid = (state: any) => {
}
/**
* 判断指定菜单是否显示
* 判断指定菜单是否显示(混合模式)
*
* @param state
*/
export const getAuthMenu = (state: any) => (menu:any) =>{
// 存在权限
let resourceIndex: any;
let menuIndex:any;
if(state.enablePermissionValid){
resourceIndex= state.resourceData.findIndex((resourcetag: any, objIndex: any, objs: any) => {
export const getAuthMenu = (state: any) => (menu: any) => {
if (state.enablePermissionValid) {
let resourceIndex: any;
let menuIndex: any;
resourceIndex = state.resourceData.findIndex((resourcetag: any, objIndex: any, objs: any) => {
return Object.is(menu.resourcetag, resourcetag);
})
menuIndex= state.menuData.findIndex((menutag: any, objIndex: any, objs: any) => {
menuIndex = state.menuData.findIndex((menutag: any, objIndex: any, objs: any) => {
return Object.is(menu.authtag, menutag);
})
return (resourceIndex !== -1 || menuIndex !== -1)?true:false;
}else{
return (resourceIndex !== -1 || menuIndex !== -1) ? true : false;
} else {
return true;
}
}
/**
* 判断指定菜单是否显示(资源模式)
*
* @param state
*/
export const getAuthMenuWithResource = (state: any) => (menu: any) => {
if (state.enablePermissionValid && menu.resourcetag) {
let resourceIndex: any;
resourceIndex = state.resourceData.findIndex((resourcetag: any, objIndex: any, objs: any) => {
return Object.is(menu.resourcetag, resourcetag);
})
return resourceIndex !== -1 ? true : false;
} else {
return true;
}
}
/**
* 判断指定菜单是否显示(RT模式)
*
* @param state
*/
export const getAuthMenuWithRT = (state: any) => (menu: any) => {
if (state.enablePermissionValid) {
let menuIndex: any;
menuIndex = state.menuData.findIndex((menutag: any, objIndex: any, objs: any) => {
return Object.is(menu.authtag, menutag);
})
return menuIndex !== -1 ? true : false;
} else {
return true;
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册