提交 97ad4337 编写于 作者: Mosher's avatar Mosher

update:更新

上级 62587604
...@@ -23,99 +23,101 @@ ...@@ -23,99 +23,101 @@
<#macro prepareParamNode logicNode> <#macro prepareParamNode logicNode>
<#if logicNode.getPSDEUILogicNodeParams?? && logicNode.getPSDEUILogicNodeParams()??> <#if logicNode.getPSDEUILogicNodeParams?? && logicNode.getPSDEUILogicNodeParams()??>
try { try {
<#assign index = 0>
<#list logicNode.getPSDEUILogicNodeParams() as param> <#list logicNode.getPSDEUILogicNodeParams() as param>
<#assign index = index + 1>
<#if param.getParamAction?? && param.getParamAction()??> <#if param.getParamAction?? && param.getParamAction()??>
<#if param.getParamAction() == 'SETPARAMVALUE'> <#if param.getParamAction() == 'SETPARAMVALUE'>
<#if (param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??) || (param.getSrcValueType?? && param.getSrcValueType()??)> <#if (param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??) || (param.getSrcValueType?? && param.getSrcValueType()??)>
// 目标数据 // 目标数据
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
// 无值类型 // 无值类型
<#if param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'NONEVALUE'> <#if param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'NONEVALUE'>
<#if param.getDstFieldName?? && param.getDstFieldName()??> <#if param.getDstFieldName?? && param.getDstFieldName()??>
dstParam_${param?index}.reset('${param.getDstFieldName()?lower_case}'); dstParam_${index}.reset('${param.getDstFieldName()?lower_case}');
<#else> <#else>
dstParam_${param?index}.bind(undefined); dstParam_${index}.bind(undefined);
</#if> </#if>
<#else> <#else>
<#if param.getSrcValueType?? && param.getSrcValueType()?? && (param.getSrcValueType() == 'SRCDLPARAM' || param.getSrcValueType() == 'WEBCONTEXT' || param.getSrcValueType() == 'VIEWPARAM')> <#if param.getSrcValueType?? && param.getSrcValueType()?? && (param.getSrcValueType() == 'SRCDLPARAM' || param.getSrcValueType() == 'WEBCONTEXT' || param.getSrcValueType() == 'VIEWPARAM')>
<#-- 源逻辑参数、网页请求上下文、当前视图参数 --> <#-- 源逻辑参数、网页请求上下文、当前视图参数 -->
const srcParam_${param?index} = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>'); const srcParam_${index} = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>');
const result_${param?index} = srcParam_${param?index}.get('<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>') ? srcParam_${param?index}.get('<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>') : null; const result_${index} = srcParam_${index}.get('<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>') ? srcParam_${index}.get('<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>') : null;
<#elseif param.getSrcValueType?? && param.getSrcValueType()?? && (param.getSrcValueType() == 'APPLICATION' || param.getSrcValueType() == 'SESSION' || param.getSrcValueType() == 'APPDATA' || param.getSrcValueType() == 'DATACONTEXT')> <#elseif param.getSrcValueType?? && param.getSrcValueType()?? && (param.getSrcValueType() == 'APPLICATION' || param.getSrcValueType() == 'SESSION' || param.getSrcValueType() == 'APPDATA' || param.getSrcValueType() == 'DATACONTEXT')>
<#-- 系统全局对象、用户全局对象、应用上下文、数据上下文 --> <#-- 系统全局对象、用户全局对象、应用上下文、数据上下文 -->
const result_${param?index} = actionContext['<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>']; const result_${index} = actionContext['<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>'];
<#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'ENVPARAM'> <#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'ENVPARAM'>
<#-- 环境参数 --> <#-- 环境参数 -->
// TODO 环境参数 // TODO 环境参数
const result_${param?index} = ''; const result_${index} = '';
<#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'EXPRESSION'> <#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'EXPRESSION'>
<#-- 计算式 --> <#-- 计算式 -->
// TODO 计算式 // TODO 计算式
const result_${param?index} = ''; const result_${index} = '';
<#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'SRCVALUE'> <#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'SRCVALUE'>
<#-- 直接值 --> <#-- 直接值 -->
const result_${param?index} = '<#if param.getSrcValue?? && param.getSrcValue()??>${param.getSrcValue()}</#if>'; const result_${index} = '<#if param.getSrcValue?? && param.getSrcValue()??>${param.getSrcValue()}</#if>';
<#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'NULLVALUE'> <#elseif param.getSrcValueType?? && param.getSrcValueType()?? && param.getSrcValueType() == 'NULLVALUE'>
<#-- 空值(NULL) --> <#-- 空值(NULL) -->
const result_${param?index} = null; const result_${index} = null;
<#else> <#else>
<#-- 未支持 --> <#-- 未支持 -->
const result_${param?index} = undefined; const result_${index} = undefined;
</#if> </#if>
<#if param.getDstFieldName?? && param.getDstFieldName()??> <#if param.getDstFieldName?? && param.getDstFieldName()??>
const dstParam_${param?index}.set('${param.getDstFieldName()?lower_case}', result_${param?index}); const dstParam_${index}.set('${param.getDstFieldName()?lower_case}', result_${index});
<#else> <#else>
dstParam_${param?index}.bind(result_${param?index}); dstParam_${index}.bind(result_${index});
</#if> </#if>
</#if> </#if>
<#else> <#else>
throw new Error(`逻辑参数${param.name}源类型参数或者目标逻辑参数缺失`); throw new Error(`逻辑参数${param.name}源类型参数或者目标逻辑参数缺失`);
</#if> </#if>
<#elseif param.getParamAction() == 'RESETPARAM'> <#elseif param.getParamAction() == 'RESETPARAM'>
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
dstParam_${param?index}.resetAll(); dstParam_${index}.resetAll();
<#elseif param.getParamAction() == 'COPYPARAM'> <#elseif param.getParamAction() == 'COPYPARAM'>
// 源数据 // 源数据
const srcParam_${param?index}: any = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>'); const srcParam_${index}: any = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>');
// 目标数据 // 目标数据
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
srcParam_${param?index}.copyTo(dstParam_${param?index}); srcParam_${index}.copyTo(dstParam_${index});
<#elseif param.getParamAction() == 'BINDPARAM'> <#elseif param.getParamAction() == 'BINDPARAM'>
// 源数据 // 源数据
const srcParam_${param?index}: any = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>'); const srcParam_${index}: any = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>');
// 目标数据 // 目标数据
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
const srcFieldName_${param?index} = '<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>'; const srcFieldName_${index} = '<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>';
if (srcFieldName_${param?index}) { if (srcFieldName_${index}) {
dstParam_${param?index}.bind(srcParam_${param?index}.get(srcFieldName_${param?index})); dstParam_${index}.bind(srcParam_${index}.get(srcFieldName_${index}));
} else { } else {
dstParam_${param?index}.bind(srcParam_${param?index}.getReal()); dstParam_${index}.bind(srcParam_${index}.getReal());
} }
<#elseif param.getParamAction() == 'RENEWPARAM'> <#elseif param.getParamAction() == 'RENEWPARAM'>
// 目标数据 // 目标数据
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
dstParam_${param?index}.renew(); dstParam_${index}.renew();
<#elseif param.getParamAction() == 'APPENDPARAM'> <#elseif param.getParamAction() == 'APPENDPARAM'>
// 源数据 // 源数据
const srcParam_${param?index}: any = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>'); const srcParam_${index}: any = actionContext.getParam('<#if param.getSrcPSDEUILogicParam?? && param.getSrcPSDEUILogicParam()??>${param.getSrcPSDEUILogicParam().codeName}</#if>');
// 目标数据 // 目标数据
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
const srcFieldName_${param?index} = '<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>'; const srcFieldName_${index} = '<#if param.getSrcFieldName?? && param.getSrcFieldName()??>${param.getSrcFieldName()?lower_case}</#if>';
let objParam_${param?index}: any; let objParam_${index}: any;
if (srcFieldName_${param?index}) { if (srcFieldName_${index}) {
objParam_${param?index} = srcParam_${param?index}.get(srcFieldName_${param?index}); objParam_${index} = srcParam_${index}.get(srcFieldName_${index});
} else { } else {
objParam_${param?index} = srcParam_${param?index}.getReal(); objParam_${index} = srcParam_${index}.getReal();
} }
dstParam_${param?index}.append(${param.getDstIndex()?c}, objParam_${param?index}, ${param.getSrcIndex()?c}, ${param.getSrcSize()?c}); dstParam_${index}.append(${param.getDstIndex()?c}, objParam_${index}, ${param.getSrcIndex()?c}, ${param.getSrcSize()?c});
<#elseif param.getParamAction() == 'SORTPARAM'> <#elseif param.getParamAction() == 'SORTPARAM'>
// 目标数据 // 目标数据
const dstParam_${param?index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>'); const dstParam_${index}: any = actionContext.getParam('<#if param.getDstPSDEUILogicParam?? && param.getDstPSDEUILogicParam()??>${param.getDstPSDEUILogicParam().codeName}</#if>');
const dstFieldName_${param?index} = '<#if param.getDstFieldName?? && param.getDstFieldName()??>${param.getDstFieldName()?lower_case}</#if>'; const dstFieldName_${index} = '<#if param.getDstFieldName?? && param.getDstFieldName()??>${param.getDstFieldName()?lower_case}</#if>';
if (!dstFieldName_${param?index}) { if (!dstFieldName_${index}) {
throw new Error(`逻辑参数${param.name}未指定设置排序属性`); throw new Error(`逻辑参数${param.name}未指定设置排序属性`);
} else { } else {
dstParam_${param?index}.sort(dstFieldName_${param?index}, '${param.getDstSortDir()}'); dstParam_${index}.sort(dstFieldName_${index}, '${param.getDstSortDir()}');
} }
</#if> </#if>
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册