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

调整列表导航工具栏按钮状态

上级 2c591b76
...@@ -484,6 +484,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -484,6 +484,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
let tempContext:any = {}; let tempContext:any = {};
let tempViewParam:any = {}; let tempViewParam:any = {};
if (args.length === 0) { if (args.length === 0) {
this.calcToolbarItemState(true);
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
...@@ -514,6 +515,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -514,6 +515,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
} }
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName },context:tempContext,viewparam:tempViewParam}); Object.assign(this.selection, { view: { viewname: this.navViewName },context:tempContext,viewparam:tempViewParam});
this.calcToolbarItemState(false);
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -523,9 +525,38 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -523,9 +525,38 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_load(args:any, tag?: string, $event2?: any){ public ${ctrl.name}_load(args:any, tag?: string, $event2?: any){
this.calcToolbarItemState(true);
this.$emit('load',args); this.$emit('load',args);
} }
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.${ctrl.getCodeName()?lower_case}_toolbarModels;
if (models) {
for (const key in models) {
if (!models.hasOwnProperty(key)) {
return;
}
const _item = models[key];
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if (_item.noprivdisplaymode && _item.noprivdisplaymode === 6) {
_item.visabled = false;
}
}
this.calcNavigationToolbarState();
}
}
/** /**
* 计算导航工具栏权限状态 * 计算导航工具栏权限状态
* *
...@@ -534,16 +565,14 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -534,16 +565,14 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
public calcNavigationToolbarState(){ public calcNavigationToolbarState(){
let _this: any = this; let _this: any = this;
// 界面行为 // 界面行为
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
<#assign curAppEntity = ctrl.getPSAppDataEntity() />
const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService();
<#if ctrl.getCodeName?? && ctrl.getCodeName()??>
<#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign> <#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign>
if(_this.${ModelsName}){ if(_this.${ModelsName}){
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
<#assign curAppEntity = ctrl.getPSAppDataEntity() />
const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService();
ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService); ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService);
}
</#if>
</#if> </#if>
}
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册