提交 40f95f0a 编写于 作者: Mosher's avatar Mosher

update:更新

上级 e2596023
...@@ -406,26 +406,78 @@ ...@@ -406,26 +406,78 @@
*/ */
public afterMounted(){ public afterMounted(){
const _this: any = this; const _this: any = this;
<#if view.getPSViewLayoutPanel()?? && !view.getPSViewLayoutPanel().isUseDefaultLayout()> <#if view.getPSViewLayoutPanel()?? && !view.getPSViewLayoutPanel().isUseDefaultLayout()>
_this.initLayout().then((result: any) => { <#assign afterMountedBlock>
_this.isLayoutLoadding = false; _this.isLayoutLoadding = false;
<#if view.getPSAppViewEngines()??> <#if view.getPSAppViewEngines()??>
_this.engineInit(); _this.engineInit();
</#if> </#if>
if (_this.loadModel && _this.loadModel instanceof Function) { if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel(); _this.loadModel();
} }
<#if mounted_block??>${mounted_block}</#if> <#if mounted_block??>
${mounted_block}
</#if>
</#assign>
_this.initLayout().then((result: any) => {
<#assign hasLogic = false>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getLogicTrigger?? && logic.getLogicTrigger()?? && logic.getLogicTrigger() == 'VIEWEVENT' && logic.getEventNames?? && logic.getEventNames()?? && logic.getEventNames()?index_of("onViewMounted") != -1>
<#-- 暂时只支持实体界面逻辑 -->
<#if logic.getLogicType() == 'DEUILOGIC' && logic.getPSAppDEUILogic?? && logic.getPSAppDEUILogic()??>
<#assign hasLogic = true>
<#if view.getPSAppDataEntity?? && view.getPSAppDataEntity()?? && view.getPSAppDataEntity().codeName == logic.getPSAppDEUILogic().getPSAppDataEntity().codeName>
this.appUIService.executeUILogic('${logic.getPSAppDEUILogic().codeName}', [], Util.deepCopy(this.context), Util.deepCopy(this.viewparams), {}, {}, this, '${logic.getPSAppDEUILogic().getPSAppDataEntity().codeName}').then((result: any) => {
if (result && result.hasOwnProperty('srfret') && !result.srfret) {
return;
}
${afterMountedBlock}
});
</#if>
</#if>
</#if>
</#list>
</#if>
<#if !hasLogic>
${afterMountedBlock}
</#if>
}) })
<#else> <#else>
<#if view.getPSAppViewEngines()??> <#assign afterMountedBlock>
<#if view.getPSAppViewEngines()??>
_this.engineInit(); _this.engineInit();
</#if> </#if>
if (_this.loadModel && _this.loadModel instanceof Function) { if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel(); _this.loadModel();
} }
<#if mounted_block??>${mounted_block}</#if> <#if mounted_block??>
</#if> ${mounted_block}
</#if>
</#assign>
<#assign hasLogic = false>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getLogicTrigger?? && logic.getLogicTrigger()?? && logic.getLogicTrigger() == 'VIEWEVENT' && logic.getEventNames?? && logic.getEventNames()?? && logic.getEventNames()?index_of("onViewMounted") != -1>
<#-- 暂时只支持实体界面逻辑 -->
<#if logic.getLogicType() == 'DEUILOGIC' && logic.getPSAppDEUILogic?? && logic.getPSAppDEUILogic()??>
<#assign hasLogic = true>
<#if view.getPSAppDataEntity?? && view.getPSAppDataEntity()?? && view.getPSAppDataEntity().codeName == logic.getPSAppDEUILogic().getPSAppDataEntity().codeName>
this.appUIService.executeUILogic('${logic.getPSAppDEUILogic().codeName}', [], Util.deepCopy(this.context), Util.deepCopy(this.viewparams), {}, {}, this, '${logic.getPSAppDEUILogic().getPSAppDataEntity().codeName}').then((result: any) => {
if (result && result.hasOwnProperty('srfret') && !result.srfret) {
return;
}
${afterMountedBlock}
});
</#if>
</#if>
</#if>
</#list>
</#if>
<#if !hasLogic>
${afterMountedBlock}
</#if>
</#if>
} }
<#if view.getPSControls()??> <#if view.getPSControls()??>
......
...@@ -153,6 +153,23 @@ export default class ${srfclassname('${item.getCodeName()}')}UILogicBase { ...@@ -153,6 +153,23 @@ export default class ${srfclassname('${item.getCodeName()}')}UILogicBase {
} }
} }
/**
* 获取条件参数
*
* @param {UIActionContext} actionContext 界面逻辑上下文
* @param {string} param 节点参数
* @param {string} property 参数属性
* @return {*}
* @memberof ${srfclassname('${item.getCodeName()}')}UILogicBase
*/
public getCondParam(actionContext: UIActionContext, param: string, property: string) {
const resultParam = actionContext.getParam(param).getReal();
if (resultParam && resultParam.hasOwnProperty(property)) {
return resultParam[property];
}
return null;
}
<#if item.getPSDEUILogicNodes?? && item.getPSDEUILogicNodes()??> <#if item.getPSDEUILogicNodes?? && item.getPSDEUILogicNodes()??>
<#list item.getPSDEUILogicNodes() as logicNode> <#list item.getPSDEUILogicNodes() as logicNode>
<@executenode logicNode/> <@executenode logicNode/>
......
<#-- 获取判断条件 --> <#-- 获取判断条件 -->
<#macro getCond item><#if item.getLogicType() == 'GROUP'><#if item.isNotMode()>!(</#if><#if item.getPSDEUILogicLinkConds()??><#list item.getPSDEUILogicLinkConds() as subLogic><#if subLogic_index gt 0><#if item.getGroupOP() == 'AND'> && </#if><#if item.getGroupOP() == 'OR'> || </#if></#if><@getCond subLogic /></#list></#if><#if item.isNotMode()>)</#if><#elseif item.getLogicType() == 'SINGLE'>Verify.testCond(params.${item.getDstFieldName()?lower_case}, '${item.getCondOP()}', '${item.getValue()}')</#if></#macro> <#macro getCond item><#if item.getLogicType() == 'GROUP'><#if item.isNotMode()>!(</#if><#if item.getPSDEUILogicLinkConds()??><#list item.getPSDEUILogicLinkConds() as subLogic><#if subLogic_index gt 0><#if item.getGroupOP() == 'AND'> && </#if><#if item.getGroupOP() == 'OR'> || </#if></#if><@getCond subLogic /></#list></#if><#if item.isNotMode()>)</#if><#elseif item.getLogicType() == 'SINGLE'>Verify.testCond(this.getCondParam(actionContext, '<#if item.getDstLogicParam?? && item.getDstLogicParam()??>${item.getDstLogicParam().codeName}</#if>', '${item.getDstFieldName()?lower_case}') params.${item.getDstFieldName()?lower_case}, '${item.getCondOP()}', '${item.getValue()}')</#if></#macro>
<#-- START: 计算下一节点 --> <#-- START: 计算下一节点 -->
<#macro computeNextNode logicNode> <#macro computeNextNode logicNode>
<#if logicNode.getPSDEUILogicLinks?? && logicNode.getPSDEUILogicLinks()??> <#if logicNode.getPSDEUILogicLinks?? && logicNode.getPSDEUILogicLinks()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册