无人机管理后台前端(已迁走)
张含笑
2025-07-23 f234c41165410e8ff8711c3f61fa140877447089
feat:六月样式为六行
1 files modified
18 ■■■■ changed files
src/views/wel/components/calendarBox.vue 18 ●●●● patch | view | raw | blame | history
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(() => {
  // 初始化时如果是当前月份,选中当天;否则不选中