| | |
| | | changeSelectStyle: null, |
| | | changeliSelect: null, |
| | | changeSelectdiv: false, |
| | | listMenu: [ |
| | | { |
| | | cnName: '数据质检', |
| | | css: 'm1', |
| | | checkClass: 'm11', |
| | | url: '', |
| | | }, |
| | | { |
| | | cnName: '数据交换', |
| | | css: 'm2', |
| | | checkClass: 'm21', |
| | | url: '', |
| | | }, |
| | | { |
| | | cnName: '服务管理', |
| | | css: 'm4', |
| | | checkClass: 'm41', |
| | | url: '', |
| | | }, |
| | | ], |
| | | listMenu: [], |
| | | showFlag: null, |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | //主题切换 |
| | | setThemeColors() { }, |
| | | closeAllChildren() { |
| | | for (var i in this.listMenu) { |
| | | let newItem = this.listMenu[i]; |
| | | newItem.show = false; |
| | | Vue.set(this.listMenu, i, newItem); |
| | | } |
| | | }, |
| | | //鼠标移入菜单事件 |
| | | setMenuMove(index, item) { |
| | | var that = this; |
| | | |
| | | this.closeAllChildren(); |
| | | if (item.perms != null) { |
| | | this.$router.push(item.url); |
| | | if (this.showFlag != null) { |
| | |
| | | this.setShowFalseDiv(true); |
| | | } else { |
| | | let newItem = this.listMenu[index]; |
| | | newItem.show = !this.listMenu[index].show; |
| | | newItem.show = !newItem.show; |
| | | Vue.set(this.listMenu, index, newItem); |
| | | } |
| | | } |
| | |
| | | Vue.set(this.listMenu, index, newItem); |
| | | }, |
| | | setLiClick(res) { |
| | | this.setShowFalseDiv(false); |
| | | this.changeliSelect = res.cnName; |
| | | this.$router.push(res.url); |
| | | this.$store.commit('currentPerms', res.perms); |
| | | if (res.url.indexOf('http') != -1) { |
| | | if (this.$store.reporturl == null) { |
| | | this.$store.reporturl = res.url; |
| | | this.$router.push('/WareInspection'); |
| | | } else { |
| | | this.$bus.$emit('changeNaveUrl', res.url); |
| | | } |
| | | } else { |
| | | this.$store.reporturl = null; |
| | | this.$router.push(res.url); |
| | | this.$store.commit('currentPerms', res.perms); |
| | | } |
| | | this.closeAllChildren(); |
| | | }, |
| | | async getMenuTree() { |
| | | this.getCookies(); |
| | |
| | | } |
| | | }, |
| | | async setMenuTree(res) { |
| | | |
| | | for (var i in res) { |
| | | res[i].checkClass = res[i].css + '1'; |
| | | res[i].show = false; //控制显隐 |
| | |
| | | }); |
| | | this.listMenu.push(res[i]); |
| | | this.changeSelectStyle = this.listMenu.length - 1; |
| | | var strartMneu = res[i].children[0]; |
| | | this.$store.commit('currentPerms', strartMneu.perms); |
| | | this.changeliSelect = strartMneu.cnName; |
| | | this.$bus.$emit('currentPerms', strartMneu.perms); |
| | | // var strartMneu = res[i].children[0]; |
| | | // this.$store.commit('currentPerms', strartMneu.perms); |
| | | // this.changeliSelect = strartMneu.cnName; |
| | | // this.$bus.$emit('currentPerms', strartMneu.perms); |
| | | } else { |
| | | this.listMenu.push(res[i]); |
| | | } |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | this.$store.reporturl=null; |
| | | let str = this.$route.path; |
| | | if (str[0] == '/') { |
| | | this.activeIndex = str.slice(1); |