提交 5643b704 编写于 作者: KK's avatar KK

引擎权限调整

上级 92b5e4ad
......@@ -93,7 +93,7 @@ export default class MobEditViewEngine extends ViewEngine {
public onFormLoad(arg: any): void {
this.view.$emit('load', arg);
this.view.$emit('viewdataschange', JSON.stringify({ action: 'load', status: 'success', data: arg }));
this.calcToolbarItemAuthState(this.transformData(arg));
this.calcToolbarItemAuthState(arg);
}
/**
......@@ -105,7 +105,7 @@ export default class MobEditViewEngine extends ViewEngine {
public onFormSave(arg: any): void {
this.view.$emit('save', arg);
this.view.$emit('viewdataschange', JSON.stringify({ action: 'save', status: 'success', data: arg }));
this.calcToolbarItemAuthState(this.transformData(arg));
this.calcToolbarItemAuthState(arg);
}
/**
......
......@@ -185,31 +185,33 @@ export default class ViewEngine {
*/
public calcToolbarItemAuthState(data:any){
const _this: any = this;
for (const key in _this.view.toolBarModels) {
if (!_this.view.toolBarModels.hasOwnProperty(key)) {
return;
}
const _item = _this.view.toolBarModels[key];
if(_item && _item['dataaccaction'] && _this.view.appUIService && data && Object.keys(data).length >0){
let dataActionResult:any = _this.view.appUIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_this.view.toolBarModels[key].disabled = true;
_this.view.toolbarModelList.forEach((tool:any) => {
for (const key in _this.view[tool]) {
if (!_this.view[tool].hasOwnProperty(key)) {
return;
}
const _item = _this.view[tool][key];
if(_item && _item['dataaccaction'] && _this.view.appUIService && data && Object.keys(data).length >0){
let dataActionResult:any = _this.view.appUIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_this.view[tool][key].disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_this.view[tool][key].visabled = false;
}else{
_this.view[tool][key].visabled = true;
}
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_this.view.toolBarModels[key].visabled = false;
}else{
_this.view.toolBarModels[key].visabled = true;
if(dataActionResult === 1){
_this.view[tool][key].visabled = true;
_this.view[tool][key].disabled = false;
}
}
if(dataActionResult === 1){
_this.view.toolBarModels[key].visabled = true;
_this.view.toolBarModels[key].disabled = false;
}
}
}
}
});
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册