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

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

上级 ec585bc4
<#-- ctrl document -->
<view_${ctrl.getName()}
<view_${ctrl.getName()}
:activiedTabViewPanel="activiedTabViewPanel"
:viewState="viewState"
viewName="${view.getName()}"
:viewparams="viewparams"
......@@ -14,5 +15,6 @@
@${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)"
</#list>
</#if>
@closeview="closeView($event)">
@closeview="closeView($event)"
@changepanel="changePanel">
</view_${ctrl.getName()}>
\ No newline at end of file
......@@ -41,7 +41,7 @@
* @type {string}
* @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 生命周期
......@@ -113,7 +113,7 @@
if (!this.viewState) {
return;
}
this.activiedTabViewPanel = $event;
this.$emit("changepanel",$event);
this.$nextTick(() => {
this.viewState.next({ tag: this.activiedTabViewPanel, action: this.action, data: {}});
});
......
......@@ -79,6 +79,7 @@
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
this.getLocalStorage();
<#if created_block??>${created_block}</#if>
}
......
......@@ -7,6 +7,7 @@
</#ibizinclude>
<#if view.hasPSControl('tabexppanel')>
<#assign tabexppanel = view.getPSControl('tabexppanel')>
<#assign dename = tabexppanel.getPSAppDataEntity().getName()>
/**
* 被激活的分页面板
......@@ -33,7 +34,50 @@
return;
}
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>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册