From e9470537b565036be10cadc19cafb7d2c947a950 Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 26 Oct 2022 14:46:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=8D=A0=E6=AF=94=E6=97=B6=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E6=A0=BC=E5=BC=8F=E4=B8=BA=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/drag-item/QuotaExtItem.vue | 4 ++++ frontend/src/views/chart/components/drag-item/QuotaItem.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue b/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue index 5c01a443a1..cbdccb70cb 100644 --- a/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue +++ b/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue @@ -385,6 +385,10 @@ export default { this.editCompare() break case 'percent': + // 选择占比,自动将数值格式设置为百分比并保留2位小数 + this.item.formatterCfg.type = 'percent' + this.item.formatterCfg.decimalCount = 2 + this.item.compareCalc.type = 'percent' this.$emit('onQuotaItemChange', this.item) break diff --git a/frontend/src/views/chart/components/drag-item/QuotaItem.vue b/frontend/src/views/chart/components/drag-item/QuotaItem.vue index 2a72ef6f29..5843e847e6 100644 --- a/frontend/src/views/chart/components/drag-item/QuotaItem.vue +++ b/frontend/src/views/chart/components/drag-item/QuotaItem.vue @@ -382,6 +382,10 @@ export default { this.editCompare() break case 'percent': + // 选择占比,自动将数值格式设置为百分比并保留2位小数 + this.item.formatterCfg.type = 'percent' + this.item.formatterCfg.decimalCount = 2 + this.item.compareCalc.type = 'percent' this.$emit('onQuotaItemChange', this.item) break