Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-06-25 11:47:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4979faa6f31c214c7d4e527891a52661698d18df
4979faa6
1 parent
b2e0556b
feat(teacher): 添加老师审批打卡功能
实现老师审批打卡的API接口和前端逻辑 移除不再使用的DatetimePicker组件和编辑/删除动态功能
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
62 deletions
src/api/checkin.js
src/components.d.ts
src/views/teacher/checkinPage.vue
src/api/checkin.js
View file @
4979faa
/*
* @Date: 2025-06-06 09:26:16
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-25 11:
26:10
* @LastEditTime: 2025-06-25 11:
41:56
* @FilePath: /mlaj/src/api/checkin.js
* @Description: 签到模块相关接口
*/
...
...
@@ -19,6 +19,7 @@ const Api = {
TASK_UPLOAD_LIKE
:
'/srv/?a=checkin&t=like'
,
TASK_UPLOAD_DISLIKE
:
'/srv/?a=checkin&t=dislike'
,
CHECKIN_TEACHER_LIST
:
'/srv/?a=checkin&t=teacher_list'
,
CHECKIN_TEACHER_REVIEW
:
'/srv/?a=checkin&t=teacher_review'
,
}
/**
...
...
@@ -117,3 +118,11 @@ export const dislikeUploadTaskInfoAPI = (params) => fn(fetch.post(Api.TASK_UPLO
* @returns
*/
export
const
getCheckinTeacherListAPI
=
(
params
)
=>
fn
(
fetch
.
get
(
Api
.
CHECKIN_TEACHER_LIST
,
params
))
/**
* @description: 老师审批打卡
* @param checkin_id 打卡动态ID
* @param status 审批状态 5=通过,7=拒绝
* @returns
*/
export
const
checkinTaskReviewAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
CHECKIN_TEACHER_REVIEW
,
params
))
...
...
src/components.d.ts
View file @
4979faa
...
...
@@ -40,7 +40,6 @@ declare module 'vue' {
VanCol
:
typeof
import
(
'vant/es'
)[
'Col'
]
VanConfigProvider
:
typeof
import
(
'vant/es'
)[
'ConfigProvider'
]
VanDatePicker
:
typeof
import
(
'vant/es'
)[
'DatePicker'
]
VanDatetimePicker
:
typeof
import
(
'vant/es'
)[
'DatetimePicker'
]
VanDialog
:
typeof
import
(
'vant/es'
)[
'Dialog'
]
VanDivider
:
typeof
import
(
'vant/es'
)[
'Divider'
]
VanDropdownItem
:
typeof
import
(
'vant/es'
)[
'DropdownItem'
]
...
...
src/views/teacher/checkinPage.vue
View file @
4979faa
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-25 11:
26:57
* @LastEditTime: 2025-06-25 11:
47:02
* @FilePath: /mlaj/src/views/teacher/checkinPage.vue
* @Description: 文件描述
-->
...
...
@@ -192,7 +192,7 @@ import AudioPlayer from "@/components/ui/AudioPlayer.vue";
import { useTitle } from '@vueuse/core';
import dayjs from 'dayjs';
import { getTaskDetailAPI, getCheckinTeacherListAPI,
delUploadTaskInfo
API, likeUploadTaskInfoAPI, dislikeUploadTaskInfoAPI } from "@/api/checkin";
import { getTaskDetailAPI, getCheckinTeacherListAPI,
checkinTaskReview
API, likeUploadTaskInfoAPI, dislikeUploadTaskInfoAPI } from "@/api/checkin";
import { getTeacherGradeClassListAPI } from "@/api/teacher";
const route = useRoute()
...
...
@@ -625,9 +625,9 @@ const closeAuditDialog = () => {
const handleAudit = async (isApproved) => {
try {
// 这里可以调用API进行审核操作
cons
ole.log('审核操作:',
{
postI
d: currentAuditPost.value.id,
isApproved: isApproved
cons
t { code, data } = await checkinTaskReviewAPI(
{
checkin_i
d: currentAuditPost.value.id,
status: isApproved ? 5 : 7
})
// 更新本地状态
...
...
@@ -661,61 +661,6 @@ const formatCommentTime = (timeString) => {
})
}
const editCheckin = (post) => {
if (post.file_type === 'image') {
router.push({
path: '/checkin/image',
query: {
post_id: post.id,
type: 'image',
status: 'edit',
}
})
} else if (post.file_type === 'video') {
router.push({
path: '/checkin/video',
query: {
post_id: post.id,
type: 'video',
status: 'edit',
}
})
} else if (post.file_type === 'audio') {
router.push({
path: '/checkin/audio',
query: {
post_id: post.id,
type: 'audio',
status: 'edit',
}
})
}
}
const delCheckin = (post) => {
showConfirmDialog({
title: '温馨提示',
message: '您是否确定要删除该动态?',
confirmButtonColor: '#4caf50',
})
.then(async () => {
// 调用接口
const { code, data } = await delUploadTaskInfoAPI({ i: post.id });
if (code) {
// 删除成功后,刷新页面
showSuccessToast('删除成功');
// router.go(0);
// 删除post_id相应的数据
checkinDataList.value = checkinDataList.value.filter(item => item.id !== post.id);
} else {
showErrorToast('删除失败');
}
})
.catch(() => {
// on cancel
});
}
const taskDetail = ref({});
const myCheckinDates = ref([]);
const checkinDataList = ref([]);
...
...
Please
register
or
login
to post a comment