diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 81bb40819..315c6a390 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -10,7 +10,7 @@
active-text-color="#ffd04b"
>
-
+
@@ -25,7 +25,6 @@
-
-
+
{{ $t(item.meta.i18n) }}
-
+
{{ $t(child.meta.i18n) }}
@@ -106,6 +105,7 @@ export default {
if (val.path === '/orderauthor/rules/manage') {
this.$refs.keMenu.activeIndex = val.path;
}
+ this.refreshRoute(val);
}
},
mounted() {
@@ -119,6 +119,20 @@ export default {
}
},
methods: {
+ // 刷新路由
+ refreshRoute(val) {
+ let routePath = '';
+ if (val.path.indexOf('design/userlist') >= 0) {
+ routePath = '/design/userlist/home';
+ } else if (val.path.includes('design/lesson') || val.path.includes('design/script') || val.path.includes('design/runPlan') || val.path.includes('design/mapPreview')) {
+ routePath = '/design/home';
+ } else {
+ routePath = this.$route.path;
+ }
+ setTimeout(() => { // 路由跳转
+ this.$refs.keMenu.activeIndex = routePath;
+ }, 100);
+ },
toggleSideBar() {
this.$store.dispatch('ToggleSideBar');
},
@@ -133,9 +147,7 @@ export default {
},
hasOneScreenShowingChildren(children) {
const showingChildren = children.filter(item => {
- if (!item.hidden && item.target) {
- return item;
- }
+ if (!item.hidden && item.target) { return item; }
});
if (showingChildren.length === 1) {
return true;