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

行为执行之后逻辑

上级 c3c166de
......@@ -93,21 +93,27 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleAppMethod.getMethodType() == "SELECT">
if(${condition}context.${item.getCodeName()?lower_case}){
<#if singleServiceApi.getRequestMethod() == 'PUT' || singleServiceApi.getRequestMethod() == 'POST'>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if>
<#if afterActionStr??>${afterActionStr}</#if>
return res;
}
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
let res:any = Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
}
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
if(${condition}true){
return Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
}
<#else>
<#-- 方法类型为DEACTION start -->
......@@ -117,6 +123,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
}
<#-- 无参数情况end -->
......@@ -128,11 +135,16 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleServiceApi.getRequestMethod() == "GET">
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#elseif singleServiceApi.getRequestMethod() == "POST">
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
</#if>
<#-- 指定属性情况end -->
}
......@@ -161,6 +173,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
</#list>
</#if>
<#if afterActionStr??>${afterActionStr}</#if>
return res;
}
<#else>
......@@ -170,6 +183,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
Object.assign(data,masterData);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
}
</#if>
......@@ -184,25 +198,28 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
</#list>
</#if>
<#if item.isMajor()>
<#if afterActionStr??>
${afterActionStr}
</#if>
<#-- 方法类型为SELECT -->
<#if singleAppMethod.getMethodType() == "SELECT">
<#-- if(context.${item.getCodeName()?lower_case}){ -->
<#if singleServiceApi.getRequestMethod() == 'PUT' || singleServiceApi.getRequestMethod() == 'POST'>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if>
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
let res:any = Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
return Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#else>
<#-- 方法类型为DEACTION start -->
<#if singleServiceApi.getRequestParamType() == "NONE">
......@@ -210,6 +227,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
......@@ -219,16 +237,21 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleServiceApi.getRequestMethod() == "POST">
<#-- REMOVE -->
<#-- if(context.${item.getCodeName()?lower_case}){ -->
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
</#if>
<#-- 指定属性情况end -->
......@@ -241,6 +264,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleAppMethod.getCodeName() == 'Save'>
......@@ -250,6 +274,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleAppMethod.getCodeName() == 'Create'>
......@@ -273,10 +298,13 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
</#list>
</#if>
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#if afterActionStr??>${afterActionStr}</#if>
return res;
<#-- } -->
</#if>
<#-- 提交对象数据情况end -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册