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

调整分页视图面板导航参数 --- fix1

上级 fbec24d2
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<#if ctrl.getEmbeddedPSAppDEView()??><#assign embedddevedview = ctrl.getEmbeddedPSAppDEView()> <#if ctrl.getEmbeddedPSAppDEView()??><#assign embedddevedview = ctrl.getEmbeddedPSAppDEView()>
<${srffilepath2(embedddevedview.getCodeName())} <${srffilepath2(embedddevedview.getCodeName())}
class='viewcontainer2' class='viewcontainer2'
:viewdata="JSON.stringify(context)" :viewdata="viewdata"
:viewparam="JSON.stringify(getNavViewParams())" :viewparam="viewparam"
@viewload="viewDatasChange($event)" @viewload="viewDatasChange($event)"
:viewDefaultUsage="false" > :viewDefaultUsage="false" >
</${srffilepath2(embedddevedview.getCodeName())}></#if> </${srffilepath2(embedddevedview.getCodeName())}></#if>
...@@ -61,7 +61,23 @@ ...@@ -61,7 +61,23 @@
* @memberof PickupViewpickupviewpanel * @memberof PickupViewpickupviewpanel
*/ */
public localViewParam: any = <#if ctrl.getPSNavigateParams?? && ctrl.getPSNavigateParams()??><@getNavigateParams ctrl /><#else>null</#if>; public localViewParam: any = <#if ctrl.getPSNavigateParams?? && ctrl.getPSNavigateParams()??><@getNavigateParams ctrl /><#else>null</#if>;
/**
* 传入上下文
*
* @type {string}
* @memberof TabExpViewtabviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 传入视图参数
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/** /**
* 视图面板过滤项 * 视图面板过滤项
* *
...@@ -86,6 +102,7 @@ ...@@ -86,6 +102,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public afterCreated(){ public afterCreated(){
this.initNavParam();
if (this.viewState) { if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => { this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) { if (!Object.is(tag, this.name)) {
...@@ -105,18 +122,24 @@ ...@@ -105,18 +122,24 @@
} }
/** /**
* 传入导航视图参数 * 初始化导航参数
* *
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public getNavViewParams(){ public initNavParam(){
if(Object.is(this.navfilter,"")){ if(!Object.is(this.navfilter,"")){
return this.viewparams; Object.assign(this.viewparams,{[this.navfilter]:this.context['majorentity']})
}else{ }
let tempViewParams:any = JSON.parse(JSON.stringify(this.viewparams)); if(this.localContext && Object.keys(this.localContext).length >0){
Object.assign(tempViewParams,{[this.navfilter]:this.context['${ctrl.getPSAppDataEntity().getCodeName()?lower_case}']}); let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
return tempViewParams; Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
} }
this.viewdata =JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册