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 @@ - +