|
@@ -101,9 +101,10 @@ watch(
|
|
|
let _path = tabsParams.path.replace(key, "/detail?");
|
|
|
// 使用路由参数的地址,忽略查询参数后,查找相同地址
|
|
|
let _path2 = tabsParams.path.replace("/edit/", "/detail/");
|
|
|
+ let hasPath2 = route.fullPath.indexOf("/edit/") > -1;
|
|
|
let tabsMenuList = tabStore.tabsMenuList;
|
|
|
for (let i = 0; i < tabsMenuList.length; i++) {
|
|
|
- if (tabsMenuList[i].path == _path || tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0]) {
|
|
|
+ if (tabsMenuList[i].path == _path || (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])) {
|
|
|
name = tabsMenuList[i].name;
|
|
|
tabsMenuList[i] = tabsParams;
|
|
|
isReplace = true;
|
|
@@ -118,9 +119,10 @@ watch(
|
|
|
let _path = tabsParams.path.replace(key, "/edit?");
|
|
|
// 使用路由参数的地址,忽略查询参数后,查找相同地址
|
|
|
let _path2 = tabsParams.path.replace("/detail/", "/edit/");
|
|
|
+ let hasPath2 = route.fullPath.indexOf("/detail/") > -1;
|
|
|
let tabsMenuList = tabStore.tabsMenuList;
|
|
|
for (let i = 0; i < tabsMenuList.length; i++) {
|
|
|
- if (tabsMenuList[i].path == _path || tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0]) {
|
|
|
+ if (tabsMenuList[i].path == _path || (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])) {
|
|
|
tabsMenuList[i] = tabsParams;
|
|
|
isReplace = true;
|
|
|
break;
|