fix(打卡页面): 修复选中全部作业时不显示打卡状态的问题
当用户选中全部作业时,跳过打卡状态检查逻辑,避免显示错误的打卡状态
Showing
1 changed file
with
36 additions
and
33 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-05-29 15:34:17 | 2 | * @Date: 2025-05-29 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-18 09:51:27 | 4 | + * @LastEditTime: 2025-12-18 10:01:20 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -266,41 +266,44 @@ const formatter = (day) => { | ... | @@ -266,41 +266,44 @@ const formatter = (day) => { |
| 266 | return day; | 266 | return day; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | - // 检查当前日期是否在签到日期列表中 | 269 | + // 如果选中的是全部作业,不执行打卡状态检查 |
| 270 | - if (checkin_days && checkin_days.length > 0) { | 270 | + if (selectedSubtaskId.value) { |
| 271 | - // 格式化当前日期为YYYY-MM-DD格式,与checkin_days中的格式匹配 | 271 | + // 检查当前日期是否在签到日期列表中 |
| 272 | - const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`; | 272 | + if (checkin_days && checkin_days.length > 0) { |
| 273 | - | 273 | + // 格式化当前日期为YYYY-MM-DD格式,与checkin_days中的格式匹配 |
| 274 | - // 检查是否已打卡 | 274 | + const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`; |
| 275 | - if (checkin_days.includes(formattedDate)) { | 275 | + |
| 276 | - day.type = 'selected'; | 276 | + // 检查是否已打卡 |
| 277 | - day.bottomInfo = '已打卡'; | 277 | + if (checkin_days.includes(formattedDate)) { |
| 278 | - // 如果是当前选中的已打卡日期,使用特殊样式 | 278 | + day.type = 'selected'; |
| 279 | - if (selectedDate.value === formattedDate) { | 279 | + day.bottomInfo = '已打卡'; |
| 280 | - day.className = 'calendar-selected'; | 280 | + // 如果是当前选中的已打卡日期,使用特殊样式 |
| 281 | - } else { | 281 | + if (selectedDate.value === formattedDate) { |
| 282 | - day.className = 'calendar-checkin'; | 282 | + day.className = 'calendar-selected'; |
| 283 | + } else { | ||
| 284 | + day.className = 'calendar-checkin'; | ||
| 285 | + } | ||
| 286 | + } | ||
| 283 | } | 287 | } |
| 284 | - } | ||
| 285 | - } | ||
| 286 | 288 | ||
| 287 | - // 检查当前日期是否在补卡日期列表中 | 289 | + // 检查当前日期是否在补卡日期列表中 |
| 288 | - if (fill_checkin_days && fill_checkin_days.length > 0) { | 290 | + if (fill_checkin_days && fill_checkin_days.length > 0) { |
| 289 | - // 格式化当前日期为YYYY-MM-DD格式,与fill_checkin_days中的格式匹配 | 291 | + // 格式化当前日期为YYYY-MM-DD格式,与fill_checkin_days中的格式匹配 |
| 290 | - const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`; | 292 | + const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${date.toString().padStart(2, '0')}`; |
| 291 | - // 检查是否已补卡 | 293 | + // 检查是否已补卡 |
| 292 | - if (fill_checkin_days.includes(formattedDate)) { | 294 | + if (fill_checkin_days.includes(formattedDate)) { |
| 293 | - // 如果是当前选中的已补卡日期,使用特殊样式 | 295 | + // 如果是当前选中的已补卡日期,使用特殊样式 |
| 294 | - day.type = 'selected'; | 296 | + day.type = 'selected'; |
| 295 | - day.bottomInfo = '待补卡'; | 297 | + day.bottomInfo = '待补卡'; |
| 296 | - if (selectedDate.value === formattedDate) { | 298 | + if (selectedDate.value === formattedDate) { |
| 297 | - day.className = 'calendar-selected'; | 299 | + day.className = 'calendar-selected'; |
| 298 | - // 选中的是补卡日期 | 300 | + // 选中的是补卡日期 |
| 299 | - isPatchCheckin.value = true; | 301 | + isPatchCheckin.value = true; |
| 300 | - } else { | 302 | + } else { |
| 301 | - day.className = 'calendar-fill-checkin'; | 303 | + day.className = 'calendar-fill-checkin'; |
| 304 | + } | ||
| 305 | + } | ||
| 302 | } | 306 | } |
| 303 | - } | ||
| 304 | } | 307 | } |
| 305 | 308 | ||
| 306 | // 选中今天的日期 | 309 | // 选中今天的日期 | ... | ... |
-
Please register or login to post a comment