diff --git a/package.json b/package.json index cd48083..cef46ef 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "core-js": "^3.6.4", "echarts": "^4.7.0", "file-saver": "^2.0.2", + "jquery": "^3.5.1", "lib-flexible": "^0.3.2", "moment": "^2.24.0", "postcss-px2rem-exclude": "0.0.6", diff --git a/public/index.html b/public/index.html index b939cbf..c29e266 100644 --- a/public/index.html +++ b/public/index.html @@ -14,4 +14,5 @@
+ diff --git a/src/pages/CustomerViewHome.vue b/src/pages/CustomerViewHome.vue new file mode 100644 index 0000000..2e93118 --- /dev/null +++ b/src/pages/CustomerViewHome.vue @@ -0,0 +1,606 @@ + + + diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 35fa918..89c2a15 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -18,17 +18,14 @@ - - - 首页 - + + :key="cItem.id" :target="cItem.name === '大屏' ? '_blank' : '_self'"> {{cItem.name}} @@ -64,7 +61,6 @@ data() { return { roleCode: JSON.parse(sessionStorage.getItem("loginInfo")).roleCode, - mainUrl: "/customer/view", isCollapsed: false, mHeight: 600, selectedItemName: "", @@ -115,34 +111,25 @@ }, methods: { + // 菜单选中事件 onSelectLister(val) { - let i; - this.onePermissionList.forEach(function (data) { - data.subMenuList.forEach(function (dta) { - if(dta.id === val){ - i = dta; - } - }) - }); - if(i){ - sessionStorage.setItem("threeLevel",JSON.stringify(i.subMenuList)); - } - //首页 - if(val === 0){ - this.selectedMenu = "首页"; - 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++) { let cItem = item.subMenuList[k]; if (cItem.id === val) { + + if(cItem.name === '大屏'){ + this.$router.push("") + } + + this.selectedMenu = item.name; this.selectedSubMenu = cItem.name; this.selectedItemName = cItem.id; this.breadcrumbUrl = cItem.resource; + // 3级菜单 + sessionStorage.setItem("threeLevel",JSON.stringify(cItem.subMenuList)); } } } @@ -258,25 +245,18 @@ //导航栏初始化 menuInit: function () { let that = this; - if(this.roleCode === 'GLY-ADMIN' || this.roleCode === 'DG-YUNYING' || this.roleCode === 'GL-YUNYING'){ - //默认首页 - that.selectedItemName = 0; - this.$router.push({path: that.mainUrl}); - this.selectedMenu = "首页"; - this.breadcrumbUrl = this.mainUrl; - }else{ - that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; - that.openName = [that.onePermissionList[0].id]; - 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}); - } + that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; + that.openName = [that.onePermissionList[0].id]; + + 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}); }, //账户管理页面回调方法 diff --git a/src/router/index.js b/src/router/index.js index ea5a444..fe82bc7 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -27,6 +27,7 @@ import IncreaseGroupSendConfigure from '@/pages/shop/IncreaseGroupSendConfigure' import IncreaseWelcomeConfigure from '@/pages/shop/IncreaseWelcomeConfigure'; import IncreaseGroupSendConfigureAdd from '@/pages/shop/IncreaseGroupSendConfigureAdd'; import NoPermission from '@/pages/shop/NoPermission'; +import CustomerViewHome from "@/pages/CustomerViewHome"; Vue.use(Router); @@ -197,9 +198,15 @@ const router = new Router({ path: '/no/permission', name: 'NoPermission', component: NoPermission, - } + }, + ] - } + }, + { + path: '/customer/view/home', + name: 'CustomerViewHome', + component: CustomerViewHome, + }, ] }); /*