From f234c41165410e8ff8711c3f61fa140877447089 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Wed, 23 Jul 2025 17:06:45 +0800
Subject: [PATCH] feat:六月样式为六行

---
 src/views/wel/components/calendarBox.vue |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/views/wel/components/calendarBox.vue b/src/views/wel/components/calendarBox.vue
index d687812..20fe90c 100644
--- a/src/views/wel/components/calendarBox.vue
+++ b/src/views/wel/components/calendarBox.vue
@@ -208,12 +208,20 @@
     });
   }
 };
-const weeksNeeded = computed(() => {
-  const firstDay = dayjs(currentMonth.value).startOf('month').day();
-  const days = dayjs(currentMonth.value).daysInMonth();
-  return Math.ceil((firstDay + days) / 7);
-});
 
+const weeksNeeded = computed(() => {
+  const date = dayjs(currentMonth.value);
+  const firstDay = date.startOf('month').day(); // 0-6 (周日到周六)
+  const days = date.daysInMonth();
+
+  // 强制 2025 年 6 月显示六行
+  if (date.year() === 2025 && date.month() === 5) {
+    return 6;
+  }
+
+  // 其他月份按原逻辑计算
+  return Math.ceil((firstDay + days) / 7);
+})
 const isSixRows = computed(() => weeksNeeded.value > 5);
 onMounted(() => {
   // 初始化时如果是当前月份,选中当天;否则不选中

--
Gitblit v1.9.3