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

全局导航服务 --- fix4

上级 81df0447
...@@ -35,6 +35,13 @@ export interface NavDataElement { ...@@ -35,6 +35,13 @@ export interface NavDataElement {
*/ */
data:any; data:any;
/**
* 视图路径
*
* @memberof NavDataElement
*/
path:string;
} }
/** /**
...@@ -205,4 +212,13 @@ export default class NavDataService { ...@@ -205,4 +212,13 @@ export default class NavDataService {
this.navDataStack = []; this.navDataStack = [];
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack)); this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
} }
/**
* 从导航数据栈中获取数据
*
* @memberof NavDataService
*/
public getNavData(){
return this.navDataStack;
}
} }
\ No newline at end of file
...@@ -99,6 +99,7 @@ export class ViewTool { ...@@ -99,6 +99,7 @@ export class ViewTool {
let routePath: string = ''; let routePath: string = '';
let [arg] = args; let [arg] = args;
arg = arg ? arg : {}; arg = arg ? arg : {};
if(deResParameters && deResParameters.length >0){
deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => { deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
let value:any = null; let value:any = null;
if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) { if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) {
...@@ -108,6 +109,7 @@ export class ViewTool { ...@@ -108,6 +109,7 @@ export class ViewTool {
} }
routePath = `${routePath}/${pathName}/${value}`; routePath = `${routePath}/${pathName}/${value}`;
}); });
}
return routePath; return routePath;
} }
...@@ -124,6 +126,7 @@ export class ViewTool { ...@@ -124,6 +126,7 @@ export class ViewTool {
public static getActiveRoutePath(parameters: any[], args: any[], data: any): string { public static getActiveRoutePath(parameters: any[], args: any[], data: any): string {
let routePath: string = ''; let routePath: string = '';
// 不存在应用实体 // 不存在应用实体
if(parameters && parameters.length >0){
if (parameters.length === 1) { if (parameters.length === 1) {
const [{ pathName, parameterName }] = parameters; const [{ pathName, parameterName }] = parameters;
routePath = `/${pathName}`; routePath = `/${pathName}`;
...@@ -141,6 +144,7 @@ export class ViewTool { ...@@ -141,6 +144,7 @@ export class ViewTool {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`; routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
} }
} }
}
return routePath; return routePath;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册