From 6e28e876ef7d3e6b836a964e52acbc8ab2cafb8d Mon Sep 17 00:00:00 2001 From: "liu.shiyi" Date: Fri, 1 Sep 2023 15:02:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=88=87=E6=8D=A2=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicComponents/ThemeSwitcher/index.vue | 16 +++++++++- .../BigScreenDesign/OverallSetting/index.vue | 30 +++++++++++++++++++ .../packages/assets/style/dist/bsTheme.css | 2 +- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue b/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue index ecda5352..f4e2c8a3 100644 --- a/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue +++ b/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue @@ -46,7 +46,10 @@ export default { computed: { ...mapState({ pageInfo: (state) => state.bigScreen.pageInfo - }) + }), + isPreview () { + return (this.$route.path === window?.BS_CONFIG?.routers?.previewUrl) || (this.$route.path === '/big-screen/preview') + } }, data () { return { @@ -73,6 +76,17 @@ export default { this.$emit('styleHandler', chart) } }) + if (!this.isPreview) { + const themeLabel = val === 'light' ? '明亮' : '暗黑' + const htmlStr = `当前已切换到${themeLabel}主题,颜色设置针对当前主题生效` + this.$notify({ + title: '注意', + dangerouslyUseHTMLString: true, + message: htmlStr, + customClass: 'ds-el-notify', + type: 'warning' + }) + } } } } diff --git a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue index 7f5ec81a..16b1eac1 100644 --- a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue +++ b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue @@ -313,6 +313,9 @@ export default { pageInfo: state => state.bigScreen.pageInfo, config: state => state.bigScreen.activeItemConfig }), + isPreview () { + return (this.$route.path === window?.BS_CONFIG?.routers?.previewUrl) || (this.$route.path === '/big-screen/preview') + }, // 根据主题色来决定背景色和背景图绑定什么变量 currentBgColor () { return this.form.customTheme === 'dark' ? 'bgColor' : 'lightBgColor' @@ -379,6 +382,17 @@ export default { this.$emit('styleHandler', chart) } }) + if (!this.isPreview) { + const themeLabel = theme === 'light' ? '明亮' : '暗黑' + const htmlStr = `当前已切换到${themeLabel}主题,颜色设置针对当前主题生效` + this.$notify({ + title: '注意', + dangerouslyUseHTMLString: true, + message: htmlStr, + customClass: 'ds-el-notify', + type: 'warning' + }) + } }, init () { if (!this.pageInfo.pageConfig.refreshConfig) { @@ -657,4 +671,20 @@ export default { height: calc(100% - 50px); overflow-y: auto; } + + + diff --git a/data-room-ui/packages/assets/style/dist/bsTheme.css b/data-room-ui/packages/assets/style/dist/bsTheme.css index 6ce768d5..806a04b8 100644 --- a/data-room-ui/packages/assets/style/dist/bsTheme.css +++ b/data-room-ui/packages/assets/style/dist/bsTheme.css @@ -413,4 +413,4 @@ .bs-context-menu-class .menu_item__available:hover { background: var(--bs-el-background-3) !important; color: var(--bs-el-hover) !important; -} \ No newline at end of file +}