mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-09-16 11:34:55 +08:00
fix: 修复params
传参模式下标签页右键菜单显示不正确的问题
This commit is contained in:
parent
acf15af930
commit
cbb4144ffe
@ -353,7 +353,7 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showMenuModel(route.fullPath, route.query);
|
showMenuModel(route.fullPath, route.query, route.params);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,15 +388,18 @@ function disabledMenus(value: boolean, fixedTag = false) {
|
|||||||
function showMenuModel(
|
function showMenuModel(
|
||||||
currentPath: string,
|
currentPath: string,
|
||||||
query: object = {},
|
query: object = {},
|
||||||
|
params: object = {},
|
||||||
refresh = false
|
refresh = false
|
||||||
) {
|
) {
|
||||||
const allRoute = multiTags.value;
|
const allRoute = multiTags.value;
|
||||||
const routeLength = multiTags.value.length;
|
const routeLength = multiTags.value.length;
|
||||||
let currentIndex = -1;
|
let currentIndex = -1;
|
||||||
if (isAllEmpty(query)) {
|
if (!isAllEmpty(params)) {
|
||||||
currentIndex = allRoute.findIndex(v => v.path === currentPath);
|
currentIndex = allRoute.findIndex(v => isEqual(v.params, params));
|
||||||
} else {
|
} else if (!isAllEmpty(query)) {
|
||||||
currentIndex = allRoute.findIndex(v => isEqual(v.query, query));
|
currentIndex = allRoute.findIndex(v => isEqual(v.query, query));
|
||||||
|
} else {
|
||||||
|
currentIndex = allRoute.findIndex(v => v.path === currentPath);
|
||||||
}
|
}
|
||||||
function fixedTagDisabled() {
|
function fixedTagDisabled() {
|
||||||
if (allRoute[currentIndex]?.meta?.fixedTag) {
|
if (allRoute[currentIndex]?.meta?.fixedTag) {
|
||||||
@ -462,14 +465,17 @@ function openMenu(tag, e) {
|
|||||||
} else if (route.path !== tag.path && route.name !== tag.name) {
|
} else if (route.path !== tag.path && route.name !== tag.name) {
|
||||||
// 右键菜单不匹配当前路由,隐藏刷新
|
// 右键菜单不匹配当前路由,隐藏刷新
|
||||||
tagsViews[0].show = false;
|
tagsViews[0].show = false;
|
||||||
showMenuModel(tag.path, tag.query);
|
showMenuModel(tag.path, tag.query, tag.params);
|
||||||
} else if (multiTags.value.length === 2 && route.path !== tag.path) {
|
} else if (multiTags.value.length === 2 && route.path !== tag.path) {
|
||||||
showMenus(true);
|
showMenus(true);
|
||||||
// 只有两个标签时不显示关闭其他标签页
|
// 只有两个标签时不显示关闭其他标签页
|
||||||
tagsViews[4].show = false;
|
tagsViews[4].show = false;
|
||||||
|
showMenuModel(tag.path, tag.query, tag.params);
|
||||||
} else if (route.path === tag.path) {
|
} else if (route.path === tag.path) {
|
||||||
// 右键当前激活的菜单
|
// 右键当前激活的菜单
|
||||||
showMenuModel(tag.path, tag.query, true);
|
showMenuModel(tag.path, tag.query, tag.params, true);
|
||||||
|
} else {
|
||||||
|
showMenuModel(tag.path, tag.query, tag.params, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentSelect.value = tag;
|
currentSelect.value = tag;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user