From 82ae528785eb5cb75fcac4638cf7381cf02de9dc Mon Sep 17 00:00:00 2001 From: QDKF Date: Wed, 24 Sep 2025 20:49:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=BE=E7=A8=8B=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=9A=E8=AF=BE=E7=A8=8B=E4=BB=8B=E7=BB=8D?= =?UTF-8?q?=EF=BC=8C=E8=AF=BE=E7=A8=8B=E4=BB=8B=E7=BB=8D=EF=BC=8C=E6=95=99?= =?UTF-8?q?=E5=AD=A6=E5=9B=A2=E9=98=9F=EF=BC=8C=E7=AB=A0=E8=8A=82=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E8=AF=84=E8=AE=BA=E6=8E=A5=E5=85=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3;=20=E8=AF=BE=E7=A8=8B=E5=86=85=E5=AE=B9=EF=BC=8C?= =?UTF-8?q?=E5=AD=97=E5=B9=95=E5=88=97=E8=A1=A8=E6=8E=A5=E5=85=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/chat.ts | 9 + src/api/modules/comment.ts | 88 ++- src/api/modules/course.ts | 16 +- src/api/types.ts | 2 + .../teacher/CourseContentManagement.vue | 263 +++++-- src/components/teacher/SubtitleManagement.vue | 256 +++++-- src/views/teacher/course/CourseDetail.vue | 188 ++++- .../teacher/course/GeneralManagement.vue | 4 +- src/views/teacher/course/tabs/ChapterList.vue | 364 ++++++---- .../teacher/course/tabs/CourseComments.vue | 676 +++++++++++++++--- src/views/teacher/course/tabs/CourseIntro.vue | 172 ++++- .../teacher/course/tabs/TeachingTeam.vue | 33 +- .../components/NotificationMessages.vue | 56 +- 13 files changed, 1672 insertions(+), 455 deletions(-) diff --git a/src/api/modules/chat.ts b/src/api/modules/chat.ts index 8a09d42..e01d0e2 100644 --- a/src/api/modules/chat.ts +++ b/src/api/modules/chat.ts @@ -277,6 +277,15 @@ export const ChatApi = { return ApiRequest.post(`/aiol/aiolChat/${chatId}/update_last_read/${messageId}`) }, + /** + * 退出群聊 + * DELETE /aiol/aiolChat/{chatId}/exit + * 退出指定的群聊会话 + */ + exitChat: (chatId: string): Promise> => { + return ApiRequest.delete(`/aiol/aiolChat/${chatId}/exit`) + }, + /** * 通用文件上传 * POST /sys/common/upload diff --git a/src/api/modules/comment.ts b/src/api/modules/comment.ts index 355ee33..cc06670 100644 --- a/src/api/modules/comment.ts +++ b/src/api/modules/comment.ts @@ -11,13 +11,28 @@ import type { */ export class CommentApi { // 获取课程评论 - static getCourseComments(courseId: number, params?: { + static async getCourseComments(courseId: number, params?: { page?: number pageSize?: number sortBy?: 'newest' | 'oldest' | 'rating' | 'helpful' rating?: number - }): Promise>> { - return ApiRequest.get(`/courses/${courseId}/comments`, params) + }): Promise> { + try { + console.log('🚀 获取课程评论:', { courseId, params }) + + // 使用正确的API路径 - 根据用户提供的接口 + const response = await ApiRequest.get(`/aiol/aiolComment/course/${courseId}/list`, { + pageNo: params?.page || 1, + pageSize: params?.pageSize || 20, + ...params + }) + + console.log('✅ 获取课程评论成功:', response) + return response + } catch (error) { + console.error('❌ 获取课程评论失败:', error) + throw error + } } // 获取课时评论 @@ -48,12 +63,54 @@ export class CommentApi { } // 添加课程评论 - static addCourseComment(courseId: number, data: { + static async addCourseComment(courseId: number, data: { content: string rating?: number parentId?: number - }): Promise> { - return ApiRequest.post(`/courses/${courseId}/comments`, data) + }): Promise> { + try { + console.log('🚀 添加课程评论:', { courseId, data }) + + // 使用正确的API路径 + const response = await ApiRequest.post(`/aiol/aiolComment/course/${courseId}/add`, { + content: data.content, + imgs: '', + parentId: data.parentId + }) + + console.log('✅ 添加课程评论成功:', response) + return response + } catch (error) { + console.error('❌ 添加课程评论失败:', error) + throw error + } + } + + // 回复评论 - 使用专门的回复接口 + static async replyComment(data: { + content: string + targetType: 'course' | 'lesson' | 'comment' + targetId: string + parentId?: number + }): Promise> { + try { + console.log('🚀 回复评论:', data) + + // 使用专门的回复接口 + const response = await ApiRequest.post(`/aiol/aiolComment/add`, { + content: data.content, + targetType: data.targetType, + targetId: data.targetId, + parentId: data.parentId, + imgs: '' + }) + + console.log('✅ 回复评论成功:', response) + return response + } catch (error) { + console.error('❌ 回复评论失败:', error) + throw error + } } // 添加课时评论 @@ -78,11 +135,16 @@ export class CommentApi { } // 点赞评论 - static likeComment(commentId: number): Promise> { - return ApiRequest.post(`/comments/${commentId}/like`) + static async likeComment(commentId: string | number): Promise> { + try { + console.log('🚀 点赞评论:', commentId) + const response = await ApiRequest.get(`/aiol/aiolComment/like/${commentId}`) + console.log('✅ 点赞评论成功:', response) + return response + } catch (error) { + console.error('❌ 点赞评论失败:', error) + throw error + } } // 取消点赞评论 @@ -211,6 +273,6 @@ export class CommentApi { }>>> { return ApiRequest.get('/comments/reported', params) } -} +}export default CommentApi + -export default CommentApi diff --git a/src/api/modules/course.ts b/src/api/modules/course.ts index e03ef60..3eef8f7 100644 --- a/src/api/modules/course.ts +++ b/src/api/modules/course.ts @@ -157,7 +157,9 @@ export class CourseApi { question: item.question || '', video: item.video || '', // 添加AI伴学模式字段 - izAi: item.izAi + izAi: item.izAi, + // 添加学期字段 + semester: item.semester || '' })) return { @@ -217,6 +219,8 @@ export class CourseApi { } // 转换后端数据格式为前端格式 const item: BackendCourseItem = response.data.result + console.log('🔍 后端原始课程数据:', item) + console.log('📅 后端学期字段:', item.semester) const course: Course = { id: item.id, // 保持字符串格式,不转换为数字 title: item.name || '', @@ -259,7 +263,9 @@ export class CourseApi { createdAt: this.formatTimestamp(item.createTime), updatedAt: this.formatTimestamp(item.updateTime), // 添加AI伴学模式字段 - izAi: item.izAi + izAi: item.izAi, + // 添加学期字段 + semester: item.semester || '' } as any return { @@ -403,6 +409,8 @@ export class CourseApi { } // 转换后端数据格式为前端格式 const item: BackendCourseItem = response.data.result + console.log('🔍 后端原始课程数据:', item) + console.log('📅 后端学期字段:', item.semester) const course: Course = { id: item.id, // 保持字符串格式,不转换为数字 title: item.name || '', @@ -445,7 +453,9 @@ export class CourseApi { createdAt: this.formatTimestamp(item.createTime), updatedAt: this.formatTimestamp(item.updateTime), // 添加AI伴学模式字段 - izAi: item.izAi + izAi: item.izAi, + // 添加学期字段 + semester: item.semester || '' } as any return { diff --git a/src/api/types.ts b/src/api/types.ts index 2b267fd..d29d6cc 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -165,6 +165,7 @@ export interface Course { createdAt: string updatedAt: string publishedAt?: string + semester?: string // 新增学期字段 } // 后端实际返回的课程数据格式 @@ -333,6 +334,7 @@ export interface BackendCourseItem { updateBy: string updateTime: string teacherList: BackendInstructor[] // 新增讲师列表字段 + semester?: string // 新增学期字段 } // 后端课程列表响应格式 diff --git a/src/components/teacher/CourseContentManagement.vue b/src/components/teacher/CourseContentManagement.vue index 41c34ca..28384e0 100644 --- a/src/components/teacher/CourseContentManagement.vue +++ b/src/components/teacher/CourseContentManagement.vue @@ -2,43 +2,40 @@
- - + + + + 添加总结 - - + + 搜索 + + 清空 + + + 刷新 +
- +
- + @@ -46,12 +43,7 @@ - +