From c946e581f213aa630559bd098e11380513c5df7e Mon Sep 17 00:00:00 2001 From: kevin jiang Date: Thu, 30 Apr 2020 10:53:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=AE=A1=E7=90=86-=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=AE=A1=E7=90=86=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E6=95=B0=E5=AD=97=E8=B0=83=E6=95=B4=E5=88=B0=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E5=BA=94=E9=80=89=E4=B8=AD=E8=B4=A6=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=80=8C=E4=B8=8D=E6=98=AF=E8=A7=92=E8=89=B2=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home.vue | 89 +++++++++++----------------------- src/pages/user/RoleManager.vue | 4 +- 2 files changed, 30 insertions(+), 63 deletions(-) diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 5cdaff5..35fa918 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -17,7 +17,6 @@ @@ -43,7 +42,7 @@ {{selectedSubMenu}} -
+
@@ -68,7 +67,7 @@ mainUrl: "/customer/view", isCollapsed: false, mHeight: 600, - selectedItemName: null, + selectedItemName: "", openName: [], selectedMenu: '', selectedSubMenu: '', @@ -88,32 +87,32 @@ }, mounted() { let that = this; - this.bus.$on('callBack', function () { - that.callBack(); - }) - this.bus.$on('setHeader', function (data) { - that.setHeader(data); + this.bus.$on('callBack', function (item) { + that.callBack(item); }) + // this.bus.$on('setHeader', function (data) { + // that.setHeader(data); + // }) }, created() { - this.mHeight = window.screen.availHeight - 22; + // this.mHeight = window.screen.availHeight - 22; //获取导航栏权限 this.listOnePermission(this.onePermissionLevel); }, computed: { - rotateIcon() { - return [ - 'menu-icon', - this.isCollapsed ? 'rotate-icon' : '' - ]; - }, - menuitemClasses() { - return [ - 'menu-item', - this.isCollapsed ? 'collapsed-menu' : '' - ] + + }, + watch: { + 'selectedItemName' (val) { + console.log(val); + let that = this; + // that.openName = [that.onePermissionList[2]]; + this.$nextTick(() => { + that.$refs.menu.updateActiveName(); + }); } + }, methods: { onSelectLister(val) { @@ -134,6 +133,7 @@ this.selectedSubMenu = ""; this.breadcrumbUrl = this.mainUrl; } + for (let i = 0; i < this.onePermissionList.length; i++) { let item = this.onePermissionList[i]; for (let k = 0; k < item.subMenuList.length; k++) { @@ -141,6 +141,7 @@ if (cItem.id === val) { this.selectedMenu = item.name; this.selectedSubMenu = cItem.name; + this.selectedItemName = cItem.id; this.breadcrumbUrl = cItem.resource; } } @@ -266,29 +267,25 @@ }else{ that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; that.openName = [that.onePermissionList[0].id]; - this.$nextTick(() => { - this.$refs.menu.updateOpened(); - this.$refs.menu.updateActiveName(); - }); + this.selectedMenu = this.onePermissionList[0].name; this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name; sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList)); + // this.$nextTick(() => { + // this.$refs.menu.updateOpened(); + // this.$refs.menu.updateActiveName(); + // }); this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource}); } }, //账户管理页面回调方法 - callBack() { + callBack(item) { let that = this; - debugger this.selectedMenu = "设置管理"; this.selectedSubMenu = "账户管理"; this.selectedItemName = this.onePermissionList[2].subMenuList[0].id; - - // this.$router.push({path: '/account/manager',query:item}); - // this.$nextTick(() => { - // that.$refs.menu.updateActiveName(); - // }) + this.$router.push({path: '/account/manager',query:item}); }, setHeader(data){ let that = this; @@ -318,7 +315,6 @@ this.$Message.info("登出成功"); } }, - }