@@ -353,7 +353,7 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
353
353
break ;
354
354
}
355
355
setTimeout (() => {
356
- showMenuModel (route .fullPath , route .query );
356
+ showMenuModel (route .fullPath , route .query , route . params );
357
357
});
358
358
}
359
359
@@ -388,15 +388,18 @@ function disabledMenus(value: boolean, fixedTag = false) {
388
388
function showMenuModel(
389
389
currentPath : string ,
390
390
query : object = {},
391
+ params : object = {},
391
392
refresh = false
392
393
) {
393
394
const allRoute = multiTags .value ;
394
395
const routeLength = multiTags .value .length ;
395
396
let currentIndex = - 1 ;
396
- if (isAllEmpty (query )) {
397
- currentIndex = allRoute .findIndex (v => v . path === currentPath );
398
- } else {
397
+ if (! isAllEmpty (params )) {
398
+ currentIndex = allRoute .findIndex (v => isEqual ( v . params , params ) );
399
+ } else if ( ! isAllEmpty ( query )) {
399
400
currentIndex = allRoute .findIndex (v => isEqual (v .query , query ));
401
+ } else {
402
+ currentIndex = allRoute .findIndex (v => v .path === currentPath );
400
403
}
401
404
function fixedTagDisabled() {
402
405
if (allRoute [currentIndex ]?.meta ?.fixedTag ) {
@@ -462,14 +465,17 @@ function openMenu(tag, e) {
462
465
} else if (route .path !== tag .path && route .name !== tag .name ) {
463
466
// 右键菜单不匹配当前路由,隐藏刷新
464
467
tagsViews [0 ].show = false ;
465
- showMenuModel (tag .path , tag .query );
468
+ showMenuModel (tag .path , tag .query , tag . params );
466
469
} else if (multiTags .value .length === 2 && route .path !== tag .path ) {
467
470
showMenus (true );
468
471
// 只有两个标签时不显示关闭其他标签页
469
472
tagsViews [4 ].show = false ;
473
+ showMenuModel (tag .path , tag .query , tag .params );
470
474
} else if (route .path === tag .path ) {
471
475
// 右键当前激活的菜单
472
- showMenuModel (tag .path , tag .query , true );
476
+ showMenuModel (tag .path , tag .query , tag .params , true );
477
+ } else {
478
+ showMenuModel (tag .path , tag .query , tag .params , true );
473
479
}
474
480
475
481
currentSelect .value = tag ;
0 commit comments