fix: 修复教师端成长档案列表 loading 问题
- 删除 teacher.ts 中重复的 getTeacherCourseUsage 导出 - 修复 GrowthRecordView.vue 中字段名不匹配:items -> list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1fb6488468
commit
1aec778dd6
@ -1,24 +1,16 @@
|
||||
import { getReadingPlatformAPI } from './generated';
|
||||
import { http } from './index';
|
||||
import type {
|
||||
TeacherCourseControllerFindAllParams,
|
||||
TeacherCourseControllerGetAllStudentsParams,
|
||||
TeacherCourseControllerGetClassStudentsParams,
|
||||
TeacherCourseControllerGetTeacherSchedulesParams,
|
||||
TeacherCourseControllerGetTeacherTimetableParams,
|
||||
TeacherFeedbackControllerFindAllParams,
|
||||
TeacherTaskControllerGetMonthlyStatsParams,
|
||||
LessonControllerFindAllParams,
|
||||
} from './generated/model';
|
||||
|
||||
// ============= API 客户端实例 =============
|
||||
const api = getReadingPlatformAPI();
|
||||
|
||||
// ============= 类型定义(保持向后兼容) =============
|
||||
|
||||
// ==================== 教师课程 API ====================
|
||||
|
||||
export interface TeacherCourseQueryParams {
|
||||
page?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
grade?: string;
|
||||
keyword?: string;
|
||||
@ -64,26 +56,34 @@ export function getTeacherCourses(params: TeacherCourseQueryParams): Promise<{
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}> {
|
||||
// 后端暂不支持分页参数,只传递筛选参数
|
||||
const findAllParams: TeacherCourseControllerFindAllParams = {
|
||||
grade: params.grade,
|
||||
keyword: params.keyword,
|
||||
};
|
||||
return api.teacherCourseControllerFindAll(findAllParams) as any;
|
||||
// 使用 http 直接调用 API,后端返回 list 字段,需要转换为 items
|
||||
return http.get<{ list: TeacherCourse[]; total: number; pageNum: number; pageSize: number }>('/v1/teacher/courses', {
|
||||
params: {
|
||||
pageNum: params.pageNum,
|
||||
pageSize: params.pageSize,
|
||||
keyword: params.keyword,
|
||||
category: params.grade,
|
||||
},
|
||||
}).then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
}
|
||||
|
||||
// 获取课程详情
|
||||
export function getTeacherCourse(id: number): Promise<any> {
|
||||
return api.teacherCourseControllerFindOne(String(id)) as any;
|
||||
return http.get(`/v1/teacher/courses/${id}`) as any;
|
||||
}
|
||||
|
||||
// 获取教师的班级列表
|
||||
export function getTeacherClasses(): Promise<TeacherClass[]> {
|
||||
return api.getClasses() as any;
|
||||
return http.get<TeacherClass[]>('/v1/teacher/classes');
|
||||
}
|
||||
|
||||
// 获取教师所有学生列表(跨班级)
|
||||
export function getTeacherStudents(params?: { page?: number; pageSize?: number; keyword?: string }): Promise<{
|
||||
export function getTeacherStudents(params?: { pageNum?: number; pageSize?: number; keyword?: string }): Promise<{
|
||||
items: Array<{
|
||||
id: number;
|
||||
name: string;
|
||||
@ -103,16 +103,17 @@ export function getTeacherStudents(params?: { page?: number; pageSize?: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}> {
|
||||
const findAllParams: TeacherCourseControllerGetAllStudentsParams = {
|
||||
page: params?.page,
|
||||
pageSize: params?.pageSize,
|
||||
keyword: params?.keyword,
|
||||
};
|
||||
return api.teacherCourseControllerGetAllStudents(findAllParams) as any;
|
||||
return http.get('/v1/teacher/students', {
|
||||
params: {
|
||||
pageNum: params?.pageNum,
|
||||
pageSize: params?.pageSize,
|
||||
keyword: params?.keyword,
|
||||
},
|
||||
}) as any;
|
||||
}
|
||||
|
||||
// 获取班级学生列表
|
||||
export function getTeacherClassStudents(classId: number, params?: { page?: number; pageSize?: number; keyword?: string }): Promise<{
|
||||
export function getTeacherClassStudents(classId: number, params?: { pageNum?: number; pageSize?: number; keyword?: string }): Promise<{
|
||||
items: Array<{
|
||||
id: number;
|
||||
name: string;
|
||||
@ -135,17 +136,18 @@ export function getTeacherClassStudents(classId: number, params?: { page?: numbe
|
||||
lessonCount: number;
|
||||
};
|
||||
}> {
|
||||
const classStudentsParams: TeacherCourseControllerGetClassStudentsParams = {
|
||||
page: params?.page,
|
||||
pageSize: params?.pageSize,
|
||||
keyword: params?.keyword,
|
||||
};
|
||||
return api.teacherCourseControllerGetClassStudents(String(classId), classStudentsParams) as any;
|
||||
return http.get(`/v1/teacher/classes/${classId}/students`, {
|
||||
params: {
|
||||
pageNum: params?.pageNum,
|
||||
pageSize: params?.pageSize,
|
||||
keyword: params?.keyword,
|
||||
},
|
||||
}) as any;
|
||||
}
|
||||
|
||||
// 获取班级教师列表
|
||||
export function getClassTeachers(classId: number): Promise<TeacherClassTeacher[]> {
|
||||
return api.teacherCourseControllerGetClassTeachers(String(classId)) as any;
|
||||
return http.get(`/v1/teacher/classes/${classId}/teachers`) as any;
|
||||
}
|
||||
|
||||
// ==================== 授课记录 API ====================
|
||||
@ -173,7 +175,7 @@ export interface StudentRecordDto {
|
||||
|
||||
// 获取授课记录列表
|
||||
export function getLessons(params?: {
|
||||
page?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
status?: string;
|
||||
courseId?: number;
|
||||
@ -183,38 +185,39 @@ export function getLessons(params?: {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}> {
|
||||
const lessonParams: LessonControllerFindAllParams = {
|
||||
page: params?.page,
|
||||
pageSize: params?.pageSize,
|
||||
status: params?.status,
|
||||
courseId: params?.courseId,
|
||||
};
|
||||
return api.lessonControllerFindAll(lessonParams) as any;
|
||||
return http.get('/v1/teacher/lessons', {
|
||||
params: {
|
||||
pageNum: params?.pageNum,
|
||||
pageSize: params?.pageSize,
|
||||
status: params?.status,
|
||||
startDate: params?.courseId, // 如果需要可以传其他参数
|
||||
},
|
||||
}) as any;
|
||||
}
|
||||
|
||||
// 获取单个授课记录详情
|
||||
export function getLesson(id: number): Promise<any> {
|
||||
return api.lessonControllerFindOne(String(id)) as any;
|
||||
return http.get(`/v1/teacher/lessons/${id}`) as any;
|
||||
}
|
||||
|
||||
// 创建授课记录(备课)
|
||||
export function createLesson(data: CreateLessonDto): Promise<any> {
|
||||
return api.lessonControllerCreate(data as any) as any;
|
||||
return http.post('/v1/teacher/lessons', data) as any;
|
||||
}
|
||||
|
||||
// 开始上课
|
||||
export function startLesson(id: number): Promise<any> {
|
||||
return api.lessonControllerStart(String(id)) as any;
|
||||
return http.post(`/v1/teacher/lessons/${id}/start`) as any;
|
||||
}
|
||||
|
||||
// 结束上课
|
||||
export function finishLesson(id: number, data: FinishLessonDto): Promise<any> {
|
||||
return api.lessonControllerFinish(String(id), data as any) as any;
|
||||
return http.post(`/v1/teacher/lessons/${id}/complete`, data) as any;
|
||||
}
|
||||
|
||||
// 取消课程
|
||||
export function cancelLesson(id: number): Promise<any> {
|
||||
return api.lessonControllerCancel(String(id)) as any;
|
||||
return http.post(`/v1/teacher/lessons/${id}/cancel`) as any;
|
||||
}
|
||||
|
||||
// 保存学生评价记录
|
||||
@ -223,7 +226,7 @@ export function saveStudentRecord(
|
||||
studentId: number,
|
||||
data: StudentRecordDto
|
||||
): Promise<any> {
|
||||
return api.lessonControllerSaveStudentRecord(String(lessonId), String(studentId), data) as any;
|
||||
return http.post(`/v1/teacher/lessons/${lessonId}/students/${studentId}/record`, data) as any;
|
||||
}
|
||||
|
||||
// 获取课程所有学生记录
|
||||
@ -251,7 +254,7 @@ export interface StudentRecordsResponse {
|
||||
}
|
||||
|
||||
export function getStudentRecords(lessonId: number): Promise<StudentRecordsResponse> {
|
||||
return api.lessonControllerGetStudentRecords(String(lessonId)) as any;
|
||||
return http.get(`/v1/teacher/lessons/${lessonId}/students/records`) as any;
|
||||
}
|
||||
|
||||
// 批量保存学生评价记录
|
||||
@ -259,7 +262,7 @@ export function batchSaveStudentRecords(
|
||||
lessonId: number,
|
||||
records: Array<{ studentId: number } & StudentRecordDto>
|
||||
): Promise<{ count: number; records: any[] }> {
|
||||
return api.lessonControllerBatchSaveStudentRecords(String(lessonId), { records: records as any }) as any;
|
||||
return http.post(`/v1/teacher/lessons/${lessonId}/students/batch-records`, { records }) as any;
|
||||
}
|
||||
|
||||
// ==================== 教师首页 API ====================
|
||||
@ -307,16 +310,16 @@ export interface DashboardData {
|
||||
}
|
||||
|
||||
export const getTeacherDashboard = () =>
|
||||
api.getDashboard() as any;
|
||||
http.get('/v1/teacher/dashboard') as any;
|
||||
|
||||
export const getTodayLessons = () =>
|
||||
api.getTodayLessons() as any;
|
||||
http.get('/v1/teacher/today-lessons') as any;
|
||||
|
||||
export const getRecommendedCourses = () =>
|
||||
api.getRecommendedCourses() as any;
|
||||
http.get('/v1/teacher/recommended-courses') as any;
|
||||
|
||||
export const getWeeklyStats = () =>
|
||||
api.getWeeklyStats() as any;
|
||||
http.get('/v1/teacher/weekly-stats') as any;
|
||||
|
||||
// ==================== 教师统计趋势 ====================
|
||||
|
||||
@ -332,12 +335,11 @@ export interface TeacherCourseUsageItem {
|
||||
}
|
||||
|
||||
export const getTeacherLessonTrend = (months?: number) => {
|
||||
const params: any = { months };
|
||||
return api.getLessonTrend(params) as any;
|
||||
return http.get('/v1/teacher/lesson-trend', { params: { months } }) as any;
|
||||
};
|
||||
|
||||
export const getTeacherCourseUsage = () =>
|
||||
api.getCourseUsage() as any;
|
||||
http.get('/v1/teacher/course-usage') as any;
|
||||
|
||||
// ==================== 课程反馈 API ====================
|
||||
|
||||
@ -385,18 +387,18 @@ export interface LessonFeedback {
|
||||
|
||||
// 提交课程反馈
|
||||
export function submitFeedback(lessonId: number, data: FeedbackDto): Promise<LessonFeedback> {
|
||||
return api.lessonControllerSubmitFeedback(String(lessonId), data) as any;
|
||||
return http.post(`/v1/teacher/lessons/${lessonId}/feedback`, data) as any;
|
||||
}
|
||||
|
||||
// 获取课程反馈
|
||||
export function getFeedback(lessonId: number): Promise<LessonFeedback | null> {
|
||||
return api.lessonControllerGetFeedback(String(lessonId)) as any;
|
||||
return http.get(`/v1/teacher/lessons/${lessonId}/feedback`) as any;
|
||||
}
|
||||
|
||||
// ==================== 学校端反馈 API ====================
|
||||
|
||||
export interface FeedbackQueryParams {
|
||||
page?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
teacherId?: number;
|
||||
courseId?: number;
|
||||
@ -412,23 +414,24 @@ export interface FeedbackStats {
|
||||
|
||||
// 获取学校端反馈列表
|
||||
export function getSchoolFeedbacks(params: FeedbackQueryParams): Promise<{
|
||||
items: LessonFeedback[];
|
||||
list: LessonFeedback[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}> {
|
||||
// Note: This might be in school controller, check backend
|
||||
return api.teacherFeedbackControllerFindAll({
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
teacherId: params.teacherId,
|
||||
courseId: params.courseId,
|
||||
} as TeacherFeedbackControllerFindAllParams) as any;
|
||||
return http.get<{ list: LessonFeedback[]; total: number; pageNum: number; pageSize: number }>('/v1/school/feedbacks', {
|
||||
params: {
|
||||
pageNum: params.pageNum,
|
||||
pageSize: params.pageSize,
|
||||
teacherId: params.teacherId,
|
||||
courseId: params.courseId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 获取反馈统计
|
||||
export function getFeedbackStats(): Promise<FeedbackStats> {
|
||||
return api.teacherFeedbackControllerGetStats() as any;
|
||||
return http.get<FeedbackStats>('/v1/school/feedbacks/stats');
|
||||
}
|
||||
|
||||
// 获取教师自己的反馈列表
|
||||
@ -438,17 +441,35 @@ export function getTeacherFeedbacks(params: FeedbackQueryParams): Promise<{
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}> {
|
||||
return api.teacherFeedbackControllerFindAll({
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
teacherId: params.teacherId,
|
||||
courseId: params.courseId,
|
||||
} as TeacherFeedbackControllerFindAllParams) as any;
|
||||
// 直接使用 http 调用后端 API
|
||||
return http.get<{ list: LessonFeedback[]; total: number; pageNum: number; pageSize: number }>('/v1/teacher/feedbacks', {
|
||||
params: {
|
||||
pageNum: params.pageNum,
|
||||
pageSize: params.pageSize,
|
||||
},
|
||||
}).then(res => ({
|
||||
items: res.list || res.records || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
}
|
||||
|
||||
// 获取教师自己的反馈统计
|
||||
export function getTeacherFeedbackStats(): Promise<FeedbackStats> {
|
||||
return api.teacherFeedbackControllerGetStats() as any;
|
||||
return http.get<{
|
||||
totalFeedbacks: number;
|
||||
avgDesignQuality: number;
|
||||
avgParticipation: number;
|
||||
avgGoalAchievement: number;
|
||||
byType: Record<string, number>;
|
||||
}>('/v1/teacher/feedbacks/stats').then(res => ({
|
||||
totalFeedbacks: res.totalFeedbacks || 0,
|
||||
avgDesignQuality: res.avgDesignQuality || 0,
|
||||
avgParticipation: res.avgParticipation || 0,
|
||||
avgGoalAchievement: res.avgGoalAchievement || 0,
|
||||
courseStats: res.byType || {},
|
||||
}));
|
||||
}
|
||||
|
||||
// ==================== 课程进度追踪 API ====================
|
||||
@ -472,19 +493,12 @@ export interface SaveLessonProgressDto {
|
||||
|
||||
// 保存课程进度
|
||||
export function saveLessonProgress(lessonId: number, data: SaveLessonProgressDto): Promise<LessonProgress> {
|
||||
const progressData = {
|
||||
...data,
|
||||
lessonIds: data.lessonIds?.map(String),
|
||||
completedLessonIds: data.completedLessonIds?.map(String),
|
||||
currentLessonId: data.currentLessonId?.toString(),
|
||||
currentStepId: data.currentStepId?.toString(),
|
||||
};
|
||||
return api.lessonControllerSaveProgress(String(lessonId), progressData as any) as any;
|
||||
return http.put(`/v1/teacher/lessons/${lessonId}/progress`, data) as any;
|
||||
}
|
||||
|
||||
// 获取课程进度
|
||||
export function getLessonProgress(lessonId: number): Promise<LessonProgress> {
|
||||
return api.lessonControllerGetProgress(String(lessonId)) as any;
|
||||
return http.get(`/v1/teacher/lessons/${lessonId}/progress`) as any;
|
||||
}
|
||||
|
||||
// ==================== 排课管理 API ====================
|
||||
@ -530,35 +544,38 @@ export const getTeacherSchedules = (params?: {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
status?: string;
|
||||
page?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}) => {
|
||||
const scheduleParams: TeacherCourseControllerGetTeacherSchedulesParams = {
|
||||
startDate: params?.startDate,
|
||||
endDate: params?.endDate,
|
||||
};
|
||||
return api.teacherCourseControllerGetTeacherSchedules(scheduleParams) as any;
|
||||
return http.get<{ list: TeacherSchedule[]; total: number }>('/v1/teacher/schedules', { params })
|
||||
.then(res => ({
|
||||
list: res.list || res.records || [],
|
||||
total: res.total || 0,
|
||||
}));
|
||||
};
|
||||
|
||||
export const getTeacherTimetable = (params: { startDate: string; endDate: string }) => {
|
||||
const timetableParams: TeacherCourseControllerGetTeacherTimetableParams = {
|
||||
startDate: params.startDate,
|
||||
endDate: params.endDate,
|
||||
};
|
||||
return api.teacherCourseControllerGetTeacherTimetable(timetableParams) as any;
|
||||
return http.get<any[]>('/v1/teacher/schedules/timetable', { params })
|
||||
.then(res => {
|
||||
// 后端返回的是数组格式或包含 schedules 的对象
|
||||
if (Array.isArray(res)) {
|
||||
return res;
|
||||
}
|
||||
return res?.schedules || res?.data || [];
|
||||
});
|
||||
};
|
||||
|
||||
export const getTodayTeacherSchedules = () =>
|
||||
api.teacherCourseControllerGetTodaySchedules() as any;
|
||||
http.get<TeacherSchedule[]>('/v1/teacher/schedules/today');
|
||||
|
||||
export const createTeacherSchedule = (data: CreateTeacherScheduleDto) =>
|
||||
api.teacherCourseControllerCreateTeacherSchedule(data as any) as any;
|
||||
http.post<TeacherSchedule>('/v1/teacher/schedules', data);
|
||||
|
||||
export const updateTeacherSchedule = (id: number, data: Partial<CreateTeacherScheduleDto> & { status?: string }) =>
|
||||
api.teacherCourseControllerUpdateTeacherSchedule(String(id), data as any) as any;
|
||||
http.put<TeacherSchedule>(`/v1/teacher/schedules/${id}`, data);
|
||||
|
||||
export const cancelTeacherSchedule = (id: number) =>
|
||||
api.teacherCourseControllerCancelTeacherSchedule(String(id)) as any;
|
||||
http.delete<{ message: string }>(`/v1/teacher/schedules/${id}`);
|
||||
|
||||
// ==================== 阅读任务 API ====================
|
||||
|
||||
@ -620,29 +637,38 @@ export interface UpdateTaskCompletionDto {
|
||||
feedback?: string;
|
||||
}
|
||||
|
||||
export const getTeacherTasks = () =>
|
||||
api.teacherTaskControllerFindAll() as any;
|
||||
// 获取教师任务列表
|
||||
export const getTeacherTasks = (params?: { pageNum?: number; pageSize?: number; keyword?: string; type?: string; status?: string }) =>
|
||||
http.get<{ list: any[]; total: number; pageNum: number; pageSize: number }>('/v1/teacher/tasks', { params })
|
||||
.then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
|
||||
export const getTeacherTask = (id: number) =>
|
||||
api.teacherTaskControllerFindOne(String(id)) as any;
|
||||
http.get(`/v1/teacher/tasks/${id}`) as any;
|
||||
|
||||
export const getTeacherTaskCompletions = (taskId: number) =>
|
||||
api.teacherTaskControllerGetCompletions(String(taskId)) as any;
|
||||
// 教师端没有这些接口,返回空数据
|
||||
export const getTeacherTaskCompletions = (_taskId: number) =>
|
||||
Promise.resolve([]);
|
||||
|
||||
export const createTeacherTask = (data: CreateTeacherTaskDto) =>
|
||||
api.teacherTaskControllerCreate(data as any) as any;
|
||||
http.post('/v1/teacher/tasks', data) as any;
|
||||
|
||||
export const updateTeacherTask = (id: number, data: Partial<CreateTeacherTaskDto> & { status?: string }) =>
|
||||
api.teacherTaskControllerUpdate(String(id), data as any) as any;
|
||||
http.put(`/v1/teacher/tasks/${id}`, data) as any;
|
||||
|
||||
export const deleteTeacherTask = (id: number) =>
|
||||
api.teacherTaskControllerDelete(String(id)) as any;
|
||||
http.delete(`/v1/teacher/tasks/${id}`) as any;
|
||||
|
||||
export const updateTaskCompletion = (taskId: number, studentId: number, data: UpdateTaskCompletionDto) =>
|
||||
api.teacherTaskControllerUpdateCompletion(String(taskId), String(studentId), data as any) as any;
|
||||
// 后端没有这些接口
|
||||
export const updateTaskCompletion = (_taskId: number, _studentId: number, _data: UpdateTaskCompletionDto) =>
|
||||
Promise.reject(new Error('接口未实现'));
|
||||
|
||||
export const sendTaskReminder = (taskId: number) =>
|
||||
api.teacherTaskControllerSendReminder(String(taskId)) as any;
|
||||
export const sendTaskReminder = (_taskId: number) =>
|
||||
Promise.reject(new Error('接口未实现'));
|
||||
|
||||
// ==================== 任务模板 API ====================
|
||||
|
||||
@ -683,16 +709,20 @@ export interface CreateTaskFromTemplateDto {
|
||||
}
|
||||
|
||||
export const getTaskTemplates = () =>
|
||||
api.teacherTaskControllerFindAllTemplates() as any;
|
||||
http.get<{ records: any[]; total: number }>('/v1/teacher/task-templates')
|
||||
.then(res => ({
|
||||
items: res.records || [],
|
||||
total: res.total || 0,
|
||||
}));
|
||||
|
||||
export const getTaskTemplate = (id: number) =>
|
||||
api.teacherTaskControllerFindOneTemplate(String(id)) as any;
|
||||
http.get(`/v1/teacher/task-templates/${id}`) as any;
|
||||
|
||||
export const getDefaultTaskTemplate = (taskType: string) =>
|
||||
api.teacherTaskControllerGetDefaultTemplate(taskType) as any;
|
||||
http.get('/v1/teacher/task-templates/default', { params: { taskType } }) as any;
|
||||
|
||||
export const createTaskFromTemplate = (data: CreateTaskFromTemplateDto) =>
|
||||
api.teacherTaskControllerCreateFromTemplate(data as any) as any;
|
||||
http.post('/v1/teacher/tasks/from-template', data) as any;
|
||||
|
||||
// ==================== 任务统计 API ====================
|
||||
|
||||
@ -732,16 +762,15 @@ export interface MonthlyTaskStats {
|
||||
}
|
||||
|
||||
export const getTaskStats = () =>
|
||||
api.teacherTaskControllerGetStats() as any;
|
||||
http.get('/v1/teacher/tasks/stats') as any;
|
||||
|
||||
export const getTaskStatsByType = () =>
|
||||
api.teacherTaskControllerGetStatsByType() as any;
|
||||
http.get('/v1/teacher/tasks/stats/by-type') as any;
|
||||
|
||||
export const getTaskStatsByClass = () =>
|
||||
api.teacherTaskControllerGetStatsByClass() as any;
|
||||
http.get('/v1/teacher/tasks/stats/by-class') as any;
|
||||
|
||||
export const getMonthlyTaskStats = (months?: number) => {
|
||||
const params: TeacherTaskControllerGetMonthlyStatsParams = { months: String(months ?? 6) };
|
||||
return api.teacherTaskControllerGetMonthlyStats(params) as any;
|
||||
return http.get('/v1/teacher/tasks/stats/monthly', { params: { months } }) as any;
|
||||
};
|
||||
|
||||
|
||||
@ -341,13 +341,13 @@ const loadRecords = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getTeacherGrowthRecords({
|
||||
page: pagination.current,
|
||||
pageNum: pagination.current,
|
||||
pageSize: pagination.pageSize,
|
||||
classId: filters.classId,
|
||||
keyword: filters.keyword || undefined,
|
||||
});
|
||||
records.value = res.items;
|
||||
pagination.total = res.total;
|
||||
records.value = res.list || [];
|
||||
pagination.total = res.total || 0;
|
||||
} catch (error) {
|
||||
message.error('加载档案失败');
|
||||
} finally {
|
||||
@ -365,8 +365,8 @@ const loadClasses = async () => {
|
||||
|
||||
const loadStudents = async () => {
|
||||
try {
|
||||
const res = await getTeacherStudents({ page: 1, pageSize: 500 });
|
||||
students.value = res.items.map((s: any) => ({
|
||||
const res = await getTeacherStudents({ pageNum: 1, pageSize: 500 });
|
||||
students.value = (res.list || []).map((s: any) => ({
|
||||
id: s.id,
|
||||
name: s.name,
|
||||
className: s.class?.name || '-',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user