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

全局导航路由模式调整 --- fix2

上级 0e88d48f
......@@ -367,6 +367,13 @@ export default class MDViewEngine extends ViewEngine {
* @memberof MDViewEngine
*/
public MDCtrlLoad(args: any[]) {
let cacheArray:Array<any> = [];
if(args.length >0){
args.forEach((item:any) =>{
cacheArray.push({srfkey:item.srfkey,srfmajortext:item.srfmajortext});
})
}
this.view.initNavData(cacheArray);
if (this.view) {
this.view.$emit('viewload', args);
}
......
......@@ -63,6 +63,7 @@ export interface ServiceState {
}
import { Subject } from 'rxjs';
/**
* 导航数据服务
*
......@@ -81,6 +82,15 @@ export default class NavDataService {
*/
private static navDataService: NavDataService;
/**
* 缓存对象
*
* @private
* @type {(any)}
* @memberof NavDataService
*/
private store: any;
/**
* 服务状态
*
......@@ -119,10 +129,11 @@ export default class NavDataService {
* @returns {NavDataService}
* @memberof NavDataService
*/
public static getInstance(): NavDataService {
public static getInstance(store: any): NavDataService {
if (!NavDataService.navDataService) {
NavDataService.navDataService = new NavDataService();
}
this.navDataService.store = store;
return this.navDataService;
}
......@@ -246,6 +257,15 @@ export default class NavDataService {
* @memberof NavDataService
*/
public getNavData(){
return this.navDataStack;
if(this.navDataStack && this.navDataStack.length >0){
this.navDataStack.forEach((item:any,index) =>{
if(item && item.data && this.navDataStack[index+1]){
this.navDataStack[index+1] = Object.assign(this.navDataStack[index+1],{isselected:true});
}
})
return this.navDataStack;
}else{
return [];
}
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册