diff --git a/src/assets/menu/channel.svg b/src/assets/menu/channel.svg new file mode 100644 index 0000000..725e51a --- /dev/null +++ b/src/assets/menu/channel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/SetLeftMenu.vue b/src/components/SetLeftMenu.vue index c7ddb5e..5b20f10 100644 --- a/src/components/SetLeftMenu.vue +++ b/src/components/SetLeftMenu.vue @@ -151,25 +151,34 @@ export default { let path = item.path; if (!path) { this.curIndex = index; - return + return; } if (this.$route.path != path) { - this.curIndex = index + this.curIndex = index; this.scrollLock = false; - this.handleScroll() + this.handleScroll(); + + // 携带当前所有参数跳转 + this.$router.push({ + path: path, + query: { ...this.$route.query }, // 携带所有查询参数 + params: { ...this.$route.params } // 携带所有路由参数 + }); + // 重置页面滚动高度 - const dom = document.getElementById('main-content') - dom.scrollTop = 0; - this.$router.push(path) + const dom = document.getElementById('main-content'); + if (dom) dom.scrollTop = 0; } }, - activeArea(type) { - console.log(type); - }, + setActiveCur(dom, item) { - debugger if (this.$route.path !== item.path) { - this.$router.push(item.path); + // 携带当前所有参数跳转 + this.$router.push({ + path: item.path, + query: { ...this.$route.query }, // 携带所有查询参数 + params: { ...this.$route.params } // 携带所有路由参数 + }); store.commit('SET_PAGETITLE', item.name); } diff --git a/src/store/index.js b/src/store/index.js index 208fceb..ca63c68 100755 --- a/src/store/index.js +++ b/src/store/index.js @@ -106,13 +106,9 @@ export default new Vuex.Store({ index: '2', title: '订单列表', icon: 'orderList', - children: [{ - index: '2-1', - title: '站点列表', - path: '/agent/siteList' - }, + children: [ { - index: '2-2', + index: '2-1', title: 'ui页面', path: '/ui' } @@ -120,12 +116,12 @@ export default new Vuex.Store({ }, { index: '3', - title: '父级菜单2', - icon: 'Totalprofit', + title: '销售渠道', + icon: 'channel', children: [{ index: '3-1', - title: '子级菜单3-1', - path: '/about' + title: '站点列表', + path: '/agent/siteList' }, { index: '3-2', @@ -139,7 +135,7 @@ export default new Vuex.Store({ title: '财务', icon: 'Totalprofit', children: [{ - index: '3-1', + index: '4-1', title: '收款方式', path: '/agent/payList' },