From fb8c8aab289e69c944e01e433dad221de056b3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8F=9C?= <43331987+JiaLiBai@users.noreply.github.com> Date: Thu, 4 Sep 2025 16:10:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=91=A8=E5=8A=9F=E7=8E=87=E6=9B=B2?= =?UTF-8?q?=E7=BA=BF=E6=A8=AA=E5=9D=90=E6=A0=87=E5=B1=95=E7=A4=BA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/work/index.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pages/work/index.vue b/pages/work/index.vue index 5672a17..1591544 100644 --- a/pages/work/index.vue +++ b/pages/work/index.vue @@ -80,7 +80,7 @@ enableScroll: true, xAxis: { scrollShow: true, - itemCount: 7, + itemCount: 5, disableGrid: true }, // update: true, @@ -221,6 +221,13 @@ } }) }, + handleDate(date) { + if (!date) return date + const time = new Date(date) + const month = time.getMonth() + 1, + day = time.getDate() + return `${month<10?'0'+month : month}/${day<10 ? '0'+day : day}` + }, getWeekChartData() { this.$refs.weekChartDateRangeSelect.showBtnLoading(true) getSevenChargeData({ @@ -234,9 +241,9 @@ chargedCap = [], disChargedCap = [] data.forEach(item => { - categories.push(item.ammeterDate || undefined) - chargedCap.push(item.chargedCap || undefined) - disChargedCap.push(item.disChargedCap || undefined) + categories.push(this.handleDate(item.ammeterDate) || undefined) + chargedCap.push(item.chargedCap) + disChargedCap.push(item.disChargedCap) }) this.weekChartData = JSON.parse(JSON.stringify({ categories,