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

update:修复模板报错

上级 b5955c03
......@@ -188,14 +188,14 @@ mock.onDelete(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/batch$/)
<#if singleAppMethod.getMethodType() == "SELECT">
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = [${param},'${item.getKeyPSAppDEField().getCodeName()?lower_case}'];
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -215,7 +215,7 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
<#elseif singleAppMethod.getMethodType() == "FETCH">
// ${singleAppMethod.getCodeName()}
mock.onGet(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -223,7 +223,7 @@ mock.onGet(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if s
}
const paramArray:Array<any> = [${param}];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -257,10 +257,10 @@ mock.onGet(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if s
<#-- 方法类型为DEACTION: BEGIN -->
<#else>
<#-- 方法请求不需要参数情况: BEGIN -->
<#if singleServiceApi.getRequestParamType() == "NONE">
<#if singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "NONE")>
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
// ${singleAppMethod.getCodeName()}
let status = MockAdapter.mockStatus(config);
......@@ -272,18 +272,18 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
});
<#-- 方法请求不需要参数情况: END -->
<#-- 方法请求参数为指定字段属性值: BEGIN -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "FIELD")>
<@outputSort 1 'after'>
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = [${param},'${item.getKeyPSAppDEField().getCodeName()?lower_case}'];
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -301,17 +301,17 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
</@outputSort>
<#-- 方法请求参数为指定字段属性值: END -->
<#-- 方法请求参数为实体对象数据: BEGIN -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "ENTITY")>
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = [${param},'${item.getKeyPSAppDEField().getCodeName()?lower_case}'];
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${path}${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -341,14 +341,14 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
<#if singleAppMethod.getMethodType() == "SELECT">
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['${item.getKeyPSAppDEField().getCodeName()?lower_case}'];
const matchArray:any = new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -368,7 +368,7 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
<#elseif singleAppMethod.getMethodType() == "FETCH">
// ${singleAppMethod.getCodeName()}
mock.onGet(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -379,7 +379,7 @@ mock.onGet(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleSe
});
// ${singleAppMethod.getCodeName()}
mock.onGet(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
<@startLog singleAppMethod />
if(config.url.includes('page')){
let url = config.url.split('?')[1];
......@@ -411,10 +411,10 @@ mock.onGet(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleSe
<#-- 方法类型为DEACTION: BEGIN -->
<#else>
<#-- 方法请求不需要参数情况: BEGIN -->
<#if singleServiceApi.getRequestParamType() == "NONE">
<#if singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "NONE")>
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
// ${singleAppMethod.getCodeName()}
let status = MockAdapter.mockStatus(config);
......@@ -426,18 +426,18 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
});
<#-- 方法请求不需要参数情况: END -->
<#-- 方法请求参数为指定字段属性值: BEGIN -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "FIELD")>
<@outputSort 1 'after'>
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['${item.getKeyPSAppDEField().getCodeName()?lower_case}'];
const matchArray:any = new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -455,17 +455,17 @@ mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new
</@outputSort>
<#-- 方法请求参数为指定字段属性值: END -->
<#-- 方法请求参数为实体对象数据: BEGIN -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "ENTITY")>
// ${singleAppMethod.getCodeName()}
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/?([a-zA-Z0-9\-\;]{0,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
mock.on${srfclassname('${singleServiceApi.getRequestMethod()?lower_case}')}(new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/?([a-zA-Z0-9\-\;]{0,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/)).reply((config: any) => {
<@startLog singleAppMethod />
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['${item.getKeyPSAppDEField().getCodeName()?lower_case}'];
const matchArray:any = new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
const matchArray:any = new RegExp(/^\/${srfpluralize(item.codeName)?lower_case}\/([a-zA-Z0-9\-\;]{1,35})<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>\${singleServiceApi.getRequestPath()}</#if>$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......
......@@ -122,9 +122,9 @@ 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'>
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);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
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);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
......@@ -132,48 +132,48 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#elseif singleAppMethod.getMethodType() == "FETCH">
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
if(${condition}true){
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#else>
<#-- 方法类型为DEACTION start -->
<#if singleServiceApi.getRequestParamType() == "NONE">
<#if singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "NONE")>
<#-- 无参数情况start -->
if(${condition}true){
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "FIELD")>
<#-- 指定属性情况start -->
if(${condition}context.${item.getCodeName()?lower_case}){
<#-- 指定属性情况start -->
<#-- GET -->
<#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);
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?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#elseif singleServiceApi.getRequestMethod() == "POST">
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 !="" >
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#else>
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 !="" >
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
</#if>
<#-- 指定属性情况end -->
}
<#-- 指定属性情况start -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "ENTITY")>
<#-- 提交对象数据情况start -->
<#if singleAppMethod.getCodeName() == 'Create'>
if(${condition}true){
......@@ -204,7 +204,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
let masterData:any = {};
<@getStore appEntity=item />
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);
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?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
......@@ -225,64 +225,64 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleAppMethod.getMethodType() == "SELECT">
<#-- if(context.${item.getCodeName()?lower_case}){ -->
<#if singleServiceApi.getRequestMethod() == 'PUT' || singleServiceApi.getRequestMethod() == 'POST'>
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);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
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);
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);<#if afterActionStr?? && afterActionStr !="" >
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#else>
<#-- 方法类型为DEACTION start -->
<#if singleServiceApi.getRequestParamType() == "NONE">
<#if singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "NONE")>
<#-- 无参数情况start -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "FIELD")>
<#-- 指定属性情况start -->
<#-- GET -->
<#if singleServiceApi.getRequestMethod() == "GET">
<#-- 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);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleServiceApi.getRequestMethod() == "POST">
<#-- REMOVE -->
<#-- if(context.${item.getCodeName()?lower_case}){ -->
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 !="" >
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#-- } -->
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
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 !="" >
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#-- } -->
</#if>
<#-- 指定属性情况end -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#elseif singleServiceApi?? && singleServiceApi.getRequestParamType?? && (singleServiceApi.getRequestParamType() == "ENTITY")>
<#-- 提交对象数据情况start -->
<#if singleAppMethod.getCodeName() == 'Update'>
let masterData:any = {};
<@getStore appEntity=item />
Object.assign(data,masterData);
<#-- 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);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
......@@ -291,7 +291,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<@getStore appEntity=item />
Object.assign(data,masterData);
<#-- 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);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
......@@ -319,7 +319,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
return res;
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
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 !="" >${afterActionStr}</#if>
let res:any = Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
</#if>
......@@ -758,13 +758,13 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
</#list>
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>batch`,tempData,isloading);
return await Http.getInstance().post(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>batch`,tempData,isloading);
}
</#list>
</#if>
<#if item.isMajor()>
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>batch`,tempData,isloading);
return await Http.getInstance().post(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi?? && singleServiceApi.getRequestPath?? && singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>batch`,tempData,isloading);
</#if>
}
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册