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

调整激活路由路由跳转逻辑

上级 de484686
...@@ -63,7 +63,7 @@ export class ViewTool { ...@@ -63,7 +63,7 @@ export class ViewTool {
public static buildUpRoutePath(route: Route, viewParam: any = {}, deResParameters: any[], parameters: any[], args: any[], data: any): string { public static buildUpRoutePath(route: Route, viewParam: any = {}, deResParameters: any[], parameters: any[], args: any[], data: any): string {
const indexRoutePath = this.getIndexRoutePath(route); const indexRoutePath = this.getIndexRoutePath(route);
const deResRoutePath = this.getDeResRoutePath(viewParam, deResParameters, args); const deResRoutePath = this.getDeResRoutePath(viewParam, deResParameters, args);
const deRoutePath = this.getActiveRoutePath(parameters, args, data); const deRoutePath = this.getActiveRoutePath(parameters, args, data,viewParam);
return `${indexRoutePath}${deResRoutePath}${deRoutePath}`; return `${indexRoutePath}${deResRoutePath}${deRoutePath}`;
} }
...@@ -123,7 +123,7 @@ export class ViewTool { ...@@ -123,7 +123,7 @@ export class ViewTool {
* @returns {string} * @returns {string}
* @memberof ViewTool * @memberof ViewTool
*/ */
public static getActiveRoutePath(parameters: any[], args: any[], data: any): string { public static getActiveRoutePath(parameters: any[], args: any[], data: any,viewParam: any = {}): string {
let routePath: string = ''; let routePath: string = '';
// 不存在应用实体 // 不存在应用实体
if(parameters && parameters.length >0){ if(parameters && parameters.length >0){
...@@ -137,8 +137,7 @@ export class ViewTool { ...@@ -137,8 +137,7 @@ export class ViewTool {
let [arg] = args; let [arg] = args;
arg = arg ? arg : {}; arg = arg ? arg : {};
const [{ pathName: _pathName, parameterName: _parameterName }, { pathName: _pathName2, parameterName: _parameterName2 }] = parameters; const [{ pathName: _pathName, parameterName: _parameterName }, { pathName: _pathName2, parameterName: _parameterName2 }] = parameters;
const _value: any = arg[_parameterName] && !Object.is(arg[_parameterName], '') ? const _value: any = arg[_parameterName] || viewParam[_parameterName] || null;
arg[_parameterName] : null;
routePath = `/${_pathName}/${_value}/${_pathName2}`; routePath = `/${_pathName}/${_value}/${_pathName2}`;
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`; routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册