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

优化前端实体处理逻辑

上级 fc62ff3e
...@@ -84,6 +84,13 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -84,6 +84,13 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
*/ */
private defaultParamName:string = "${item.getDefaultParamName()}"; private defaultParamName:string = "${item.getDefaultParamName()}";
/**
* 参数集合
*
* @memberof ${srfclassname('${item.getCodeName()}')}LogicBase
*/
private paramsMap:Map<string,any> = new Map();
/** /**
* Creates an instance of ${srfclassname('${item.getCodeName()}')}LogicBase. * Creates an instance of ${srfclassname('${item.getCodeName()}')}LogicBase.
* *
...@@ -91,7 +98,25 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -91,7 +98,25 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
* @memberof ${srfclassname('${item.getCodeName()}')}LogicBase * @memberof ${srfclassname('${item.getCodeName()}')}LogicBase
*/ */
constructor(opts: any = {}) { constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof ${srfclassname('${item.getCodeName()}')}LogicBase
*/
public initParams(opts:any){
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#list item.getPSDELogicParams() as logicParam>
<#if logicParam.isDefault()>
this.paramsMap.set('${logicParam.getCodeName()}',opts);
<#else>
this.paramsMap.set('${logicParam.getCodeName()}',{});
</#if>
</#list>
</#if>
} }
<#if item.getPSDELogicLinks()??> <#if item.getPSDELogicLinks()??>
......
...@@ -469,7 +469,7 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends ...@@ -469,7 +469,7 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
<#assign appdeAction = singleAppMethod.getPSDEAction() /> <#assign appdeAction = singleAppMethod.getPSDEAction() />
<#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) > <#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) >
<#assign appdelogic = appdeAction.getPSDELogic() /> <#assign appdelogic = appdeAction.getPSDELogic() />
let appLogic:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic(); let appLogic:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
const result = await appLogic.onExecute(context,data,isloading?true:false); const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result}; return {status:200,data:result};
<#else> <#else>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册