修改分模块
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-01-27 10:07:42
|
||||
* @LastEditTime: 2021-03-08 11:59:59
|
||||
* @LastEditors: gtz
|
||||
* @LastEditTime: 2021-12-22 16:06:25
|
||||
* @LastEditors: zwq
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: \mt-bus-fe\src\layout\components\Sidebar\index.vue
|
||||
-->
|
||||
@@ -31,31 +31,17 @@ import { mapGetters } from 'vuex'
|
||||
import Logo from './Logo'
|
||||
import SidebarItem from './SidebarItem'
|
||||
import variables from '@/styles/variables.scss'
|
||||
// import { constantRoutes } from '@/router'
|
||||
import store from '@/store'
|
||||
import { constantRoutes } from '@/router'
|
||||
export default {
|
||||
components: { SidebarItem, Logo },
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'choicepart',
|
||||
'permission_routes',
|
||||
'language'
|
||||
]),
|
||||
partList() {
|
||||
const cangoList = []
|
||||
const constantRoutes = store.getters.permission_routes
|
||||
constantRoutes.map(item => {
|
||||
if (!item.hidden && item.meta) {
|
||||
cangoList.push(item)
|
||||
}
|
||||
})
|
||||
const formatList = cangoList.map((item, index) => {
|
||||
return this.setIndex(item, index)
|
||||
})
|
||||
return formatList
|
||||
},
|
||||
routeList() {
|
||||
return [this.partList[this.choicepart]]
|
||||
return constantRoutes
|
||||
},
|
||||
activeMenu() {
|
||||
const route = this.$route
|
||||
@@ -67,6 +53,7 @@ export default {
|
||||
return path
|
||||
},
|
||||
showLogo() {
|
||||
console.log(this.$route)
|
||||
return this.$store.state.settings.sidebarLogo
|
||||
},
|
||||
variables() {
|
||||
@@ -75,24 +62,6 @@ export default {
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: function(val) {
|
||||
if (val.meta.routeIndex >= 0) {
|
||||
this.$store.dispatch('app/setChoicepart', val.meta.routeIndex)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setIndex(list, index) {
|
||||
list.meta.routeIndex = index
|
||||
if (list.children) {
|
||||
list.children.map(item => {
|
||||
this.setIndex(item, index)
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -45,8 +45,8 @@ export default {
|
||||
return this.$store.state.tagsView.visitedViews
|
||||
},
|
||||
routes() {
|
||||
// return this.$store.state.permission.routes
|
||||
return []
|
||||
return this.$store.state.permission.routes
|
||||
// return []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user