Showing
2 changed files
with
10 additions
and
5 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-01-25 15:34:17 | 2 | * @Date: 2025-01-25 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-18 23:38:02 | 4 | + * @LastEditTime: 2025-12-18 23:45:18 |
| 5 | * @FilePath: /mlaj/src/components/ui/CollapsibleCalendar.vue | 5 | * @FilePath: /mlaj/src/components/ui/CollapsibleCalendar.vue |
| 6 | * @Description: 可折叠日历组件 | 6 | * @Description: 可折叠日历组件 |
| 7 | --> | 7 | --> | ... | ... |
| 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 22:58:48 | 4 | + * @LastEditTime: 2025-12-18 23:48:47 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -517,9 +517,14 @@ const delCheckin = (post) => { | ... | @@ -517,9 +517,14 @@ const delCheckin = (post) => { |
| 517 | if (code) { | 517 | if (code) { |
| 518 | // 删除成功后,刷新页面 | 518 | // 删除成功后,刷新页面 |
| 519 | showSuccessToast('删除成功'); | 519 | showSuccessToast('删除成功'); |
| 520 | - // router.go(0); | 520 | + |
| 521 | - // 删除post_id相应的数据 | 521 | + // 优化:使用 splice 替代 filter,避免大数组重新分配内存,性能更好 |
| 522 | - checkinDataList.value = checkinDataList.value.filter(item => item.id !== post.id); | 522 | + // checkinDataList.value = checkinDataList.value.filter(item => item.id !== post.id); |
| 523 | + const index = checkinDataList.value.findIndex(item => item.id === post.id); | ||
| 524 | + if (index > -1) { | ||
| 525 | + checkinDataList.value.splice(index, 1); | ||
| 526 | + } | ||
| 527 | + | ||
| 523 | // 检查是否还可以打卡 | 528 | // 检查是否还可以打卡 |
| 524 | const current_date = route.query.date; | 529 | const current_date = route.query.date; |
| 525 | if (current_date) { | 530 | if (current_date) { | ... | ... |
-
Please register or login to post a comment