提交 1fccccc7 编写于 作者: Mosher's avatar Mosher

update:更新

上级 80447c57
<#macro initControlEvents ctrl view> <#macro initControlEvents ctrl view>
<#if ctrl.getPSControlLogics?? && ctrl.getPSControlLogics()??>
<#list ctrl.getPSControlLogics() as logic>
<#if logic.getLogicType() != 'APPVIEWLOGIC' && logic.getLogicType() != 'APPVIEWENGINE' && logic.getTriggerType() == 'CTRLEVENT'>
<#assign hasCtrlLogic = true />
</#if>
</#list>
</#if>
<#if hasCtrlLogic??>
/** /**
* 处理部件事件 * 处理部件事件
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public async handleCtrlEvents(eventName: string, args: any = {}): Promise<boolean> { public async handleCtrlEvents(eventName: string, args: any = {}): Promise<boolean> {
const data = args && args.data ? args.data : this.getData() || {}; const actionData = {
const event = args && args.event ? args.event : {}; data: this.getData() || {},
context: Util.deepCopy(this.context),
viewparams: Util.deepCopy(this.viewparams)
}
let result: boolean = true; let result: boolean = true;
<#if ctrl.getPSControlLogics?? && ctrl.getPSControlLogics()??>
<#list ctrl.getPSControlLogics() as logic> <#list ctrl.getPSControlLogics() as logic>
<#if logic.getLogicType() != 'APPVIEWLOGIC' && logic.getLogicType() != 'APPVIEWENGINE' && logic.getTriggerType() == 'CTRLEVENT'> <#if logic.getLogicType() != 'APPVIEWLOGIC' && logic.getLogicType() != 'APPVIEWENGINE' && logic.getTriggerType() == 'CTRLEVENT'>
if ('${logic.getEventNames()?lower_case}'.indexOf(eventName) !== -1) { if ('${logic.getEventNames()?lower_case}'.indexOf(eventName) !== -1) {
result = await this.execute_${logic.name}_ctrl_logic(data, event) && result; result = await this.execute_${logic.name}_ctrl_logic(actionData) && result;
} }
</#if> </#if>
</#list> </#list>
</#if>
if (!result) { if (!result) {
return false; return false;
} }
...@@ -30,6 +27,7 @@ ...@@ -30,6 +27,7 @@
return true; return true;
} }
<#if ctrl.getPSControlLogics?? && ctrl.getPSControlLogics()??>
<#list ctrl.getPSControlLogics() as logic> <#list ctrl.getPSControlLogics() as logic>
<#if logic.getLogicType() != 'APPVIEWLOGIC' && logic.getLogicType() != 'APPVIEWENGINE' && logic.getTriggerType() == 'CTRLEVENT'> <#if logic.getLogicType() != 'APPVIEWLOGIC' && logic.getLogicType() != 'APPVIEWENGINE' && logic.getTriggerType() == 'CTRLEVENT'>
/** /**
...@@ -40,21 +38,22 @@ ...@@ -40,21 +38,22 @@
* @param {*} event 源事件对象 * @param {*} event 源事件对象
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public async execute_${logic.name}_ctrl_logic(data: any[], event?: any): Promise<boolean> { public async execute_${logic.name}_ctrl_logic(actionData: any): Promise<boolean> {
<#if logic.getLogicType() == 'DEUILOGIC'> <#if logic.getLogicType() == 'DEUILOGIC'>
<#if logic.getPSAppDEUILogic?? && logic.getPSAppDEUILogic()??> <#if logic.getPSAppDEUILogic?? && logic.getPSAppDEUILogic()??>
try { try {
const uiService = await window.uiServiceRegister.getService('${logic.getPSAppDEUILogic().getPSAppDataEntity().getCodeName()?lower_case}'); const uiService = await window.uiServiceRegister.getService('${logic.getPSAppDEUILogic().getPSAppDataEntity().getCodeName()?lower_case}');
if (uiService) { if (uiService) {
const { data, context, viewparams } = actionData;
const result = await uiService.executeUILogic( const result = await uiService.executeUILogic(
'${logic.getPSAppDEUILogic().codeName}', '${logic.getPSAppDEUILogic().codeName}',
data, data,
Util.deepCopy(this.context), context,
Util.deepCopy(this.viewparams), viewparams,
event, actionData.event ? actionData.event : {},
this, this,
this.viewCtx && this.viewCtx.view ? this.viewCtx.view : {}, this.viewCtx && this.viewCtx.view ? this.viewCtx.view : {},
this.context.srfparentdename ? this.context.srfparentdename : '' context.srfparentdename ? context.srfparentdename : ''
); );
if (result && result.hasOwnProperty('srfret') && (result.srfret === 'false' || result.srfret === false)) { if (result && result.hasOwnProperty('srfret') && (result.srfret === 'false' || result.srfret === false)) {
return false; return false;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<#list logicNode.getPSDEUILogicLinks() as link> <#list logicNode.getPSDEUILogicLinks() as link>
<#if link.getDstPSDEUILogicNode?? && link.getDstPSDEUILogicNode()??> <#if link.getDstPSDEUILogicNode?? && link.getDstPSDEUILogicNode()??>
<#if link.getPSDEUILogicLinkGroupCond?? && link.getPSDEUILogicLinkGroupCond()??> <#if link.getPSDEUILogicLinkGroupCond?? && link.getPSDEUILogicLinkGroupCond()??>
if(<@getCond link.getPSDEUILogicLinkGroupCond() />) { if (<@getCond link.getPSDEUILogicLinkGroupCond() />) {
await this.execute_${link.getDstPSDEUILogicNode().codeName?lower_case}_node(actionContext); await this.execute_${link.getDstPSDEUILogicNode().codeName?lower_case}_node(actionContext);
} }
<#else> <#else>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册