<#-- 逻辑事件 --> /** * 逻辑事件 * * @param {*} [params={}] * @param {*} [tag] * @param {*} [$event] * @memberof */ public ${item.name}(params: any = {}, tag?: any, $event?: any) { <#-- 事件参数(未支持) --> <#if item.getEventArg()?? && item.getEventArg()?length gt 0> // 参数 </#if> <#-- 触发逻辑类型为APPVIEWUIACTION且存在视图界面行为 --> <#if item.getLogicType() == 'APPVIEWUIACTION' && item.getPSAppViewUIAction()??> <#assign uiAction = item.getPSAppViewUIAction().getPSUIAction() /> // 取数 let datas: any[] = []; let xData: any = null; // _this 指向容器对象 const _this: any = this; let paramJO:any = {}; let contextJO:any = {}; <#-- 是否存在界面行为数据部件 --> <#if item.getPSAppViewUIAction().getXDataPSControl?? && item.getPSAppViewUIAction().getXDataPSControl()??> <#assign xData = item.getPSAppViewUIAction().getXDataPSControl()/> <#-- 界面行为数据部件与控件容器不同时,即逻辑事件在视图里时 --> <#if xData != item.getPSAppViewUIAction().getPSControlContainer()> xData = this.$refs.${xData.name?lower_case}; if (xData.getDatas && xData.getDatas instanceof Function) { datas = [...xData.getDatas()]; } <#-- 界面行为数据部件与控件容器相同时 --> <#else> xData = this; <#if xData.getControlType?? && xData.getControlType() == 'VIEWLAYOUTPANEL'> datas = [this.layoutData]; <#else> if (_this.getDatas && _this.getDatas instanceof Function) { datas = [..._this.getDatas()]; } </#if> </#if> <#else> if (_this.getDatas && _this.getDatas instanceof Function) { datas = [..._this.getDatas()]; } </#if> if(params){ datas = [params]; } // 界面行为 <#if item.getPSAppViewUIAction().getPSUIAction()??> <#assign uiaction = item.getPSAppViewUIAction().getPSUIAction()/> <#-- 属于应用实体的界面行为走UI服务start --> <#if uiaction.getPSAppDataEntity?? && uiaction.getPSAppDataEntity()??> <#assign curAppEntity = uiaction.getPSAppDataEntity() /> <#if uiaction.getPSAppWFVer?? && uiaction.getPSAppWFVer()??> const curUIService:${srfclassname('${uiaction.getPSAppWFVer().getCodeName()}')}WFUIService = new ${srfclassname('${uiaction.getPSAppWFVer().getCodeName()}')}WFUIService(); <#else> const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService(); </#if> <#if item.getPSControlContainer()?? && item.getPSControlContainer().getPSAppDataEntity()??> <#assign appDataEntity = item.getPSControlContainer().getPSAppDataEntity()/> curUIService.${uiaction.getFullCodeName()}(datas,contextJO, paramJO, $event, xData,this,<#if appDataEntity??>"${appDataEntity.getCodeName()}"<#else>null</#if>); </#if> <#else> <#if item.getPSControlContainer()?? && item.getPSControlContainer().getPSAppDataEntity()??> <#assign appDataEntity = item.getPSControlContainer().getPSAppDataEntity()/> this.${uiaction.getFullCodeName()}(datas, contextJO,paramJO, $event, xData,this,"${appDataEntity.getCodeName()}"); <#else> this.${uiaction.getFullCodeName()}(datas, contextJO,paramJO, $event, xData,this,undefined); </#if> </#if> <#-- 属于应用实体的界面行为走UI服务end --> </#if> </#if> }