提交 b36a2cd0 编写于 作者: zhujiamin's avatar zhujiamin

debug 分页导航视图分页跳转时返回应缓存之前tab

上级 ec585bc4
<#-- ctrl document --> <#-- ctrl document -->
<view_${ctrl.getName()} <view_${ctrl.getName()}
:activiedTabViewPanel="activiedTabViewPanel"
:viewState="viewState" :viewState="viewState"
viewName="${view.getName()}" viewName="${view.getName()}"
:viewparams="viewparams" :viewparams="viewparams"
...@@ -14,5 +15,6 @@ ...@@ -14,5 +15,6 @@
@${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)" @${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)"
</#list> </#list>
</#if> </#if>
@closeview="closeView($event)"> @closeview="closeView($event)"
@changepanel="changePanel">
</view_${ctrl.getName()}> </view_${ctrl.getName()}>
\ No newline at end of file
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
* @type {string} * @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
protected activiedTabViewPanel: string = '<#list ctrl.getPSControls() as tabviewpanel><#if tabviewpanel_index==0>${tabviewpanel.name}</#if></#list>'; @Prop({ default: '<#list ctrl.getPSControls() as tabviewpanel><#if tabviewpanel_index==0>${tabviewpanel.name}</#if></#list>' }) protected activiedTabViewPanel?: string;
/** /**
* vue 生命周期 * vue 生命周期
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
if (!this.viewState) { if (!this.viewState) {
return; return;
} }
this.activiedTabViewPanel = $event; this.$emit("changepanel",$event);
this.$nextTick(() => { this.$nextTick(() => {
this.viewState.next({ tag: this.activiedTabViewPanel, action: this.action, data: {}}); this.viewState.next({ tag: this.activiedTabViewPanel, action: this.action, data: {}});
}); });
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag }); this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag; this.viewtag = secondtag;
this.parseViewParam(); this.parseViewParam();
this.getLocalStorage();
<#if created_block??>${created_block}</#if> <#if created_block??>${created_block}</#if>
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
</#ibizinclude> </#ibizinclude>
<#if view.hasPSControl('tabexppanel')> <#if view.hasPSControl('tabexppanel')>
<#assign tabexppanel = view.getPSControl('tabexppanel')> <#assign tabexppanel = view.getPSControl('tabexppanel')>
<#assign dename = tabexppanel.getPSAppDataEntity().getName()>
/** /**
* 被激活的分页面板 * 被激活的分页面板
...@@ -33,7 +34,50 @@ ...@@ -33,7 +34,50 @@
return; return;
} }
this.viewState.next({ tag: '${tabexppanel.name}', action: 'active', data: { activeItem: value } }); this.viewState.next({ tag: '${tabexppanel.name}', action: 'active', data: { activeItem: value } });
this.setLocalStorage();
} }
/**
* 子传父修改激活的Panel
*
* @param {*} $event
* @returns {void}
* @memberof MOBORDERMobTabExpViewBase
*/
protected changePanel(res) : void {
this.activiedTabViewPanel = res;
}
/**
* localStorage存值
*
* @param {*} $event
* @returns {void}
* @memberof MOBORDERMobTabExpViewBase
*/
public setLocalStorage() {
let name:string = ${dename};
let id:string = this.context.${dename};
let obj:any = {"name":name,"id":id,"value":value};
localStorage.setItem('tabKey',JSON.stringify(obj));
}
/**
* localStorage取值
*
* @param {*} $event
* @returns {void}
* @memberof MOBORDERMobTabExpViewBase
*/
public getLocalStorage() {
let info:any = JSON.parse(localStorage.getItem('tabKey'));
if (info.name == ${dename}) {
if (info.id == this.context.${dename}) {
this.activiedTabViewPanel = info.value;
}
} else {
this.activiedTabViewPanel = '<#list tabexppanel.getPSControls() as tabviewpanel><#if tabviewpanel_index==0>${tabviewpanel.name}</#if></#list>';
}
}
</#if> </#if>
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl ../@MACRO/VIEW_CONTENT-BASE.vue.ftl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册