mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage
This commit is contained in:
@@ -335,6 +335,19 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
let openpages = store.state.openpages;
|
let openpages = store.state.openpages;
|
||||||
|
if (openpages.length === 0) {
|
||||||
|
let pagename = state.keysList.filter((a) => {
|
||||||
|
return a.href === n.toLowerCase();
|
||||||
|
});
|
||||||
|
if (pagename && pagename.length !== 0) {
|
||||||
|
let obj = {
|
||||||
|
pagename: pagename[0].pagename,
|
||||||
|
href: n.toLowerCase(),
|
||||||
|
active: true,
|
||||||
|
};
|
||||||
|
openpages.push(obj);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
for (let i = 0; i < openpages.length; i++) {
|
for (let i = 0; i < openpages.length; i++) {
|
||||||
openpages[i].active = false;
|
openpages[i].active = false;
|
||||||
}
|
}
|
||||||
@@ -360,6 +373,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
localStorage.setItem("openpages", JSON.stringify(openpages));
|
localStorage.setItem("openpages", JSON.stringify(openpages));
|
||||||
store.commit("chengeOpenpages", openpages);
|
store.commit("chengeOpenpages", openpages);
|
||||||
|
|
||||||
|
|||||||
@@ -44,16 +44,19 @@ export default {
|
|||||||
state.openList.map((item, key) => {
|
state.openList.map((item, key) => {
|
||||||
if (item.href === value.href) {
|
if (item.href === value.href) {
|
||||||
if (state.openList.length === 1) {
|
if (state.openList.length === 1) {
|
||||||
state.openList.splice(key, 1);
|
if (state.openList[0].href !== "/learningpath") {
|
||||||
$router.push({ path: "/learningpath" });
|
|
||||||
} else {
|
|
||||||
if (key === state.openList.length - 1) {
|
|
||||||
$router.push({ path: state.openList[key - 1].href });
|
|
||||||
state.openList.splice(key, 1);
|
|
||||||
} else {
|
|
||||||
$router.push({ path: state.openList[key + 1].href });
|
|
||||||
state.openList.splice(key, 1);
|
state.openList.splice(key, 1);
|
||||||
}
|
}
|
||||||
|
$router.push({ path: "/learningpath" });
|
||||||
|
} else {
|
||||||
|
if (value.active) {
|
||||||
|
if (key === state.openList.length - 1) {
|
||||||
|
$router.push({ path: state.openList[key - 1].href });
|
||||||
|
} else {
|
||||||
|
$router.push({ path: state.openList[key + 1].href });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state.openList.splice(key, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user