From d66c747385b74b85b30052cbfea28effbf551712 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 25 Apr 2024 11:58:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8D=95=E4=B8=AA=E6=8C=87=E6=A0=87=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=97=B6=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E6=8C=87=E6=A0=87=E4=B9=9F=E5=8F=97=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=20#9126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/view/ChartEdit.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/frontend/src/views/chart/view/ChartEdit.vue b/core/frontend/src/views/chart/view/ChartEdit.vue index 944b3a123b..bf819c429c 100644 --- a/core/frontend/src/views/chart/view/ChartEdit.vue +++ b/core/frontend/src/views/chart/view/ChartEdit.vue @@ -3708,7 +3708,9 @@ export default { this.showValueFormatter = false }, saveValueFormatter() { - const ele = this.valueFormatterItem.formatterCfg.decimalCount + const formatterItem = _.cloneDeep(this.valueFormatterItem) + const formatterCfg = formatterItem.formatterCfg + const ele = formatterCfg.decimalCount if (ele === undefined || ele.toString().indexOf('.') > -1 || parseInt(ele).toString() === 'NaN' || parseInt(ele) < 0 || parseInt(ele) > 10) { this.$message({ message: this.$t('chart.formatter_decimal_count_error'), @@ -3718,14 +3720,14 @@ export default { return } // 更新指标 - if (this.valueFormatterItem.formatterType === 'quota' && this.chart.type !== 'bar-time-range') { - this.view.yaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg - } else if (this.valueFormatterItem.formatterType === 'quotaExt') { - this.view.yaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg - } else if (this.valueFormatterItem.formatterType === 'dimension') { - this.view.xaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg + if (formatterItem.formatterType === 'quota' && this.chart.type !== 'bar-time-range') { + this.view.yaxis[formatterItem.index].formatterCfg = formatterCfg + } else if (formatterItem.formatterType === 'quotaExt') { + this.view.yaxisExt[formatterItem.index].formatterCfg = formatterCfg + } else if (formatterItem.formatterType === 'dimension') { + this.view.xaxis[formatterItem.index].formatterCfg = formatterCfg } else if (this.chart.type === 'bar-time-range') { - this.view.xaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg + this.view.xaxisExt[formatterItem.index].formatterCfg = formatterCfg } this.calcData(true) this.closeValueFormatter()