From d1772f8a3d320f2640aad1b87ed2cd0d8beec184 Mon Sep 17 00:00:00 2001 From: gongdi <410827992@qq.com> Date: Sat, 25 Jun 2022 11:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=8B=E6=B5=A6=E5=AD=A6=E6=A0=A1=E5=85=AB?= =?UTF-8?q?=E5=A4=A7=E4=B8=AD=E5=BF=83=20=E5=BE=B7=E8=82=B2=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/homePages/login/login.vue | 2 ++ .../studentClassTeacherManagement.vue | 4 +++ .../pages/secondPages/secondPageBox.vue | 2 +- .../pages/secondPages/top.vue | 34 ++++++++++++++----- .../store/modules/userStore.js | 10 ++++-- 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/views/screenAdaptation/pages/homePages/login/login.vue b/src/views/screenAdaptation/pages/homePages/login/login.vue index 42b021c..38c5edb 100644 --- a/src/views/screenAdaptation/pages/homePages/login/login.vue +++ b/src/views/screenAdaptation/pages/homePages/login/login.vue @@ -118,9 +118,11 @@ if (result[0].status === 200) { let data = result[0].data; if (data.code === 2000) { + console.log(data.data) //cookie存储 this.Cookie.set("person_id", data.data.person_id); this.Cookie.set("identity_id", data.data.identity_id); + this.Cookie.set("token", data.data.access_token); //构建BaseConfig基本信息 this.buildBaseInfo(); diff --git a/src/views/screenAdaptation/pages/moralEducationCenter/studentClassTeacherManagement.vue b/src/views/screenAdaptation/pages/moralEducationCenter/studentClassTeacherManagement.vue index 6e9b5e9..cd8dae8 100644 --- a/src/views/screenAdaptation/pages/moralEducationCenter/studentClassTeacherManagement.vue +++ b/src/views/screenAdaptation/pages/moralEducationCenter/studentClassTeacherManagement.vue @@ -17,6 +17,10 @@ data(){ return {} }, + created(){ + document.documentElement.style.setProperty('--modTitleOne', '#094193'); + document.documentElement.style.setProperty('--modTitleTwo', '#094193'); + }, components:{ StudentManage, classManage, diff --git a/src/views/screenAdaptation/pages/secondPages/secondPageBox.vue b/src/views/screenAdaptation/pages/secondPages/secondPageBox.vue index e0f5d90..35cb757 100644 --- a/src/views/screenAdaptation/pages/secondPages/secondPageBox.vue +++ b/src/views/screenAdaptation/pages/secondPages/secondPageBox.vue @@ -64,7 +64,7 @@ @import '../../assets/scss/index.scss'; .business{ padding: 0!important; - /*background-image: url("../../assets/pageBg.jpg");*/ + background-image: url("../../assets/pageBg.jpg"); .host-body{ .body-box{ position: relative; diff --git a/src/views/screenAdaptation/pages/secondPages/top.vue b/src/views/screenAdaptation/pages/secondPages/top.vue index 6749abf..c4936dd 100644 --- a/src/views/screenAdaptation/pages/secondPages/top.vue +++ b/src/views/screenAdaptation/pages/secondPages/top.vue @@ -84,7 +84,7 @@ }, systemData: [], layoutData: {}, - showWorkBenchButton:true,//是否展示工作台顶部操作按钮 + showWorkBenchButton: true,//是否展示工作台顶部操作按钮 } }, computed: { @@ -105,6 +105,15 @@ deep: true } }, + beforeMount(){ + //解决二级页面刷新后,顶部导航菜单消失问题 + let menuOptions = this.$store.state.userStore.menuOptions; + if (menuOptions) { + this.title = menuOptions.title; + this.menuAry = menuOptions.menuAry; + this.menuPath = menuOptions.menuPath; + } + }, mounted(){ this.emitRouteChange(this.$route.path); this.$bus.on("topCountChange", this.changeCount); @@ -136,7 +145,7 @@ return path !== "" }) } - if(routePathAry.length > 1){ + if (routePathAry.length > 1) { //子路由 this.menuPath = routePath; this.changeBackImg(this.menuPath); @@ -149,6 +158,11 @@ } this.menuAry = this.filterMenuAry(routePath); this.menuPath = this.menuAry && this.menuAry.length > 0 ? this.menuAry[0].path : ""; + this.$store.commit('userStore/setMenuOptions', { + title: this.title, + menuAry: this.menuAry, + menuPath: this.menuPath + }); this.changeBackImg(this.menuPath); this.$emit("modelChange", this.menuPath); }, @@ -160,19 +174,19 @@ } }, changeBackImg: function (path) { - if(path.indexOf("workBench") > 0){ + if (path.indexOf("workBench") > 0) { //工作台 - if(path === "/workBench/application"){ + if (path === "/workBench/application") { //更多应用 this.rightWidth = 30; this.topImgUrl = topImg01; this.showWorkBenchButton = false; - }else { + } else { this.rightWidth = 40; this.topImgUrl = topImg02; this.showWorkBenchButton = true; } - }else { + } else { this.rightWidth = 30; this.topImgUrl = topImg01; this.showWorkBenchButton = false; @@ -257,10 +271,14 @@ this.$bus.emit("accessSubsystem", systemData); }, //跳转综合服务平台管理中心 - servicePlatform:function (systemData) { + servicePlatform: function (systemData) { this.$refs.systemListRef.clicked = false; //this.$router.replace({name:"servicePlatform",params:{id:systemData.id,name:systemData.title}}); - this.$router.push({path:'/workBench/servicePlatform/:id/:name',name:'servicePlatform',params:{id:systemData.id,name:systemData.title}}); + this.$router.push({ + path: '/workBench/servicePlatform/:id/:name', + name: 'servicePlatform', + params: {id: systemData.id, name: systemData.title} + }); } }, beforeDestroy(){ diff --git a/src/views/screenAdaptation/store/modules/userStore.js b/src/views/screenAdaptation/store/modules/userStore.js index 579329f..a040e4e 100644 --- a/src/views/screenAdaptation/store/modules/userStore.js +++ b/src/views/screenAdaptation/store/modules/userStore.js @@ -4,14 +4,16 @@ export default { user: null,//人员信息 roles: null,//角色信息 menus: null,//菜单信息 + menuOptions: null,//菜单配置 portraitUrl: "",//头像路径 - showLoginBox:false,//是否弹出登录框 - theme:"systemTheme",//主题 + showLoginBox: false,//是否弹出登录框 + theme: "systemTheme",//主题 }, getter: { user: state => state.user, roles: state => state.roles, menus: state => state.menus, + menuOptions: state => state.menuOptions, portraitUrl: state => state.portraitUrl, showLoginBox: state => state.showLoginBox, theme: state => state.theme, @@ -26,6 +28,9 @@ export default { setMenus (state, menus) { state.menus = menus; }, + setMenuOptions (state, menuOptions) { + state.menuOptions = menuOptions; + }, setPortraitUrl (state, portraitUrl) { state.portraitUrl = portraitUrl; }, @@ -39,6 +44,7 @@ export default { state.user = null; state.roles = null; state.menus = null; + state.menuOptions = null; state.portraitUrl = null; state.showLoginBox = false; state.theme = "systemTheme";