From 85a447b9afbb1126f3aa85e995c3d3aab904c6ec Mon Sep 17 00:00:00 2001 From: digua Date: Sun, 12 Jul 2026 13:59:19 +0800 Subject: [PATCH] feat(insight): refine annual activity overview --- .../components/AnnualCalendarGrid.vue | 9 +++--- .../components/AnnualInsightBoard.vue | 13 -------- src/pages/insight/annual-summary/index.vue | 30 +++++++++---------- 3 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/pages/insight/annual-summary/components/AnnualCalendarGrid.vue b/src/pages/insight/annual-summary/components/AnnualCalendarGrid.vue index cf14ec26..425673ee 100644 --- a/src/pages/insight/annual-summary/components/AnnualCalendarGrid.vue +++ b/src/pages/insight/annual-summary/components/AnnualCalendarGrid.vue @@ -34,8 +34,9 @@ const months = computed(() => { const start = startDate.value const end = endDate.value const result: CalendarMonth[] = [] - const cursor = new Date(start.getFullYear(), start.getMonth(), 1) - const lastMonth = new Date(end.getFullYear(), end.getMonth(), 1) + const year = props.range.year ?? start.getFullYear() + const cursor = props.range.mode === 'year' ? new Date(year, 0, 1) : new Date(start.getFullYear(), start.getMonth(), 1) + const lastMonth = props.range.mode === 'year' ? new Date(year, 11, 1) : new Date(end.getFullYear(), end.getMonth(), 1) while (cursor <= lastMonth) { const year = cursor.getFullYear() @@ -76,12 +77,12 @@ function startOfDay(date: Date): Date {