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

update:更新

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