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

视图工具栏单机模式支持

上级 bdb2ce64
import { Environment } from '@/environments/environment';
/** /**
* *
* *
...@@ -184,37 +186,39 @@ export default class ViewEngine { ...@@ -184,37 +186,39 @@ export default class ViewEngine {
* @memberof ViewEngine * @memberof ViewEngine
*/ */
public calcToolbarItemAuthState(data:any){ public calcToolbarItemAuthState(data:any){
const _this: any = this; if(Environment.enablePermissionValid){
for (const key in _this.view.toolBarModels) { const _this: any = this;
if (!_this.view.toolBarModels.hasOwnProperty(key)) { for (const key in _this.view.toolBarModels) {
return; if (!_this.view.toolBarModels.hasOwnProperty(key)) {
} return;
const _item = _this.view.toolBarModels[key];
if(_item && _item['dataaccaction'] && _this.view.appUIService){
let dataActionResult:any;
if (_item.uiaction && (Object.is(_item.uiaction.target, 'NONE'))){
dataActionResult = _this.view.appUIService.getResourceOPPrivs(_item['dataaccaction']);
}else{
if(data && Object.keys(data).length >0){
dataActionResult= _this.view.appUIService.getAllOPPrivs(data)[_item['dataaccaction']];
}
} }
// 无权限:0;有权限:1 const _item = _this.view.toolBarModels[key];
if(dataActionResult === 0){ if(_item && _item['dataaccaction'] && _this.view.appUIService){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6 let dataActionResult:any;
if(_item.noprivdisplaymode === 1){ if (_item.uiaction && (Object.is(_item.uiaction.target, 'NONE'))){
_this.view.toolBarModels[key].disabled = true; dataActionResult = _this.view.appUIService.getResourceOPPrivs(_item['dataaccaction']);
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_this.view.toolBarModels[key].visabled = false;
}else{ }else{
if(data && Object.keys(data).length >0){
dataActionResult= _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;
}
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.toolBarModels[key].visabled = true; _this.view.toolBarModels[key].visabled = true;
_this.view.toolBarModels[key].disabled = false;
} }
} }
if(dataActionResult === 1){
_this.view.toolBarModels[key].visabled = true;
_this.view.toolBarModels[key].disabled = false;
}
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册