Showing
2 changed files
with
54 additions
and
4 deletions
| ... | @@ -257,8 +257,33 @@ onMounted(async () => { | ... | @@ -257,8 +257,33 @@ onMounted(async () => { |
| 257 | const { code, data } = await getCourseDetailAPI({ i: courseId }); | 257 | const { code, data } = await getCourseDetailAPI({ i: courseId }); |
| 258 | if (code) { | 258 | if (code) { |
| 259 | course.value = data; | 259 | course.value = data; |
| 260 | - task_list.value = data.task_list || []; | 260 | + task_list.value = []; |
| 261 | - timeout_task_list.value = data.timeout_task_list || []; | 261 | + timeout_task_list.value = []; |
| 262 | + | ||
| 263 | + // 处理task_list数据格式 | ||
| 264 | + if (data.task_list) { | ||
| 265 | + data.task_list.forEach(item => { | ||
| 266 | + task_list.value.push({ | ||
| 267 | + id: item.id, | ||
| 268 | + name: item.title, | ||
| 269 | + task_type: item.task_type, | ||
| 270 | + is_gray: item.is_gray | ||
| 271 | + }); | ||
| 272 | + }); | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + // 处理timeout_task_list数据格式 | ||
| 276 | + if (data.timeout_task_list) { | ||
| 277 | + data.timeout_task_list.forEach(item => { | ||
| 278 | + timeout_task_list.value.push({ | ||
| 279 | + id: item.id, | ||
| 280 | + name: item.title, | ||
| 281 | + task_type: item.task_type, | ||
| 282 | + is_gray: item.is_gray | ||
| 283 | + }); | ||
| 284 | + }); | ||
| 285 | + } | ||
| 286 | + | ||
| 262 | course_lessons.value = data.schedule || []; | 287 | course_lessons.value = data.schedule || []; |
| 263 | default_list.value = task_list.value; | 288 | default_list.value = task_list.value; |
| 264 | showTaskList.value = true; | 289 | showTaskList.value = true; | ... | ... |
| ... | @@ -1085,8 +1085,33 @@ onMounted(async () => { | ... | @@ -1085,8 +1085,33 @@ onMounted(async () => { |
| 1085 | const detail = await getCourseDetailAPI({ i: course.value.group_id }); | 1085 | const detail = await getCourseDetailAPI({ i: course.value.group_id }); |
| 1086 | if (detail.code) { | 1086 | if (detail.code) { |
| 1087 | course_lessons.value = detail.data.schedule || []; | 1087 | course_lessons.value = detail.data.schedule || []; |
| 1088 | - task_list.value = detail.data.task_list || []; | 1088 | + task_list.value = []; |
| 1089 | - timeout_task_list.value = detail.timeout_task_list || []; | 1089 | + timeout_task_list.value = []; |
| 1090 | + | ||
| 1091 | + // 处理task_list数据格式 | ||
| 1092 | + if (detail.data.task_list) { | ||
| 1093 | + detail.data.task_list.forEach(item => { | ||
| 1094 | + task_list.value.push({ | ||
| 1095 | + id: item.id, | ||
| 1096 | + name: item.title, | ||
| 1097 | + task_type: item.task_type, | ||
| 1098 | + is_gray: item.is_gray | ||
| 1099 | + }); | ||
| 1100 | + }); | ||
| 1101 | + } | ||
| 1102 | + | ||
| 1103 | + // 处理timeout_task_list数据格式 | ||
| 1104 | + if (detail.timeout_task_list) { | ||
| 1105 | + detail.timeout_task_list.forEach(item => { | ||
| 1106 | + timeout_task_list.value.push({ | ||
| 1107 | + id: item.id, | ||
| 1108 | + name: item.title, | ||
| 1109 | + task_type: item.task_type, | ||
| 1110 | + is_gray: item.is_gray | ||
| 1111 | + }); | ||
| 1112 | + }); | ||
| 1113 | + } | ||
| 1114 | + | ||
| 1090 | default_list.value = task_list.value; | 1115 | default_list.value = task_list.value; |
| 1091 | showTaskList.value = true; | 1116 | showTaskList.value = true; |
| 1092 | } | 1117 | } | ... | ... |
-
Please register or login to post a comment