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

调整

上级 680e4c73
......@@ -26,7 +26,7 @@ import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.navDataService.addNavDataByOnly({id:'${srffilepath2(view.getCodeName())}',tag:vm.viewtag,srfkey:<#if appde??>vm.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:vm.$t(vm.model.srfTitle),data:null,context:vm.context,viewparams:vm.viewparams,path:vm.$route.fullPath});
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
......
......@@ -86,6 +86,14 @@
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewCacheData:any;
/**
* 解析视图参数
*
......@@ -139,7 +147,7 @@
</#if>
this.handleCustomViewData();
//初始化导航数据
this.initNavData();
this.initNavDataWithRoute();
}
/**
......@@ -222,15 +230,24 @@
}
/**
* 初始化导航数据
* 初始化导航数据(路由模式)
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public initNavData(data:any = null){
if(this.viewDefaultUsage){
if(Object.is(this.navModel,"route")){
this.navDataService.addNavData({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
public initNavDataWithRoute(data:any = null){
if(this.viewDefaultUsage && Object.is(this.navModel,"route")){
this.navDataService.addNavData({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public initNavDataWithTab(data:any = null){
if(this.viewDefaultUsage && !Object.is(this.navModel,"route")){
this.navDataService.addNavDataByOnly({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册