From 8204086f1e03b85578815f535617651c223a1229 Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Thu, 26 Jun 2025 11:07:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=A7=E8=BE=B9=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E8=B7=B3=E8=BD=AC=E6=90=BA=E5=B8=A6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/menu/channel.svg | 1 + src/components/SetLeftMenu.vue | 31 ++++++++++++++++++++----------- src/store/index.js | 18 +++++++----------- 3 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 src/assets/menu/channel.svg 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' },