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

修复数据关系分页部件导航参数 --- fix1

上级 77bcd3e8
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
ref='${ctrl.name}' ref='${ctrl.name}'
:viewparams="viewparams" :viewparams="viewparams"
:context="context" :context="context"
:formData="formData"
<#if ctrl.getPSAppDataEntity()??>parentName = "${ctrl.getPSAppDataEntity().getCodeName()}"</#if> <#if ctrl.getPSAppDataEntity()??>parentName = "${ctrl.getPSAppDataEntity().getCodeName()}"</#if>
<#if view.getViewType() == 'DEEDITVIEW4'> <#if view.getViewType() == 'DEEDITVIEW4'>
:isShowSlot="false" :isShowSlot="false"
......
...@@ -49,6 +49,14 @@ ...@@ -49,6 +49,14 @@
*/ */
@Prop() public parentName!: string; @Prop() public parentName!: string;
/**
* 表单数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public formData!:any;
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -114,7 +122,7 @@ ...@@ -114,7 +122,7 @@
<#if ctrl.getPSDEDRCtrlItems?? && ctrl.getPSDEDRCtrlItems()??> <#if ctrl.getPSDEDRCtrlItems?? && ctrl.getPSDEDRCtrlItems()??>
<#list ctrl.getPSDEDRCtrlItems() as appdeDrCtrlItem> <#list ctrl.getPSDEDRCtrlItems() as appdeDrCtrlItem>
{ {
id:${appdeDrCtrlItem.getName()?lower_case}, id:'${appdeDrCtrlItem.getName()?lower_case}',
localContext:<#if appdeDrCtrlItem.getPSNavigateContexts?? && appdeDrCtrlItem.getPSNavigateContexts()??><@getNavigateContext appdeDrCtrlItem /><#else>null</#if>, localContext:<#if appdeDrCtrlItem.getPSNavigateContexts?? && appdeDrCtrlItem.getPSNavigateContexts()??><@getNavigateContext appdeDrCtrlItem /><#else>null</#if>,
localViewParam:<#if appdeDrCtrlItem.getPSNavigateParams?? && appdeDrCtrlItem.getPSNavigateParams()??><@getNavigateParams appdeDrCtrlItem /><#else>null</#if> localViewParam:<#if appdeDrCtrlItem.getPSNavigateParams?? && appdeDrCtrlItem.getPSNavigateParams()??><@getNavigateParams appdeDrCtrlItem /><#else>null</#if>
}<#if appdeDrCtrlItem_has_next>,</#if> }<#if appdeDrCtrlItem_has_next>,</#if>
...@@ -235,6 +243,36 @@ ...@@ -235,6 +243,36 @@
return null; return null;
} }
/**
* 初始化导航参数
*
* @param {*} drItem
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public initNavParam(drItem:any){
let returnNavParam:any = {};
if(drItem && drItem.id){
let curDRItem:any = this.navParamsArray.find((item:any) =>{
return Object.is(item.id,drItem.id);
})
if(curDRItem){
let localContext:any = curDRItem.localContext;
let localViewParam:any = curDRItem.localViewParam;
if(localContext && Object.keys(localContext).length >0){
let _context:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localContext);
returnNavParam.localContext = _context;
}
if(localViewParam && Object.keys(localViewParam).length >0){
let _params:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localViewParam);
returnNavParam.localViewParam = _params;
}
return returnNavParam;
}else{
return null;
}
}
}
/** /**
* 选中节点 * 选中节点
* *
...@@ -247,12 +285,18 @@ ...@@ -247,12 +285,18 @@
return; return;
} }
this.$emit('selectionchange', [item]); this.$emit('selectionchange', [item]);
let localNavParam:any = this.initNavParam(item);
const refview = this.getDRTabItem({ nodetype: item.id }); const refview = this.getDRTabItem({ nodetype: item.id });
this.selection = {}; this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) }; const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
if(localNavParam && localNavParam.localContext){
Object.assign(_context,localNavParam.localContext);
}
Object.assign(_context,{srfparentdename:this.parentName,srfparentkey:_context[this.parentName.toLowerCase()]}); Object.assign(_context,{srfparentdename:this.parentName,srfparentkey:_context[this.parentName.toLowerCase()]});
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) }; const _params: any = {};
if(localNavParam && localNavParam.localViewParam){
Object.assign(_params,localNavParam.localViewParam);
}
if (refview && refview.parentdatajo) { if (refview && refview.parentdatajo) {
Object.assign(_context, refview.parentdatajo); Object.assign(_context, refview.parentdatajo);
Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params }); Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params });
......
...@@ -18,6 +18,14 @@ ...@@ -18,6 +18,14 @@
*/ */
public selection: any = {}; public selection: any = {};
/**
* 表单数据
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public formData:any = {};
<#ibizinclude> <#ibizinclude>
./VIEW_BOTTOM-BASE.vue.ftl ./VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册