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

调整界面行为导航参数

上级 0fee066c
...@@ -37,6 +37,9 @@ ${front_block} ...@@ -37,6 +37,9 @@ ${front_block}
<#else> <#else>
<#-- BEGIN: 数据处理逻辑 --> <#-- BEGIN: 数据处理逻辑 -->
let data: any = {}; let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
<#if item.getPSNavigateContexts?? && item.getPSNavigateContexts()??> <#if item.getPSNavigateContexts?? && item.getPSNavigateContexts()??>
Object.assign(context,<@getNavigateContext item />); Object.assign(context,<@getNavigateContext item />);
</#if> </#if>
...@@ -50,7 +53,6 @@ ${front_block} ...@@ -50,7 +53,6 @@ ${front_block}
</#if> </#if>
<#-- 是否先保存目标数据end --> <#-- 是否先保存目标数据end -->
const _args: any[] = Util.deepCopy(args); const _args: any[] = Util.deepCopy(args);
const _this: any = actionContext;
const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>; const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>;
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??> <#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
<#assign appDataEntity = item.getPSAppDataEntity() /> <#assign appDataEntity = item.getPSAppDataEntity() />
...@@ -63,8 +65,14 @@ ${front_block} ...@@ -63,8 +65,14 @@ ${front_block}
Object.assign(params, { ${textItem}: '%${textItem}%' }); Object.assign(params, { ${textItem}: '%${textItem}%' });
</#if> </#if>
</#if> </#if>
context = UIActionTool.handleContextParam(actionTarget,_args,context); if(_this.context){
data = UIActionTool.handleActionParam(actionTarget,_args,params); parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context); context = Object.assign({},actionContext.context,context);
<#-- 构建srfparentdename和srfparentkey start --> <#-- 构建srfparentdename和srfparentkey start -->
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null}; let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
......
...@@ -20,7 +20,7 @@ ${backend_block} ...@@ -20,7 +20,7 @@ ${backend_block}
* @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService * @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService
</#if> </#if>
*/ */
public async ${item.getFullCodeName()}(args: any[],context:any = {}, params?: any, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){ public async ${item.getFullCodeName()}(args: any[],context:any = {}, params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
...@@ -45,6 +45,15 @@ ${backend_block} ...@@ -45,6 +45,15 @@ ${backend_block}
actionContext.$Notice.error({ title: '错误', desc: '不支持多项数据' }); actionContext.$Notice.error({ title: '错误', desc: '不支持多项数据' });
<#else> <#else>
let data: any = {}; let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
<#if item.getPSNavigateContexts?? && item.getPSNavigateContexts()??>
Object.assign(context,<@getNavigateContext item />);
</#if>
<#if item.getPSNavigateParams?? && item.getPSNavigateParams()??>
Object.assign(params,<@getNavigateParams item />);
</#if>
<#-- 是否先保存目标数据start --> <#-- 是否先保存目标数据start -->
<#if item.isSaveTargetFirst()> <#if item.isSaveTargetFirst()>
const result:any = await xData.save(args,false); const result:any = await xData.save(args,false);
...@@ -52,7 +61,6 @@ ${backend_block} ...@@ -52,7 +61,6 @@ ${backend_block}
</#if> </#if>
<#-- 是否先保存目标数据end --> <#-- 是否先保存目标数据end -->
const _args: any[] = Util.deepCopy(args); const _args: any[] = Util.deepCopy(args);
const _this: any = actionContext;
const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>; const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>;
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??> <#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
<#assign appDataEntity = item.getPSAppDataEntity() /> <#assign appDataEntity = item.getPSAppDataEntity() />
...@@ -65,8 +73,14 @@ ${backend_block} ...@@ -65,8 +73,14 @@ ${backend_block}
Object.assign(params, { ${textItem}: '%${textItem}%' }); Object.assign(params, { ${textItem}: '%${textItem}%' });
</#if> </#if>
</#if> </#if>
context = UIActionTool.handleContextParam(actionTarget,_args,context); if(_this.context){
data = UIActionTool.handleActionParam(actionTarget,_args,params); parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context); context = Object.assign({},actionContext.context,context);
<#-- 构建srfparentdename和srfparentkey start --> <#-- 构建srfparentdename和srfparentkey start -->
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null}; let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService<#t> * @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService<#t>
</#if> </#if>
*/ */
public async ${item.getFullCodeName()}(args: any[],context: any ={}, params?: any, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){ public async ${item.getFullCodeName()}(args: any[],context: any ={}, params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
...@@ -26,17 +26,31 @@ ...@@ -26,17 +26,31 @@
<#if item.getFrontPSAppView()??> <#if item.getFrontPSAppView()??>
<#assign dataview = item.getFrontPSAppView()> <#assign dataview = item.getFrontPSAppView()>
let data: any = {}; let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
<#if item.getPSNavigateContexts?? && item.getPSNavigateContexts()??>
Object.assign(context,<@getNavigateContext item />);
</#if>
<#if item.getPSNavigateParams?? && item.getPSNavigateParams()??>
Object.assign(params,<@getNavigateParams item />);
</#if>
<#-- 是否先保存目标数据start --> <#-- 是否先保存目标数据start -->
<#if item.isSaveTargetFirst()> <#if item.isSaveTargetFirst()>
const result:any = await xData.save(args,false); const result:any = await xData.save(args,false);
args = [result.data]; args = [result.data];
</#if> </#if>
<#-- 是否先保存目标数据end --> <#-- 是否先保存目标数据end -->
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args); const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>; const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>;
context = UIActionTool.handleContextParam(actionTarget,_args,context); if(_this.context){
data = UIActionTool.handleActionParam(actionTarget,_args,params); parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
//转化表单界面数据 //转化表单界面数据
const resultData:any = xData.service.handleRequestData('',actionContext.context,_args[0]); const resultData:any = xData.service.handleRequestData('',actionContext.context,_args[0]);
Object.assign(context,resultData.context,context); Object.assign(context,resultData.context,context);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService<#t> * @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService<#t>
</#if> </#if>
*/ */
public async ${item.getFullCodeName()}(args: any[],context: any = {}, params?: any, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string) { public async ${item.getFullCodeName()}(args: any[],context: any = {},params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string) {
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
actionContext.$Notice.error({ title: '错误', desc: '不支持多项数据' }); actionContext.$Notice.error({ title: '错误', desc: '不支持多项数据' });
<#else> <#else>
let data: any = {}; let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
if(!args || args.length <1){ if(!args || args.length <1){
console.error("错误,无数据传入"); console.error("错误,无数据传入");
} }
...@@ -40,7 +43,6 @@ ...@@ -40,7 +43,6 @@
</#if> </#if>
<#-- 是否先保存目标数据end --> <#-- 是否先保存目标数据end -->
const _args: any[] = Util.deepCopy(args); const _args: any[] = Util.deepCopy(args);
const _this: any = actionContext;
const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>; const actionTarget: string | null = <#if item.getActionTarget()??>'${item.getActionTarget()}'<#else>null</#if>;
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??> <#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
<#assign appDataEntity = item.getPSAppDataEntity() /> <#assign appDataEntity = item.getPSAppDataEntity() />
...@@ -59,8 +61,14 @@ ...@@ -59,8 +61,14 @@
</#if> </#if>
</#if> </#if>
</#if> </#if>
context = UIActionTool.handleContextParam(actionTarget,_args,context); if(_this.context){
data = UIActionTool.handleActionParam(actionTarget,_args,params); parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
//转化表单界面数据 //转化表单界面数据
const resultData:any = xData.service.handleRequestData('',actionContext.context,_args[0]); const resultData:any = xData.service.handleRequestData('',actionContext.context,_args[0]);
Object.assign(context,resultData.context,context); Object.assign(context,resultData.context,context);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册