hookehuyr

feat(teacher): 添加老师审批打卡功能

实现老师审批打卡的API接口和前端逻辑
移除不再使用的DatetimePicker组件和编辑/删除动态功能
1 /* 1 /*
2 * @Date: 2025-06-06 09:26:16 2 * @Date: 2025-06-06 09:26:16
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-06-25 11:26:10 4 + * @LastEditTime: 2025-06-25 11:41:56
5 * @FilePath: /mlaj/src/api/checkin.js 5 * @FilePath: /mlaj/src/api/checkin.js
6 * @Description: 签到模块相关接口 6 * @Description: 签到模块相关接口
7 */ 7 */
...@@ -19,6 +19,7 @@ const Api = { ...@@ -19,6 +19,7 @@ const Api = {
19 TASK_UPLOAD_LIKE: '/srv/?a=checkin&t=like', 19 TASK_UPLOAD_LIKE: '/srv/?a=checkin&t=like',
20 TASK_UPLOAD_DISLIKE: '/srv/?a=checkin&t=dislike', 20 TASK_UPLOAD_DISLIKE: '/srv/?a=checkin&t=dislike',
21 CHECKIN_TEACHER_LIST: '/srv/?a=checkin&t=teacher_list', 21 CHECKIN_TEACHER_LIST: '/srv/?a=checkin&t=teacher_list',
22 + CHECKIN_TEACHER_REVIEW: '/srv/?a=checkin&t=teacher_review',
22 } 23 }
23 24
24 /** 25 /**
...@@ -117,3 +118,11 @@ export const dislikeUploadTaskInfoAPI = (params) => fn(fetch.post(Api.TASK_UPLO ...@@ -117,3 +118,11 @@ export const dislikeUploadTaskInfoAPI = (params) => fn(fetch.post(Api.TASK_UPLO
117 * @returns 118 * @returns
118 */ 119 */
119 export const getCheckinTeacherListAPI = (params) => fn(fetch.get(Api.CHECKIN_TEACHER_LIST, params)) 120 export const getCheckinTeacherListAPI = (params) => fn(fetch.get(Api.CHECKIN_TEACHER_LIST, params))
121 +
122 +/**
123 + * @description: 老师审批打卡
124 + * @param checkin_id 打卡动态ID
125 + * @param status 审批状态 5=通过,7=拒绝
126 + * @returns
127 + */
128 +export const checkinTaskReviewAPI = (params) => fn(fetch.post(Api.CHECKIN_TEACHER_REVIEW, params))
......
...@@ -40,7 +40,6 @@ declare module 'vue' { ...@@ -40,7 +40,6 @@ declare module 'vue' {
40 VanCol: typeof import('vant/es')['Col'] 40 VanCol: typeof import('vant/es')['Col']
41 VanConfigProvider: typeof import('vant/es')['ConfigProvider'] 41 VanConfigProvider: typeof import('vant/es')['ConfigProvider']
42 VanDatePicker: typeof import('vant/es')['DatePicker'] 42 VanDatePicker: typeof import('vant/es')['DatePicker']
43 - VanDatetimePicker: typeof import('vant/es')['DatetimePicker']
44 VanDialog: typeof import('vant/es')['Dialog'] 43 VanDialog: typeof import('vant/es')['Dialog']
45 VanDivider: typeof import('vant/es')['Divider'] 44 VanDivider: typeof import('vant/es')['Divider']
46 VanDropdownItem: typeof import('vant/es')['DropdownItem'] 45 VanDropdownItem: typeof import('vant/es')['DropdownItem']
......
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-06-25 11:26:57 4 + * @LastEditTime: 2025-06-25 11:47:02
5 * @FilePath: /mlaj/src/views/teacher/checkinPage.vue 5 * @FilePath: /mlaj/src/views/teacher/checkinPage.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -192,7 +192,7 @@ import AudioPlayer from "@/components/ui/AudioPlayer.vue"; ...@@ -192,7 +192,7 @@ import AudioPlayer from "@/components/ui/AudioPlayer.vue";
192 import { useTitle } from '@vueuse/core'; 192 import { useTitle } from '@vueuse/core';
193 import dayjs from 'dayjs'; 193 import dayjs from 'dayjs';
194 194
195 -import { getTaskDetailAPI, getCheckinTeacherListAPI, delUploadTaskInfoAPI, likeUploadTaskInfoAPI, dislikeUploadTaskInfoAPI } from "@/api/checkin"; 195 +import { getTaskDetailAPI, getCheckinTeacherListAPI, checkinTaskReviewAPI, likeUploadTaskInfoAPI, dislikeUploadTaskInfoAPI } from "@/api/checkin";
196 import { getTeacherGradeClassListAPI } from "@/api/teacher"; 196 import { getTeacherGradeClassListAPI } from "@/api/teacher";
197 197
198 const route = useRoute() 198 const route = useRoute()
...@@ -625,9 +625,9 @@ const closeAuditDialog = () => { ...@@ -625,9 +625,9 @@ const closeAuditDialog = () => {
625 const handleAudit = async (isApproved) => { 625 const handleAudit = async (isApproved) => {
626 try { 626 try {
627 // 这里可以调用API进行审核操作 627 // 这里可以调用API进行审核操作
628 - console.log('审核操作:', { 628 + const { code, data } = await checkinTaskReviewAPI({
629 - postId: currentAuditPost.value.id, 629 + checkin_id: currentAuditPost.value.id,
630 - isApproved: isApproved 630 + status: isApproved ? 5 : 7
631 }) 631 })
632 632
633 // 更新本地状态 633 // 更新本地状态
...@@ -661,61 +661,6 @@ const formatCommentTime = (timeString) => { ...@@ -661,61 +661,6 @@ const formatCommentTime = (timeString) => {
661 }) 661 })
662 } 662 }
663 663
664 -const editCheckin = (post) => {
665 - if (post.file_type === 'image') {
666 - router.push({
667 - path: '/checkin/image',
668 - query: {
669 - post_id: post.id,
670 - type: 'image',
671 - status: 'edit',
672 - }
673 - })
674 - } else if (post.file_type === 'video') {
675 - router.push({
676 - path: '/checkin/video',
677 - query: {
678 - post_id: post.id,
679 - type: 'video',
680 - status: 'edit',
681 - }
682 - })
683 - } else if (post.file_type === 'audio') {
684 - router.push({
685 - path: '/checkin/audio',
686 - query: {
687 - post_id: post.id,
688 - type: 'audio',
689 - status: 'edit',
690 - }
691 - })
692 - }
693 -}
694 -
695 -const delCheckin = (post) => {
696 - showConfirmDialog({
697 - title: '温馨提示',
698 - message: '您是否确定要删除该动态?',
699 - confirmButtonColor: '#4caf50',
700 - })
701 - .then(async () => {
702 - // 调用接口
703 - const { code, data } = await delUploadTaskInfoAPI({ i: post.id });
704 - if (code) {
705 - // 删除成功后,刷新页面
706 - showSuccessToast('删除成功');
707 - // router.go(0);
708 - // 删除post_id相应的数据
709 - checkinDataList.value = checkinDataList.value.filter(item => item.id !== post.id);
710 - } else {
711 - showErrorToast('删除失败');
712 - }
713 - })
714 - .catch(() => {
715 - // on cancel
716 - });
717 -}
718 -
719 const taskDetail = ref({}); 664 const taskDetail = ref({});
720 const myCheckinDates = ref([]); 665 const myCheckinDates = ref([]);
721 const checkinDataList = ref([]); 666 const checkinDataList = ref([]);
......