| | |
| | | router, |
| | | store, |
| | | computed: { |
| | | ...mapState(['userInfo', 'homePage','topMenuCurrent','menuData']) |
| | | ...mapState(['userInfo', 'homePage', 'topMenuCurrent', 'menuData']) |
| | | }, |
| | | watch: { |
| | | async userInfo () { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['switchCollapseMenu', 'setCurrentIndex', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']), |
| | | ...mapMutations(['switchCollapseMenu', 'setCurrentIndex', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent', 'cleartagsview']), |
| | | // 初始化本地配置 |
| | | initLocalConfig () { |
| | | // 菜单状态配置 |
| | |
| | | }) |
| | | storeTopMenus.push.apply(storeTopMenus, topList) |
| | | var topCurrent = null |
| | | var tlist =[] |
| | | var tlist = [] |
| | | topList.forEach(item => { |
| | | if (item.linkType === 0 ) { |
| | | if (item.linkType === 0) { |
| | | if (topCurrent == null) { |
| | | topCurrent = item |
| | | } |
| | |
| | | } |
| | | }) |
| | | if (this.$route.query && this.$route.query.menuparams) { |
| | | let menu = topList.filter(item => item.params === this.$route.query.menuparams) |
| | | const menu = topList.filter(item => item.params === this.$route.query.menuparams) |
| | | this.setTopMenuCurrent(menu[0]) |
| | | this.setCurrentIndex(topList.findIndex(obj => obj.params === this.$route.query.menuparams)) |
| | | } else { |
| | |
| | | console.log('menus', this.menuData.list) |
| | | // 添加路由 |
| | | // this.__addRouters(this.menuData.list) |
| | | if(this.topMenuCurrent.homeUrl){ |
| | | await this.$router.push({path: this.topMenuCurrent.homeUrl, query: {}}) |
| | | if (this.topMenuCurrent.homeUrl) { |
| | | await this.$router.push({ path: this.topMenuCurrent.homeUrl, query: {} }) |
| | | } |
| | | }, |
| | | // 新建路由 |