diff --git a/data-room-ui/packages/BasicComponents/Input/index.vue b/data-room-ui/packages/BasicComponents/Input/index.vue index a19a0ab3..75f51516 100644 --- a/data-room-ui/packages/BasicComponents/Input/index.vue +++ b/data-room-ui/packages/BasicComponents/Input/index.vue @@ -78,7 +78,7 @@ export default { const inputIcon = document.querySelector(`.${config.customize.icon.name}`) inputIcon.style.fontSize = config.customize.inputStyle.fontSize + 'px' } - // 样式改变时更新主题配置 + // 只有样式改变时更新主题配置,切换主题时不需要保存 if (!isUpdateTheme) { config.theme = settingToTheme(_.cloneDeep(config), this.customTheme) this.changeChartConfig(config) diff --git a/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue b/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue index d484fc0a..94504571 100644 --- a/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue +++ b/data-room-ui/packages/BasicComponents/ThemeSwitcher/index.vue @@ -63,6 +63,7 @@ export default { // 由于静态组件没有混入公共函数,所以需要定义一个changeStyle方法,以免报错 changeStyle (config) { }, + // 点击切换主题 handleChange (val) { const pageInfo = this.pageInfo pageInfo.chartList = themeToSetting(pageInfo.chartList, val) diff --git a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue index f78b28b3..6150a0b5 100644 --- a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue +++ b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue @@ -66,6 +66,7 @@ popper-class="bs-el-select" placeholder="请选择主题" clearable + @change="changeTheme" > <el-option v-for="themeItem in themeOptions" @@ -191,6 +192,7 @@ import { getThemeConfig } from 'data-room-ui/js/api/bigScreenApi' // import _ from 'lodash' import cloneDeep from 'lodash/cloneDeep' import { G2 } from '@antv/g2plot' +import { themeToSetting } from 'data-room-ui/js/utils/themeFormatting' export default { name: 'OverallSetting', components: { @@ -270,15 +272,15 @@ export default { { value: 'light', label: '明亮' - }, - { - value: 'auto', - label: '透明' - }, - { - value: 'custom', - label: '自定义' } + // { + // value: 'auto', + // label: '透明' + // }, + // { + // value: 'custom', + // label: '自定义' + // } ], form: { w: 1920, @@ -286,7 +288,7 @@ export default { bg: '', bgColor: '#151a26', // 背景色 opacity: 100, - customTheme: 'auto', + customTheme: 'dark', themeJson: {}, cacheDataSets: [], refreshConfig: [], @@ -361,6 +363,12 @@ export default { 'changeChartKey', 'changeRefreshConfig' ]), + // 切换主题时更新主题配置 + changeTheme (theme) { + const pageInfo = this.pageInfo + pageInfo.chartList = themeToSetting(pageInfo.chartList, theme) + this.changePageInfo(pageInfo) + }, init () { if (!this.pageInfo.pageConfig.refreshConfig) { this.pageInfo.pageConfig.refreshConfig = [] diff --git a/data-room-ui/packages/BigScreenManagement/index.vue b/data-room-ui/packages/BigScreenManagement/index.vue index f45ece47..04b64b2f 100644 --- a/data-room-ui/packages/BigScreenManagement/index.vue +++ b/data-room-ui/packages/BigScreenManagement/index.vue @@ -51,7 +51,7 @@ <span class="el-dropdown-link menu-dropdown-link"> <i class="el-icon-more" /> </span> - <el-dropdown-menu slot="dropdown"> + <el-dropdown-menu slot="dropdown"> <el-dropdown-item @click.native="handleDropdownClick('edit',data,node)">编辑 </el-dropdown-item> <el-dropdown-item v-if="data.type!=='catalog'"