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

update:更新

上级 bb8c72e4
......@@ -531,34 +531,9 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleButtonClick(name: string, $event?: any) {
let datas: any[] = [];
const data: any = this.layoutModelDetails[name].getData();
if (data) {
if (data instanceof Array) {
datas = [...data];
} else {
datas = [data];
}
}
const xData: any = this.layoutModelDetails[name].getDataArea();
const paramJO: any = {};
const contextJO: any = {};
const _this: any = this;
<@panelButtonActionParam />
<#list ctrl.getAllPSPanelItems() as panelItem>
<#if panelItem.getItemType() == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
if (Object.is(name, '${panelItem.name}')) {
<#if panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
<#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
window.uiServiceRegister.getService('${curAppEntity.getCodeName()?lower_case}').then((UIService: any) => {
if (UIService && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] instanceof Function) {
UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO, $event, xData, this, undefined);
}
})
<#else>
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
</#if>
}
</#if>
<@executePanelButtonAction panelItem />
</#list>
}
......
<#-- 面板逻辑 -->
<#macro panelLogic item>
<@compress single_line=true>
<#if item.getLogicType() == 'GROUP'>
......@@ -25,6 +26,8 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
</#if>
</@compress>
</#macro>
<#-- 面板项动态逻辑 -->
<#macro getPanelItemLogic panelItem>
<#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??>
<#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/>
......@@ -98,4 +101,39 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
}
}
</#if>
</#macro>
<#-- 面板按钮行为参数 -->
<#macro panelButtonActionParam>
let datas: any[] = [];
const data: any = this.layoutModelDetails[name].getData();
if (data) {
if (data instanceof Array) {
datas = [...data];
} else {
datas = [data];
}
}
const xData: any = this.layoutModelDetails[name].getDataArea();
const paramJO: any = {};
const contextJO: any = {};
const _this: any = this;
</#macro>
<#-- 执行面板按钮行为 -->
<#macro executePanelButtonAction panelItem>
<#if panelItem.getItemType() == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
if (Object.is(name, '${panelItem.name}')) {
<#if panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
<#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
window.uiServiceRegister.getService('${curAppEntity.getCodeName()?lower_case}').then((UIService: any) => {
if (UIService && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] instanceof Function) {
UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO, $event, xData, this, undefined);
}
})
<#else>
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
</#if>
}
</#if>
</#macro>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册