|
@@ -80,13 +80,13 @@ export default {
|
|
|
logo: require('@/assets/images/logo/logo.png'),
|
|
logo: require('@/assets/images/logo/logo.png'),
|
|
|
sideMenuTabIndex: 0,
|
|
sideMenuTabIndex: 0,
|
|
|
sideMenuTabList: [
|
|
sideMenuTabList: [
|
|
|
- { name: '数字全景', icon: 'el-icon-s-platform', path: '/' },
|
|
|
|
|
- { name: '监测预警', icon: 'icon-common_saving', path: '/' },
|
|
|
|
|
- { name: '安全流程化', icon: 'icon-common_safety', path: '/' },
|
|
|
|
|
- { name: '双重预防', icon: 'icon-common_quality', path: '/' },
|
|
|
|
|
- { name: '作业票', icon: 'icon-common_satisfaction', path: '/' },
|
|
|
|
|
- { name: '安全培训', icon: 'icon-common_quality', path: '/' },
|
|
|
|
|
- { name: '系统管理', icon: 'icon-common_saving', path: '/' }
|
|
|
|
|
|
|
+ { name: '数字全景', icon: 'el-icon-s-platform', path: '/', permit: 'system_platform' },
|
|
|
|
|
+ { name: '监测预警', icon: 'icon-common_saving', path: '/', permit: 'system_platform' },
|
|
|
|
|
+ { name: '安全流程化', icon: 'icon-common_safety', path: '/', permit: 'system_platform' },
|
|
|
|
|
+ { name: '双重预防', icon: 'icon-common_quality', path: '/', permit: 'system_platform' },
|
|
|
|
|
+ { name: '作业票', icon: 'icon-common_satisfaction', path: '/', permit: 'system_platform' },
|
|
|
|
|
+ { name: '安全培训', icon: 'icon-common_quality', path: '/', permit: 'system_platform' },
|
|
|
|
|
+ { name: '系统管理', icon: 'icon-common_saving', path: '/', permit: 'system_platform' }
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -97,7 +97,8 @@ export default {
|
|
|
'avatar',
|
|
'avatar',
|
|
|
'userData',
|
|
'userData',
|
|
|
'permission_routes',
|
|
'permission_routes',
|
|
|
- 'menuSiderTab'
|
|
|
|
|
|
|
+ 'menuSiderTab',
|
|
|
|
|
+ 'permits'
|
|
|
])
|
|
])
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -108,13 +109,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getUnReadMsg()
|
|
this.getUnReadMsg()
|
|
|
- let index = 0
|
|
|
|
|
- if (this.isNotNull(localStorage.getItem('tabIndex'))) {
|
|
|
|
|
- index = parseFloat(localStorage.getItem('tabIndex'))
|
|
|
|
|
- }
|
|
|
|
|
- this.sideTabChange(index, {
|
|
|
|
|
- path: this.$route.fullPath
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.initSideMenu()
|
|
|
|
|
+ this.initsideTab()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getUnReadMsg() {
|
|
getUnReadMsg() {
|
|
@@ -122,6 +118,22 @@ export default {
|
|
|
this.unReadCount = resp.data
|
|
this.unReadCount = resp.data
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ initSideMenu() {
|
|
|
|
|
+ const permits = JSON.parse(JSON.stringify(this.permits))
|
|
|
|
|
+ let sideMenuTabList = JSON.parse(JSON.stringify(this.sideMenuTabList))
|
|
|
|
|
+ sideMenuTabList = sideMenuTabList.filter(item => permits.includes(item.permit))
|
|
|
|
|
+ this.sideMenuTabList = sideMenuTabList
|
|
|
|
|
+ console.log({ sideMenuTabList, permits })
|
|
|
|
|
+ },
|
|
|
|
|
+ initsideTab() {
|
|
|
|
|
+ let index = 0
|
|
|
|
|
+ if (this.isNotNull(localStorage.getItem('tabIndex'))) {
|
|
|
|
|
+ index = parseFloat(localStorage.getItem('tabIndex'))
|
|
|
|
|
+ }
|
|
|
|
|
+ this.sideTabChange(index, {
|
|
|
|
|
+ path: this.$route.fullPath
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
toggleSideBar() {
|
|
toggleSideBar() {
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
},
|
|
},
|