From 1d1fa7a6bbae2981735a2a167e4038b1242dd3bd Mon Sep 17 00:00:00 2001 From: "liu.shiyi" Date: Mon, 4 Sep 2023 14:03:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=B1=9E=E6=80=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicComponents/ThemeSwitcher/index.vue | 39 +++++++++++++------ .../BasicComponents/ThemeSwitcher/setting.vue | 35 ++++++++++------- .../ThemeSwitcher/settingConfig.js | 6 +-- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue b/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue index f4e2c8a3..cb8ef4b4 100644 --- a/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue +++ b/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue @@ -3,9 +3,9 @@ class="bs-design-wrap theme-switcher-wrap" :class="`bs-theme-switcher-${customTheme}`" > -
- 切换主题 -
+ + + 明亮 暗黑 @@ -56,8 +57,15 @@ export default { } }, watch: { + 'config.customize.activeColor': { + handler (val) { + document.documentElement.style.setProperty('--radio-label-color', val) + }, + immediate: true + } }, mounted () { + document.documentElement.style.setProperty('--radio-label-color', this.config.customize.activeColor) }, methods: { ...mapMutations({ @@ -97,6 +105,7 @@ export default { width: 100%;; display: flex; align-items: center; + justify-content: center; flex-wrap: nowrap; color: #fff; .label-box{ @@ -104,13 +113,21 @@ export default { margin-right: 10px; font-size: 14px; } - .el-radio.is-checked { - color: #00a0e9; /* 修改激活状态下的字体颜色 */ + //.el-radio.is-checked { + // color: red; /* 修改激活状态下的字体颜色 */ + //} + // + ///* 修改未激活状态下的字体颜色 */ + //.el-radio:not(.is-checked) { + // color: #fff; /* 修改未激活状态下的字体颜色 */ + //} + /deep/ .el-radio__input.is-checked+.el-radio__label { + /* 使用 CSS 变量来设置字体颜色 */ + color: var(--radio-label-color); } - - /* 修改未激活状态下的字体颜色 */ - .el-radio:not(.is-checked) { - color: #fff; /* 修改未激活状态下的字体颜色 */ + /deep/ .el-radio__input.is-checked .el-radio__inner{ + background: var(--radio-label-color); + border-color: var(--radio-label-color); } } diff --git a/data-room-ui/packages/BasicComponents/ThemeSwitcher/setting.vue b/data-room-ui/packages/BasicComponents/ThemeSwitcher/setting.vue index 504b0c86..57594d8b 100644 --- a/data-room-ui/packages/BasicComponents/ThemeSwitcher/setting.vue +++ b/data-room-ui/packages/BasicComponents/ThemeSwitcher/setting.vue @@ -13,35 +13,42 @@ :rules="rules" class="bs-el-form" > - 标题 -
+ 位置 +
+ +
+ 基础 +
- + + + -
- 位置 -
-