From f96e8a2a88f50dee5a2e421995edaf4cb3121050 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 13 Aug 2021 12:42:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=B0=E5=9B=BE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/map/map.js | 1 + frontend/src/views/chart/view/ChartEdit.vue | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index e945d23c31..7b5f1734e7 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -45,6 +45,7 @@ export function baseMapOption(chart_option, chart) { if (customAttr.color && customAttr.color.colors) { chart_option.visualMap.inRange.color = customAttr.color.colors + chart_option.visualMap.inRange.colorAlpha = customAttr.color.alpha / 100 } for (let i = 0; i < valueArr.length; i++) { // const y = { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index d513721e77..b3b3350605 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -821,6 +821,9 @@ export default { return } view.tableId = this.view.tableId + if (view.type === 'map' && view.xaxis.length > 1) { + view.xaxis = [view.xaxis[0]] + } view.xaxis.forEach(function(ele) { // if (!ele.summary || ele.summary === '') { // ele.summary = 'sum' @@ -838,6 +841,9 @@ export default { ele.filter = [] } }) + if (view.type === 'map' && view.yaxis.length > 1) { + view.yaxis = [view.yaxis[0]] + } view.yaxis.forEach(function(ele) { if (!ele.summary || ele.summary === '') { if (ele.id === 'count' || ele.deType === 0 || ele.deType === 1) { @@ -1282,11 +1288,17 @@ export default { } }, addXaxis(e) { + if (this.view.type === 'map' && this.view.xaxis.length > 1) { + this.view.xaxis = [this.view.xaxis[0]] + } this.dragCheckType(this.view.xaxis, 'd') this.dragMoveDuplicate(this.view.xaxis, e) this.save(true) }, addYaxis(e) { + if (this.view.type === 'map' && this.view.yaxis.length > 1) { + this.view.yaxis = [this.view.yaxis[0]] + } this.dragCheckType(this.view.yaxis, 'q') this.dragMoveDuplicate(this.view.yaxis, e) this.save(true)