From afc67ab4dafd36c786925a12e181db6cb3594833 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Thu, 5 Mar 2026 23:52:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/statistic/bigScreen/index.vue | 31 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/pages/statistic/bigScreen/index.vue b/src/pages/statistic/bigScreen/index.vue index 70fee1d..c989cf2 100644 --- a/src/pages/statistic/bigScreen/index.vue +++ b/src/pages/statistic/bigScreen/index.vue @@ -304,7 +304,7 @@ 近两年储蓄卡开卡统计 - + @@ -889,9 +889,12 @@ const openCardChartData = computed(() => { return { categories: [], series: [{ name: '开卡数量', data: [] }] } } + // 按时间排序 + const sortedData = openCardData.value.slice().sort((a, b) => a.time.localeCompare(b.time)) + return { - categories: openCardData.value.map(item => item.time), - series: [{ name: '开卡数量', data: openCardData.value.map(item => Number(item.value) || 0) }] + categories: sortedData.map(item => item.time), + series: [{ name: '开卡数量', data: sortedData.map(item => Number(item.value) || 0) }] } }) @@ -915,8 +918,12 @@ const openCardChartOpts = ref({ showTitle: false }, extra: { - column: { - width: 20 + area: { + type: 'curve', + opacity: 0.2, + addLine: true, + width: 2, + gradient: true } } }) @@ -980,6 +987,9 @@ const loadAllData = async () => { const monthStartDay = `${year}-${month}-01` const todayStr = `${year}-${month}-${day}` const monthKey = `${year}-${month}` + // 当月最后一天 + const lastDayOfMonth = new Date(year, today.getMonth() + 1, 0) + const monthEndDay = `${year}-${month}-${String(lastDayOfMonth.getDate()).padStart(2, '0')}` // 计算近7天 const weekAgo = new Date(today) @@ -1075,7 +1085,7 @@ const loadAllData = async () => { getAcccountsOutInAnalysis({ type: 1, startTime: monthStartDay, - endTime: todayStr + endTime: monthEndDay }).then(res => { monthlyBalance.value = (res && res.data && res.data.balance) || 0 monthlyTotalOutcome.value = (res && res.data && res.data.totalOutcome) || 0 @@ -1086,7 +1096,7 @@ const loadAllData = async () => { getInstallmentHistoryAnalysis({ type: 1, startTime: monthStartDay, - endTime: todayStr, + endTime: monthEndDay, dataType: '2' }).then(res => { const dueDetail = Number(res.data.dueDetail) || 0 @@ -1101,7 +1111,7 @@ const loadAllData = async () => { getInstallmentHistoryAnalysis({ type: 1, startTime: monthStartDay, - endTime: todayStr, + endTime: monthEndDay, dataType: '3' }).then(res => { monthlyLendDue.value = (res && res.data && res.data.dueDetail) || 0 @@ -1267,7 +1277,10 @@ const loadAllData = async () => { dataType: '1' }) if (openRes && openRes.data && openRes.data.debitList) { - openCardData.value = openRes.data.debitList + openCardData.value = openRes.data.debitList || [] + console.log('储蓄卡开卡数据:', openCardData.value) + } else { + openCardData.value = [] } } catch (err) { // 忽略错误