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

支持执行前逻辑外部逻辑处理

上级 71e55640
...@@ -518,8 +518,31 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -518,8 +518,31 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#list appdeAction.getBeforePSDEActionLogics() as beforelogic> <#list appdeAction.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.getPSDELogic()?? && beforelogic.getPSDELogic().getLogicHolder?? && beforelogic.getPSDELogic().getLogicHolder()?? && (beforelogic.getPSDELogic().getLogicHolder() == 2 || beforelogic.getPSDELogic().getLogicHolder() == 3)> <#if beforelogic.getPSDELogic()?? && beforelogic.getPSDELogic().getLogicHolder?? && beforelogic.getPSDELogic().getLogicHolder()?? && (beforelogic.getPSDELogic().getLogicHolder() == 2 || beforelogic.getPSDELogic().getLogicHolder() == 3)>
<#assign singleLogic = beforelogic.getPSDELogic() /> <#assign singleLogic = beforelogic.getPSDELogic() />
<#if beforelogic.isInternalLogic()>
<#-- 内部逻辑start -->
let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))}); let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
data = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,data,isloading?true:false); data = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,data,isloading?true:false);
<#-- 内部逻辑end -->
<#else>
<#-- 外部逻辑start -->
let tempService:any = await this.getService("${beforelogic.getDstPSDE().getCodeName()?lower_case}");
let tempData:any = <#if beforelogic.isCloneParam()>Util.deepCopy(data)<#else>{}</#if>;
if(tempService['${beforelogic.getDstPSDEAction().getCodeName()}'] && tempService['${beforelogic.getDstPSDEAction().getCodeName()}'] instanceof Function){
<#if beforelogic.isIgnoreException()>try {</#if>
let response:any = await tempService['${beforelogic.getDstPSDEAction().getCodeName()}'](context,tempData,isloading?true:false);
if(response && response.status === 200){
data = response.data;
}else{
<#if !beforelogic.isIgnoreException()>data = response.data;</#if>
}
<#if beforelogic.isIgnoreException()>
} catch (error) {
console.warn(error);
}
</#if>
}
<#-- 外部逻辑end -->
</#if>
</#if> </#if>
</#list> </#list>
</#if> </#if>
...@@ -550,7 +573,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -550,7 +573,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
if(response && response.status === 200){ if(response && response.status === 200){
res = response; res = response;
}else{ }else{
<#if !afterlogic.isIgnoreException()>res =response;</#if> <#if !afterlogic.isIgnoreException()>res = response;</#if>
} }
<#if afterlogic.isIgnoreException()> <#if afterlogic.isIgnoreException()>
} catch (error) { } catch (error) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册