From 97d8e99689d6f96ae9aac2860e40eb567804d341 Mon Sep 17 00:00:00 2001 From: QDKF Date: Thu, 25 Sep 2025 20:01:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E5=92=8C=E7=8F=AD=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/message.ts | 28 + src/api/modules/teachCourse.ts | 85 +++ src/components/teacher/ClassManagement.vue | 313 +++++--- src/router/index.ts | 6 + src/views/teacher/message/MessageDetail.vue | 669 ++++++++++++++++++ .../message/components/CommentLikes.vue | 62 +- .../message/components/FavoriteMessages.vue | 52 ++ .../message/components/SystemMessages.vue | 20 +- 8 files changed, 1152 insertions(+), 83 deletions(-) create mode 100644 src/views/teacher/message/MessageDetail.vue diff --git a/src/api/modules/message.ts b/src/api/modules/message.ts index b2eae5c..76e1a5a 100644 --- a/src/api/modules/message.ts +++ b/src/api/modules/message.ts @@ -423,6 +423,34 @@ class MessageApi { } } } + + /** + * 获取消息详情 + * @param sendId 消息发送ID + * @returns Promise> + */ + async getMessageDetail(sendId: string): Promise> { + return request({ + url: '/sys/sysAnnouncementSend/getOne', + method: 'GET', + params: { sendId } + }) + } + + /** + * 标记系统消息为已读 + * @param sendId 消息发送ID + * @returns Promise> + */ + async markSystemMessageAsRead(sendId: string): Promise> { + return request({ + url: '/aiol/message/readOne', + method: 'GET', + params: { + sendId + } + }) + } } export default new MessageApi() \ No newline at end of file diff --git a/src/api/modules/teachCourse.ts b/src/api/modules/teachCourse.ts index 035cbe2..fe00978 100644 --- a/src/api/modules/teachCourse.ts +++ b/src/api/modules/teachCourse.ts @@ -820,6 +820,31 @@ export interface CreatedStudentsRequest { classId: string; } +export interface BatchTransferResponse { + notFoundStudentIds: string[]; + originalClassId: string; + alreadyInNewClassStudentIds: string[]; + failCount: number; + notFoundCount: number; + newClassId: string; + successCount: number; + successStudentIds: string[]; + totalCount: number; + alreadyInNewClassCount: number; + failStudentIds: string[]; +} + +export interface BatchRemoveResponse { + notFoundStudentIds: string[]; + classId: string; + failCount: number; + notFoundCount: number; + successCount: number; + successStudentIds: string[]; + totalCount: number; + failStudentIds: string[]; +} + export class ClassApi { /** * 创建班级 @@ -896,6 +921,66 @@ export class ClassApi { }); } + /** + * 批量调班 + */ + static async batchTransfer(data: { + studentIds: string[]; + originalClassId: string; + newClassId: string; + }): Promise> { + return ApiRequest.post('/aiol/aiolClassStudent/batchTransfer', data); + } + + /** + * 批量移除学生(使用单个移除接口循环调用) + */ + static async batchRemoveStudents(data: { + studentIds: string[]; + classId: string; + }): Promise> { + const { studentIds, classId } = data; + const results = { + successCount: 0, + failCount: 0, + notFoundCount: 0, + successStudentIds: [] as string[], + failStudentIds: [] as string[], + notFoundStudentIds: [] as string[], + totalCount: studentIds.length, + classId + }; + + // 循环调用单个移除接口 + for (const studentId of studentIds) { + try { + const response = await this.removeStudent(classId, studentId); + if (response.data && (response.data.success || response.data.code === 200)) { + results.successCount++; + results.successStudentIds.push(studentId); + } else { + results.failCount++; + results.failStudentIds.push(studentId); + } + } catch (error: any) { + console.error(`移除学生 ${studentId} 失败:`, error); + if (error.response && error.response.status === 404) { + results.notFoundCount++; + results.notFoundStudentIds.push(studentId); + } else { + results.failCount++; + results.failStudentIds.push(studentId); + } + } + } + + return { + code: 200, + message: '批量移除完成', + data: results as any + }; + } + /** * 获取文件下载链接 */ diff --git a/src/components/teacher/ClassManagement.vue b/src/components/teacher/ClassManagement.vue index 4a73fcc..2bfa953 100644 --- a/src/components/teacher/ClassManagement.vue +++ b/src/components/teacher/ClassManagement.vue @@ -79,9 +79,8 @@ - +