This commit is contained in:
Jerry
2020-04-20 20:51:17 +08:00
parent 9472a84ba1
commit 7d87893112
7 changed files with 44 additions and 16 deletions

View File

@@ -23,6 +23,12 @@ import { mapGetters, mapMutations } from 'vuex';
import projectConfig from '@/core/config';
export default {
props: {
multiTag: {
type: Boolean,
default: false
}
},
data () {
return {
isCollapse: false,
@@ -60,9 +66,13 @@ export default {
},
selectMenu (index, path) {
if (this.getCurrentMenuId === index) return;
// <20><>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>tags<67><73>cachePage
if (!this.multiTag) {
this.clearAllTags();
}
this.setCurrentMenuId(index);
},
...mapMutations(['setCollapse', 'clearCachePage', 'setCurrentMenuId'])
...mapMutations(['setCollapse', 'clearAllTags', 'setCurrentMenuId'])
}
};
</script>

View File

@@ -1,7 +1,7 @@
<template>
<el-container :style="getMainStyle">
<el-aside width='200px' class="sidebar">
<side-bar style="overflow: hidden"></side-bar>
<side-bar style="overflow: hidden" :multi-tag="false"></side-bar>
</el-aside>
<el-container style="background-color: rgb(235,235,235)">
<el-header class="header">
@@ -76,11 +76,12 @@ export default {
}
SystemController.logout(this, {}, options).catch(e => {});
this.clearAllTags();
this.$router.replace({name: 'login'});
}).catch(e => {});
}
},
...mapMutations(['setClientHeight'])
...mapMutations(['setClientHeight', 'clearAllTags'])
},
computed: {
getMainStyle () {
@@ -112,9 +113,11 @@ export default {
getMenuItem: {
handler (newValue) {
if (newValue == null) {
this.$router.replace({
name: 'welcome'
});
if (this.$route.name !== 'welcome') {
this.$router.replace({
name: 'welcome'
});
}
} else {
this.$router.replace({
name: newValue.formRouterName