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

引擎权限调整

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