| | |
| | | import databaseMonitoring from '@/views/maintenance/databaseMonitoring.vue'; //数据库监控 |
| | | import systemMonitoring from '@/views/maintenance/systemMonitoring.vue'; //系统监控 |
| | | import parameterConfiguration from '@/views/maintenance/parameterConfiguration.vue'; //系统配置 |
| | | import { selectMenuRecursive, queryMenuTree } from '../../api/api'; |
| | | import { selectMenuRecursive, queryMenuTree, getPerms } from '../../api/api'; |
| | | import customElMenu from '../../components/customElMenu.vue'; |
| | | export default { |
| | | components: { |
| | |
| | | formLabelWidth: '70px', |
| | | }; |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | created() { |
| | | this.getTreeData(); |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | async getCookies() { |
| | | var boolean = this.getTimeCookies(); |
| | | if (boolean != true) { |
| | | this.$router.push('/login'); |
| | | return; |
| | | } |
| | | if (this.$store.state.permsEntity.length == 0) { |
| | | const data = await getPerms(); |
| | | this.$store.state.permsEntity = data.result; |
| | | } |
| | | var store = this.menuList[0]; |
| | | this.setViewController(store); |
| | | }, |
| | | getTimeCookies() { |
| | | var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time); |
| | | var time2 = new Date(); |
| | | if (time2 > time1) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | //获取树 |
| | | async getTreeData() { |
| | | const data = await queryMenuTree(); |
| | |
| | | return value.type == 1; |
| | | }); |
| | | this.menuList = this.treeData(menuList); |
| | | this.setViewController(this.menuList[0]); |
| | | this.getCookies(); |
| | | // |
| | | } else { |
| | | alert('暂无菜单栏数据'); |
| | | } |
| | |
| | | // this.treeList = this.treeData(data.result); |
| | | }, |
| | | setViewController(res) { |
| | | if (res == null) { |
| | | return; |
| | | } |
| | | if (res.children != null) { |
| | | this.setViewController(res.children[0]); |
| | | } else { |
| | |
| | | }, |
| | | |
| | | handleselect(index, indexPath, e) { |
| | | this.getTimeCookies(); |
| | | var data = e.$attrs.perms; |
| | | this.$store.state.currentPerms = data.perms; |
| | | var index = data.url; |