hookehuyr

fix(打卡页面): 修复选中全部作业时不显示打卡状态的问题

当用户选中全部作业时,跳过打卡状态检查逻辑,避免显示错误的打卡状态
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-18 09:51:27
* @LastEditTime: 2025-12-18 10:01:20
* @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
* @Description: 文件描述
-->
......@@ -266,41 +266,44 @@ const formatter = (day) => {
return day;
}
// 检查当前日期是否在签到日期列表中
if (checkin_days && checkin_days.length > 0) {
// 格式化当前日期为YYYY-MM-DD格式,与checkin_days中的格式匹配
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`;
// 检查是否已打卡
if (checkin_days.includes(formattedDate)) {
day.type = 'selected';
day.bottomInfo = '已打卡';
// 如果是当前选中的已打卡日期,使用特殊样式
if (selectedDate.value === formattedDate) {
day.className = 'calendar-selected';
} else {
day.className = 'calendar-checkin';
// 如果选中的是全部作业,不执行打卡状态检查
if (selectedSubtaskId.value) {
// 检查当前日期是否在签到日期列表中
if (checkin_days && checkin_days.length > 0) {
// 格式化当前日期为YYYY-MM-DD格式,与checkin_days中的格式匹配
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`;
// 检查是否已打卡
if (checkin_days.includes(formattedDate)) {
day.type = 'selected';
day.bottomInfo = '已打卡';
// 如果是当前选中的已打卡日期,使用特殊样式
if (selectedDate.value === formattedDate) {
day.className = 'calendar-selected';
} else {
day.className = 'calendar-checkin';
}
}
}
}
}
// 检查当前日期是否在补卡日期列表中
if (fill_checkin_days && fill_checkin_days.length > 0) {
// 格式化当前日期为YYYY-MM-DD格式,与fill_checkin_days中的格式匹配
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`;
// 检查是否已补卡
if (fill_checkin_days.includes(formattedDate)) {
// 如果是当前选中的已补卡日期,使用特殊样式
day.type = 'selected';
day.bottomInfo = '待补卡';
if (selectedDate.value === formattedDate) {
day.className = 'calendar-selected';
// 选中的是补卡日期
isPatchCheckin.value = true;
} else {
day.className = 'calendar-fill-checkin';
// 检查当前日期是否在补卡日期列表中
if (fill_checkin_days && fill_checkin_days.length > 0) {
// 格式化当前日期为YYYY-MM-DD格式,与fill_checkin_days中的格式匹配
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`;
// 检查是否已补卡
if (fill_checkin_days.includes(formattedDate)) {
// 如果是当前选中的已补卡日期,使用特殊样式
day.type = 'selected';
day.bottomInfo = '待补卡';
if (selectedDate.value === formattedDate) {
day.className = 'calendar-selected';
// 选中的是补卡日期
isPatchCheckin.value = true;
} else {
day.className = 'calendar-fill-checkin';
}
}
}
}
}
// 选中今天的日期
......