From 8f46003c1b83255018e2693bd0241569e8c72f5b Mon Sep 17 00:00:00 2001 From: Caps <452713115@qq.com> Date: Fri, 17 Apr 2020 13:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home.vue | 26 ++++++++++++++------- src/pages/shop/IncreaseConfigure.vue | 33 +++++++++++++++++++------- src/pages/shop/IncreaseData.vue | 35 ++++++++++++++++------------ src/pages/shop/IncreaseManager.vue | 33 +++++++++++++++++++------- src/pages/shop/NoPermission.vue | 15 ++++++++++++ src/router/index.js | 6 +++++ 6 files changed, 107 insertions(+), 41 deletions(-) create mode 100644 src/pages/shop/NoPermission.vue diff --git a/src/pages/Home.vue b/src/pages/Home.vue index b3c0cf9..c168225 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -69,7 +69,7 @@ threePermissionList: [], } }, - mounted(){ + mounted() { let that = this; this.bus.$on('callBack', function () { that.callBack(); @@ -97,6 +97,15 @@ }, methods: { onSelectLister(val) { + let i; + this.onePermissionList.forEach(function (data) { + data.subMenuList.forEach(function (dta) { + if(dta.id === val){ + i = dta; + } + }) + }); + sessionStorage.setItem("threeLevel",JSON.stringify(i.subMenuList)); for (let i = 0; i < this.onePermissionList.length; i++) { let item = this.onePermissionList[i]; for (let k = 0; k < item.subMenuList.length; k++) { @@ -210,7 +219,7 @@ return data.pid === one.id }); one.subMenuList = two; - }) + }); //展开第一个菜单 that.menuInit(); } @@ -221,24 +230,25 @@ let that = this; that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; that.openName = [that.onePermissionList[0].id]; - this.$nextTick(()=>{ + this.$nextTick(() => { this.$refs.menu.updateOpened(); this.$refs.menu.updateActiveName(); - }) + }); this.selectedMenu = this.onePermissionList[0].name; this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name; - this.$router.push({path:that.onePermissionList[0].subMenuList[0].resource}); + sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList)); + this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource}); }, //账户管理页面回调方法 - callBack(){ + callBack() { let that = this; this.selectedMenu = "设置管理"; this.selectedSubMenu = "账户管理"; this.selectedItemName = this.onePermissionList[0].subMenuList[0].id; - this.$nextTick(()=>{ + this.$nextTick(() => { that.$refs.menu.updateActiveName(); }) - } + }, }, } diff --git a/src/pages/shop/IncreaseConfigure.vue b/src/pages/shop/IncreaseConfigure.vue index 9c5255a..7f599ee 100644 --- a/src/pages/shop/IncreaseConfigure.vue +++ b/src/pages/shop/IncreaseConfigure.vue @@ -1,13 +1,9 @@