提交 5216946a 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 315e88da
import { Util, ViewTool } from '@/utils';
import { PanelDetailModel } from './panel-detail'; import { PanelDetailModel } from './panel-detail';
/** /**
...@@ -117,4 +118,53 @@ export class PanelButtonModel extends PanelDetailModel { ...@@ -117,4 +118,53 @@ export class PanelButtonModel extends PanelDetailModel {
return boxStyle; return boxStyle;
} }
/**
* 计算行为状态权限
*
* @private
* @param {*} data
* @memberof PanelButtonModel
*/
private calcActionItemAuthState(data: any) {
if (this.uiAction.dataaccaction && data) {
let tempUIAction: any = Util.deepCopy(this.uiAction);
let result: any[] = ViewTool.calcActionItemAuthState(data, [tempUIAction], this.panel.appUIService ? this.panel.appUIService : null);
this.visible = tempUIAction.visabled;
this.disabled = tempUIAction.disabled;
}
}
/**
* 获取父容器数据
*
* @private
* @return {*} {*}
* @memberof PanelButtonModel
*/
private getParentData(): any {
let data = {};
if (this.parentName) {
let parentItem = this.panel.layoutModelDetails[`${this.parentName}_${this.index}`];
// 尝试找
if (!parentItem) {
parentItem = this.panel.layoutModelDetails[this.parentName];
}
if (parentItem && parentItem.getData()) {
data = parentItem.getData();
}
}
return data;
}
/**
* 加载
*
* @param {*} context
* @param {*} viewParams
* @memberof PanelButtonModel
*/
public async load(context: any, viewParams: any) {
const parentData = this.getParentData();
this.calcActionItemAuthState(parentData);
}
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册