From 2054ab0f8a06c0eb3e7553c6f80ad0e2b8823859 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Tue, 29 Jun 2021 15:28:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=89=B2=E5=8A=9F=E8=83=BDbu?= =?UTF-8?q?g=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/store/module/user.js | 22 +++++++++++++++-- .../layout/aside/historyComponent/history.vue | 2 +- web/src/view/layout/aside/index.vue | 24 +++---------------- web/src/view/layout/setting/index.vue | 8 +++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/web/src/store/module/user.js b/web/src/store/module/user.js index 5534959b..82ee944b 100644 --- a/web/src/store/module/user.js +++ b/web/src/store/module/user.js @@ -118,13 +118,31 @@ export const user = { token(state) { return state.token }, - sideMode(state) { + mode(state) { return state.userInfo.sideMode }, + sideMode(state) { + if (state.userInfo.sideMode === 'dark') { + return '#191a23' + } else if (state.userInfo.sideMode === 'light') { + return '#fff' + } else { + return state.userInfo.sideMode + } + }, baseColor(state) { - return state.userInfo.baseColor + if (state.userInfo.sideMode === 'dark') { + return '#fff' + } else if (state.userInfo.sideMode === 'light') { + return '#191a23' + } else { + return state.userInfo.baseColor + } }, activeColor(state) { + if (state.userInfo.sideMode === 'dark' || state.userInfo.sideMode === 'light') { + return '#1890ff' + } return state.userInfo.activeColor } diff --git a/web/src/view/layout/aside/historyComponent/history.vue b/web/src/view/layout/aside/historyComponent/history.vue index d54ffcb1..8568b67d 100644 --- a/web/src/view/layout/aside/historyComponent/history.vue +++ b/web/src/view/layout/aside/historyComponent/history.vue @@ -16,7 +16,7 @@ :tab="item" class="gva-tab" > - {{ item.meta.title }} + {{ item.meta.title }} diff --git a/web/src/view/layout/aside/index.vue b/web/src/view/layout/aside/index.vue index 0d264b81..3a705ac9 100644 --- a/web/src/view/layout/aside/index.vue +++ b/web/src/view/layout/aside/index.vue @@ -6,9 +6,9 @@ :collapse="isCollapse" :collapse-transition="true" :default-active="active" - :background-color="backgroundColor" + :background-color="sideMode" :active-text-color="activeColor" - :text-color="textColor" + :text-color="baseColor" class="el-menu-vertical" unique-opened @select="selectMenuItem" @@ -38,25 +38,7 @@ export default { }, computed: { ...mapGetters('router', ['asyncRouters']), - ...mapGetters('user', ['baseColor', 'activeColor', 'sideMode']), - backgroundColor() { - if (this.sideMode === 'dark') { - return '#191a23' - } else if (this.sideMode === 'light') { - return '#fff' - } else { - return this.sideMode - } - }, - textColor() { - if (this.$store.getters['user/sideMode'] === 'dark') { - return '#fff' - } else if (this.$store.getters['user/sideMode'] === 'light') { - return '#191a23' - } else { - return this.baseColor - } - } + ...mapGetters('user', ['baseColor', 'activeColor', 'sideMode']) }, watch: { $route() { diff --git a/web/src/view/layout/setting/index.vue b/web/src/view/layout/setting/index.vue index 7c637e45..a6f51652 100644 --- a/web/src/view/layout/setting/index.vue +++ b/web/src/view/layout/setting/index.vue @@ -9,15 +9,15 @@ >