refactor(仪表板): 视图放大按钮样式可以跟随主题变化

This commit is contained in:
wangjiahao 2022-08-17 11:03:44 +08:00
parent ce973fd3a9
commit 138f3d1abb
3 changed files with 13 additions and 3 deletions

View File

@ -10,7 +10,7 @@
:chart="mapChart || chart" :chart="mapChart || chart"
class="chart-class" class="chart-class"
/> />
<chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" class="chart-class" :chart="mapChart || chart" /> <chart-component :theme-style="element.commonBackground" v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" class="chart-class" :chart="mapChart || chart" />
<chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" /> <chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
<chart-component-s2 v-else-if="chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" /> <chart-component-s2 v-else-if="chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
<label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" /> <label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" />
@ -153,9 +153,11 @@ export default {
return null return null
} }
}, },
mounted() { created() {
this.element = deepCopy(this.curComponent) this.element = deepCopy(this.curComponent)
}, },
mounted() {
},
methods: { methods: {
exportExcel() { exportExcel() {
const _this = this const _this = this

View File

@ -8,7 +8,7 @@
:chart="mapChart || chart" :chart="mapChart || chart"
class="chart-class" class="chart-class"
/> />
<chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" class="chart-class" :chart="mapChart || chart" /> <chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" :theme-style="element.commonBackground" class="chart-class" :chart="mapChart || chart" />
<chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" /> <chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
<chart-component-s2 v-else-if="chart.type === 'table-pivot' && renderComponent() === 'antv'" class="chart-class" :chart="chart" /> <chart-component-s2 v-else-if="chart.type === 'table-pivot' && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
<label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" /> <label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" />
@ -32,6 +32,7 @@ import DeContainer from '@/components/dataease/DeContainer'
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText' import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2' import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
import PluginCom from '@/views/system/plugin/PluginCom' import PluginCom from '@/views/system/plugin/PluginCom'
import { deepCopy } from '@/components/canvas/utils/utils'
export default { export default {
name: 'UserViewMobileDialog', name: 'UserViewMobileDialog',
components: { ChartComponentS2, LabelNormalText, DeContainer, DeMainContainer, ChartComponentG2, ChartComponent, TableNormal, LabelNormal, PluginCom }, components: { ChartComponentS2, LabelNormalText, DeContainer, DeMainContainer, ChartComponentG2, ChartComponent, TableNormal, LabelNormal, PluginCom },
@ -48,9 +49,13 @@ export default {
data() { data() {
return { return {
refId: null, refId: null,
element: {},
lastMapChart: null lastMapChart: null
} }
}, },
created() {
this.element = deepCopy(this.curComponent)
},
computed: { computed: {
customStyle() { customStyle() {

View File

@ -387,6 +387,9 @@ export function adaptCurThemeCommonStyleAll() {
const componentData = store.state.componentData const componentData = store.state.componentData
componentData.forEach((item) => { componentData.forEach((item) => {
adaptCurThemeCommonStyle(item) adaptCurThemeCommonStyle(item)
if (item.style.backgroundColor) {
delete item.style.backgroundColor
}
}) })
} }