提交 51a89e72 编写于 作者: tony001's avatar tony001

优化前端实体处理逻辑 --- fix1

上级 6a36d551
...@@ -19,13 +19,35 @@ import { Verify } from '@/utils/verify/verify'; ...@@ -19,13 +19,35 @@ import { Verify } from '@/utils/verify/verify';
<#macro setParam logicNode> <#macro setParam logicNode>
<#if logicNode.getPSDELogicNodeParams()??> <#if logicNode.getPSDELogicNodeParams()??>
<#list logicNode.getPSDELogicNodeParams() as logicparam> <#list logicNode.getPSDELogicNodeParams() as logicparam>
<#if logicparam.getSrcFieldName()?? && logicparam.getDstFieldName()??> <#-- <#if logicparam.getSrcFieldName()?? && logicparam.getDstFieldName()??>
Object.assign(params,{${logicparam.getDstFieldName()?lower_case}:<#if logicparam.getSrcFieldName()?? && logicparam.getSrcFieldName() != "">params.${logicparam.getSrcFieldName()?lower_case}<#else>params.${logicparam.getDstFieldName()?lower_case}</#if>}); Object.assign(params,{${logicparam.getDstFieldName()?lower_case}:<#if logicparam.getSrcFieldName()?? && logicparam.getSrcFieldName() != "">params.${logicparam.getSrcFieldName()?lower_case}<#else>params.${logicparam.getDstFieldName()?lower_case}</#if>});
<#if logicparam.getDstPSDELogicParam?? && logicparam.getDstPSDELogicParam()?? && logicparam.getDstPSDELogicParam().getParamPSAppDataEntity()??> <#if logicparam.getDstPSDELogicParam?? && logicparam.getDstPSDELogicParam()?? && logicparam.getDstPSDELogicParam().getParamPSAppDataEntity()??>
<#if logicparam.getSrcFieldName()?lower_case?contains("id") > <#if logicparam.getSrcFieldName()?lower_case?contains("id") >
Object.assign(context,{${logicparam.getDstPSDELogicParam().getParamPSAppDataEntity().getCodeName()?lower_case}:params.${logicparam.getSrcFieldName()?lower_case} ? params.${logicparam.getSrcFieldName()?lower_case} : null}); Object.assign(context,{${logicparam.getDstPSDELogicParam().getParamPSAppDataEntity().getCodeName()?lower_case}:params.${logicparam.getSrcFieldName()?lower_case} ? params.${logicparam.getSrcFieldName()?lower_case} : null});
</#if> </#if>
</#if> </#if>
</#if> -->
<#if logicparam.getSrcPSDELogicParam()?? && logicparam.getSrcFieldName()?? && logicparam.getDstPSDELogicParam()?? && logicparam.getDstFieldName()?? && logicparam.getSrcValueType()??>
<#-- 源参数 -->
<#assign srcParam = logicparam.getSrcPSDELogicParam() />
<#-- 源参数属性名称 -->
<#assign srcFieldParam = logicparam.getSrcFieldName() />
<#-- 目标参数 -->
<#assign dstParam = logicparam.getDstPSDELogicParam() />
<#-- 目标参数属性名称 -->
<#assign dstFieldParam = logicparam.getDstFieldName() />
<#-- 源逻辑参数 -->
<#if logicparam.getSrcValueType() =="SRCDLPARAM">
console.log(this.paramsMap);
let tempSrcParam${logicparam_index}:any = this.paramsMap.get('${srcParam.getCodeName()}');
let tempDstParam${logicparam_index}Context:any = this.paramsMap.get('${dstParam.getCodeName()}').context;
let tempDstParam${logicparam_index}Data:any = this.paramsMap.get('${dstParam.getCodeName()}').data;
Object.assign(tempDstParam${logicparam_index}Data,{${dstParam}:tempSrcParam${logicparam_index}Data['${srcFieldParam}']});
this.paramsMap.set('${dstParam.getCodeName()}',{data:tempDstParam${logicparam_index}Data,context:tempDstParam${logicparam_index}Context});
console.log(this.paramsMap);
<#else>
</#if>
</#if> </#if>
</#list> </#list>
</#if> </#if>
...@@ -110,11 +132,11 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -110,11 +132,11 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
public initParams(opts:any){ public initParams(opts:any){
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??> <#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#list item.getPSDELogicParams() as logicParam> <#list item.getPSDELogicParams() as logicParam>
<#if logicParam.isDefault()> <#if logicParam.isDefault()>
this.paramsMap.set('${logicParam.getCodeName()}',opts); this.paramsMap.set('${logicParam.getCodeName()}',opts);
<#else> <#else>
this.paramsMap.set('${logicParam.getCodeName()}',{}); this.paramsMap.set('${logicParam.getCodeName()}',{});
</#if> </#if>
</#list> </#list>
</#if> </#if>
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册