提交 e8ce9686 编写于 作者: Shine-zwj's avatar Shine-zwj

优化导航类部件工具栏状态逻辑

上级 764d69e2
...@@ -489,6 +489,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -489,6 +489,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];
...@@ -519,6 +520,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -519,6 +520,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();
} }
...@@ -532,9 +534,38 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -532,9 +534,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): void { public ${ctrl.name}_load(args: any[], tag?: string, $event2?: any): void {
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();
}
}
/** /**
* 计算导航工具栏权限状态 * 计算导航工具栏权限状态
* *
...@@ -543,16 +574,14 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -543,16 +574,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>
}
} }
/** /**
......
...@@ -367,6 +367,7 @@ ...@@ -367,6 +367,7 @@
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];
...@@ -402,6 +403,7 @@ ...@@ -402,6 +403,7 @@
} }
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, context:tempContext,viewparam:tempViewParam }); Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, context:tempContext,viewparam:tempViewParam });
this.calcToolbarItemState(false);
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -412,9 +414,38 @@ ...@@ -412,9 +414,38 @@
* @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();
}
}
/** /**
* 计算导航工具栏权限状态 * 计算导航工具栏权限状态
* *
...@@ -423,16 +454,14 @@ ...@@ -423,16 +454,14 @@
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>
}
} }
/** /**
......
...@@ -208,15 +208,18 @@ ...@@ -208,15 +208,18 @@
*/ */
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void { public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
if (args.length === 0) { if (args.length === 0) {
this.calcToolbarItemState(true);
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if (!arg.id) { if (!arg.id) {
this.calcToolbarItemState(true);
return; return;
} }
const nodetype = arg.id.split(';')[0]; const nodetype = arg.id.split(';')[0];
const refview = this.getExpItemView({ nodetype: nodetype }); const refview = this.getExpItemView({ nodetype: nodetype });
if (!refview) { if (!refview) {
this.calcToolbarItemState(true);
return; return;
} }
let tempViewparam:any = {}; let tempViewparam:any = {};
...@@ -260,6 +263,7 @@ ...@@ -260,6 +263,7 @@
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: refview.viewname } }); Object.assign(this.selection, { view: { viewname: refview.viewname } });
Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext}); Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext});
this.calcToolbarItemState(false);
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -273,6 +277,7 @@ ...@@ -273,6 +277,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_load(args: any[], tag?: string, $event2?: any): void { public ${ctrl.name}_load(args: any[], tag?: string, $event2?: any): void {
this.calcToolbarItemState(true);
this.$emit('load',args); this.$emit('load',args);
} }
...@@ -414,6 +419,34 @@ ...@@ -414,6 +419,34 @@
this.$emit('load', $event); this.$emit('load', $event);
} }
/**
* 设置导航区工具栏禁用状态
*
* @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();
}
}
/** /**
* 计算导航工具栏权限状态 * 计算导航工具栏权限状态
* *
...@@ -422,16 +455,14 @@ ...@@ -422,16 +455,14 @@
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>
}
} }
<#if ctrl.getPSControls()??> <#if ctrl.getPSControls()??>
......
...@@ -490,6 +490,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -490,6 +490,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];
...@@ -520,6 +521,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -520,6 +521,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();
} }
...@@ -529,9 +531,38 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -529,9 +531,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();
}
}
/** /**
* 计算导航工具栏权限状态 * 计算导航工具栏权限状态
* *
...@@ -540,16 +571,14 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -540,16 +571,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>
}
} }
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册