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

数据服务增加临时模式判断

上级 01ac5d64
...@@ -21,7 +21,13 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -21,7 +21,13 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() /> <#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() />
<#-- 从实体 --> <#-- 从实体 -->
<#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() /> <#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() />
<#-- 从实体支持临时数据模式为true,才设置本地缓存 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#if minorPSAppDataEntity.isEnableTempData()>
this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case})); this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
</#if>
<#-- 从实体支持临时数据模式为true,才设置本地缓存 end -->
</#list> </#list>
</#if> </#if>
</#macro> </#macro>
...@@ -34,6 +40,10 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -34,6 +40,10 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() /> <#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() />
<#-- 从实体 --> <#-- 从实体 -->
<#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() /> <#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() />
<#-- 从实体支持临时数据模式为true,才从前端缓存拿取数据,组装数据给后台 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#if minorPSAppDataEntity.isEnableTempData()>
let ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data:any = []; let ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}'),'undefined')){
${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}') as any); ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}') as any);
...@@ -49,6 +59,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -49,6 +59,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
} }
} }
masterData.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case} = ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data; masterData.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case} = ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data;
</#if>
<#-- 从实体支持临时数据模式为true,才从前端缓存拿取数据,组装数据给后台 end -->
</#list> </#list>
</#if> </#if>
</#macro> </#macro>
...@@ -513,6 +525,8 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends ...@@ -513,6 +525,8 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
</#if> </#if>
} }
<#-- 查询数据集(post方式)start --> <#-- 查询数据集(post方式)start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#if singleAppMethod.getMethodType?? && singleAppMethod.getMethodType()?? && singleAppMethod.getMethodType() == "FETCH"> <#if singleAppMethod.getMethodType?? && singleAppMethod.getMethodType()?? && singleAppMethod.getMethodType() == "FETCH">
<#assign dataSet = singleAppMethod.getPSDEDataSet() /> <#assign dataSet = singleAppMethod.getPSDEDataSet() />
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册