feat:修复g2组件主题设置问题

main
liu.shiyi 2 years ago
parent 9d773ba225
commit 6ce4a19193

@ -19,6 +19,7 @@ import { mapState, mapMutations } from 'vuex'
import * as g2Plot from '@antv/g2plot'
import plotList, { getCustomPlots } from '../G2Plots/plotList'
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from 'lodash'
export default {
name: 'PlotCustomComponent',
@ -66,7 +67,7 @@ export default {
'config.option.theme': {
handler (val) {
if (val) {
this.changeStyle(this.config)
this.changeStyle(this.config, true)
}
}
}
@ -175,7 +176,7 @@ export default {
return config
},
// config
changeStyle (config) {
changeStyle (config, isUpdateTheme) {
config = { ...this.config, ...config }
config = this.transformSettingToOption(config, 'custom')
// optionsettingeval,optionHandlerdataHandler
@ -189,8 +190,10 @@ export default {
console.error(e)
}
}
//
config.theme = settingToTheme(cloneDeep(config), this.customTheme)
//
if (!isUpdateTheme) {
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
}
this.changeChartConfig(config)
if (config.code === this.activeCode) {
this.changeActiveItemConfig(config)

Loading…
Cancel
Save