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

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

上级 2c591b76
......@@ -484,6 +484,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
......@@ -514,6 +515,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName },context:tempContext,viewparam:tempViewParam});
this.calcToolbarItemState(false);
this.$forceUpdate();
}
......@@ -523,9 +525,38 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_load(args:any, tag?: string, $event2?: any){
this.calcToolbarItemState(true);
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,17 +565,15 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
<#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign>
if(_this.${ModelsName}){
<#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>
if(_this.${ModelsName}){
ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService);
}
</#if>
</#if>
}
}
/**
* 执行搜索
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册