Merge pull request #3024 from dataease/pr@dev@fix_map_init_style

fix(视图-地图): 深色主题新建地图缩放按钮依然是浅色
This commit is contained in:
fit2cloud-chenyw 2022-08-31 21:41:08 +08:00 committed by GitHub
commit 72d1c316e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -167,6 +167,9 @@ export default {
destroyed() { destroyed() {
this.myChart.dispose() this.myChart.dispose()
}, },
created() {
this.loadThemeStyle()
},
methods: { methods: {
reDrawView() { reDrawView() {
this.myChart.dispatchAction({ type: 'unselect', seriesIndex: this.linkageActiveParam.seriesIndex, name: this.linkageActiveParam.name }) this.myChart.dispatchAction({ type: 'unselect', seriesIndex: this.linkageActiveParam.seriesIndex, name: this.linkageActiveParam.name })
@ -213,6 +216,21 @@ export default {
}) })
}) })
}, },
loadThemeStyle() {
let themeStyle = null
if (this.themeStyle) {
themeStyle = JSON.parse(JSON.stringify(this.themeStyle))
if (themeStyle && themeStyle.backgroundColorSelect) {
const panelColor = themeStyle.color
if (panelColor !== '#FFFFFF') {
const reverseValue = reverseColor(panelColor)
this.buttonTextColor = reverseValue
} else {
this.buttonTextColor = null
}
}
}
},
drawEcharts(activeParam) { drawEcharts(activeParam) {
const chart = this.chart const chart = this.chart
let chart_option = {} let chart_option = {}

View File

@ -215,16 +215,17 @@ export default {
}) })
} }
const cCode = this.currentAreaCode const cCode = this.currentAreaCode
if(!cCode) return
if (this.$store.getters.geoMap[cCode]) { if (this.$store.getters.geoMap[cCode]) {
const json = this.$store.getters.geoMap[cCode] const json = this.$store.getters.geoMap[cCode]
innerCallBack(json, cCode) json && innerCallBack(json, cCode)
} else { } else {
geoJson(cCode).then(res => { geoJson(cCode).then(res => {
this.$store.dispatch('map/setGeo', { this.$store.dispatch('map/setGeo', {
key: cCode, key: cCode,
value: res value: res
}).then(() => { }).then(() => {
innerCallBack(res, cCode) res && innerCallBack(res, cCode)
}) })
}) })
} }