From d881498d6ec5cb5c3bc080a7246b5c5dc04cb537 Mon Sep 17 00:00:00 2001 From: xjs Date: Thu, 26 Jun 2025 11:37:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=80=BB=E7=BC=B4=E8=B4=B9=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/appComponents/appEchart/PaymentChart.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/appComponents/appEchart/PaymentChart.vue b/src/views/appComponents/appEchart/PaymentChart.vue index 73a10b0..9e7493a 100644 --- a/src/views/appComponents/appEchart/PaymentChart.vue +++ b/src/views/appComponents/appEchart/PaymentChart.vue @@ -4,7 +4,7 @@
-
{{ total }}
+
{{ paymentData.chargeTotal }}
@@ -28,11 +28,11 @@ const chartData = ref([]); const paymentData = inject("paymentData", ref({ chargeTotal: 0, estimatedTotal: 0, items: [] })); const colors = ["#0783FA", "#07D1FA", "#20E6A4", "#FFD15C", "#9A68FF"]; - const total = ref(0); + watchEffect(() => { if (paymentData.value.items) { chartData.value = paymentData.value.items.map((item: any, index) => { - total.value += item.value; + return { ...item, color: colors[index % colors.length] }; }); }