From c9f72476abce8ff8c0a4720f5caa6b36efaf6a0d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 31 Aug 2022 21:40:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E5=9C=B0=E5=9B=BE):=20?= =?UTF-8?q?=E6=B7=B1=E8=89=B2=E4=B8=BB=E9=A2=98=E6=96=B0=E5=BB=BA=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E7=BC=A9=E6=94=BE=E6=8C=89=E9=92=AE=E4=BE=9D=E7=84=B6?= =?UTF-8?q?=E6=98=AF=E6=B5=85=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/ChartComponent.vue | 18 ++++++++++++++++++ .../chart/components/senior/MapMapping.vue | 5 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 83109bb792..7c6afd991e 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -167,6 +167,9 @@ export default { destroyed() { this.myChart.dispose() }, + created() { + this.loadThemeStyle() + }, methods: { reDrawView() { 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) { const chart = this.chart let chart_option = {} diff --git a/frontend/src/views/chart/components/senior/MapMapping.vue b/frontend/src/views/chart/components/senior/MapMapping.vue index 627918757d..6116d815cd 100644 --- a/frontend/src/views/chart/components/senior/MapMapping.vue +++ b/frontend/src/views/chart/components/senior/MapMapping.vue @@ -215,16 +215,17 @@ export default { }) } const cCode = this.currentAreaCode + if(!cCode) return if (this.$store.getters.geoMap[cCode]) { const json = this.$store.getters.geoMap[cCode] - innerCallBack(json, cCode) + json && innerCallBack(json, cCode) } else { geoJson(cCode).then(res => { this.$store.dispatch('map/setGeo', { key: cCode, value: res }).then(() => { - innerCallBack(res, cCode) + res && innerCallBack(res, cCode) }) }) }