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

zpc --- 菜单权限

上级 3b738263
...@@ -355,8 +355,10 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -355,8 +355,10 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
if (Object.keys(item).length === 0) { if (Object.keys(item).length === 0) {
return; return;
} }
if(!item.hidden){
this.click(item); this.click(item);
} }
}
/** /**
* 计算菜单选中项 * 计算菜单选中项
...@@ -495,6 +497,19 @@ ${P.getLogicCode(singleFuncs,"LOGIC.vue").code} ...@@ -495,6 +497,19 @@ ${P.getLogicCode(singleFuncs,"LOGIC.vue").code}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public load(data: any) { public load(data: any) {
this.handleMenusResource(this.menuMode.getAppMenuItems());
}
/**
* 通过统一资源标识计算菜单
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public handleMenusResource(inputMenus:Array<any>){
if(this.$store.getters['unifiedresource/getEnablePermissionValid']){
this.computedEffectiveMenus(inputMenus);
}
this.dataProcess(this.menuMode.getAppMenuItems()); this.dataProcess(this.menuMode.getAppMenuItems());
this.menus = this.menuMode.getAppMenuItems(); this.menus = this.menuMode.getAppMenuItems();
<#if view.isDefaultPage?? && view.isDefaultPage()> <#if view.isDefaultPage?? && view.isDefaultPage()>
...@@ -502,6 +517,23 @@ ${P.getLogicCode(singleFuncs,"LOGIC.vue").code} ...@@ -502,6 +517,23 @@ ${P.getLogicCode(singleFuncs,"LOGIC.vue").code}
</#if> </#if>
} }
/**
* 计算有效菜单项
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public computedEffectiveMenus(inputMenus:Array<any>){
inputMenus.forEach((_item:any) =>{
if(_item.resourcetag && !this.$store.getters['unifiedresource/getResourceData'](_item.resourcetag)){
_item.hidden = true;
if (_item.items && _item.items.length > 0) {
this.computedEffectiveMenus(_item.items);
}
}
})
}
/** /**
* 数据处理 * 数据处理
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册