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

update:修复模板报错

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