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

调整执行后逻辑外部逻辑支持

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