fix: 修复教学建设接口数据渲染问题
This commit is contained in:
parent
080ce9e724
commit
a7d8b00fe9
@ -362,10 +362,16 @@ export class StatisticsApi {
|
||||
|
||||
// 获取课程教学建设数据统计
|
||||
static getCourseTeachingStats(courseId?: string): Promise<ApiResponse<{
|
||||
coursewareCount: number
|
||||
documentCount: number
|
||||
questionBankCount: number
|
||||
examPaperCount: number
|
||||
success: boolean
|
||||
message: string
|
||||
code: number
|
||||
result: {
|
||||
videoCount: number
|
||||
documentCount: number
|
||||
questionCount: number
|
||||
examPaperCount?: number
|
||||
}
|
||||
timestamp: number
|
||||
}>> {
|
||||
return ApiRequest.get('/aiol/statistics/course-teaching-stats', { courseId })
|
||||
}
|
||||
|
@ -146,15 +146,15 @@ const loadTeachingStats = async () => {
|
||||
console.log('🔍 准备调用API: /aiol/statistics/course-teaching-stats')
|
||||
const response = await StatisticsApi.getCourseTeachingStats(courseId)
|
||||
console.log('🔍 API响应:', response)
|
||||
if (response.data) {
|
||||
const result = response.data
|
||||
if (response.data && response.data.success) {
|
||||
const result = response.data.result
|
||||
console.log('🔍 API返回的原始数据:', result)
|
||||
|
||||
// 根据实际API返回的字段名映射数据
|
||||
teachingStats.value = {
|
||||
coursewareCount: result.coursewareCount || 0, // 课件/视频
|
||||
coursewareCount: result.videoCount || 0, // 课件/视频 (API返回videoCount)
|
||||
documentCount: result.documentCount || 0, // 资料/文档
|
||||
questionBankCount: result.questionBankCount || 0, // 题库总数
|
||||
questionBankCount: result.questionCount || 0, // 题库总数 (API返回questionCount)
|
||||
examPaperCount: result.examPaperCount || 0 // 试卷总数
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user