提交 6d0a51f3 编写于 作者: Mosher's avatar Mosher

增加树视图右键权限校验

上级 0933357e
<dropdown-item name="${item.name}">
<#assign itemName="${item.name}" />
<dropdown-item name=${itemName} disabled={this.nodeModel[${itemName}].uiaction.disabled}>
<#if item.isShowIcon()><#if item.getPSSysImage()??><#assign img=item.getPSSysImage()><i class='<#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if></#if>
<#if item.isShowCaption()>${item.getCaption()}</#if>
</dropdown-item>
\ No newline at end of file
......@@ -333,6 +333,14 @@ FullCalendar,
*/
public events: any[] = [];
/**
* 节点模型集合
*
* @type {string[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public nodeModel: any = {};
/**
* 日历样式类型
*
......
......@@ -51,6 +51,10 @@
</div>
</#if>
</template>
<#assign import_block>
import { Environment } from '@/environments/environment';
import UIService from '@/uiservice/ui-service';
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
......@@ -253,6 +257,28 @@
*/
public appStateEvent: Subscription | undefined;
/**
* 节点模型集合
*
* @type {string[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public nodeModel: any = {
<#if ctrl.getPSControls()??>
<#list ctrl.getPSControls() as childCtrl>
<#if childCtrl.getControleType() == "CONTEXTMENU">
<#if childCtrl.getPSDEToolbarItems()??>
<#list childCtrl.getPSDEToolbarItems() as item>
${item.name}: { uiservice: "<#if childCtrl.getPSAppDataEntity()?? && childCtrl.getPSAppDataEntity().getCodeName()??>${srfclassname('${curAppEntity.getCodeName()}')}UIService</#if>"<#if item.getPSUIAction()??><#assign uiaction=item.getPSUIAction()>,uiaction: { type: '${uiaction.getUIActionType()}', tag: '${uiaction.getUIActionTag()}'
<#if (uiaction.getActionTarget()!="")>, actiontarget: '${uiaction.getActionTarget()}'</#if><#if uiaction.getNoPrivDisplayMode(view)??>, noprivdisplaymode:${uiaction.getNoPrivDisplayMode(view)}</#if><#if uiaction.getDataAccessAction()??>, dataaccaction:'${uiaction.getDataAccessAction()}'</#if>, visabled: true, disabled: false},</#if>
</#list>
</#if>
</#if>
</#list>
</#if>
}
/**
* 选中数据变更事件
*
......@@ -649,6 +675,7 @@
*/
public renderContextMenu(node: any) {
let content;
if (node && node.data) {
const data: any = JSON.parse(JSON.stringify(node.data));
this.currentselectedNode = { ...data };
......@@ -687,6 +714,33 @@ ${P.getCtrlCode(childCtrl, 'CONTROL.html').code}
</#list>
</#if>
/**
* 计算节点右键权限
*
* @param {*} node
* @returns
* @memberof MainTreeBase
*/
public computeNodeState(node: any) {
if(Environment.enablePermissionValid){
let targetData: any = this.transformData(node);
if(this.nodeModel && Object.keys(this.nodeModel).length > 0) {
Object.keys(this.nodeModel).forEach((name: any) => {
if(this.nodeModel[name] && this.nodeModel[name].uiservice && this.nodeModel[name].uiaction && this.nodeModel[name].uiaction.dataaccaction) {
this.nodeModel[name].isPower = true;
let uiservice: any = new UIService().getService(this.nodeModel[name].uiservice)
let tempUIAction:any = JSON.parse(JSON.stringify(this.nodeModel[name].uiaction));
let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],uiservice);
this.nodeModel[name].uiaction.visabled = tempUIAction.visabled;
this.nodeModel[name].uiaction.disabled = tempUIAction.disabled;
this.nodeModel[name].isPower = result[0] === 1 ? true : false;
}
})
}
}
}
/**
* 设置选中高亮
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册