fix: 修复教师无法展示的问题

This commit is contained in:
2025-09-14 22:08:45 +08:00
parent c886a80193
commit f61742a0b9

View File

@@ -160,14 +160,15 @@
</el-tooltip>
</div>
</div>
<!-- {{cinfo}}-->
<div class="couresstartTime">
<span v-if="cinfo.type == 30 && cinfo.startTime">开课时间{{ cinfo.startTime }}</span>
</div>
<div class="course-info">
<div class="course-info-user" style="max-width: 100px;" v-if="cinfo.teacher">
<el-tooltip :content="cinfo.teacher" placement="bottom" effect="light">
<span class="course-info-author">{{ cinfo.teacher }}</span>
<div class="course-info-user" style="max-width: 100px;" v-if="cinfo.teacherName">
<!-- todo: 后续优化 teacher name 形式-->
<el-tooltip :content="cinfo.teacherName && cinfo.teacherName.split(',')[0]" placement="bottom" effect="light">
<span class="course-info-author">{{ cinfo.teacherName && cinfo.teacherName.split(',')[0] }}</span>
</el-tooltip>
</div>
<div class="course-info-user">
@@ -1227,7 +1228,20 @@ export default {
// }
// });
this.courseList = res.data.result.records ?? []
const list = res.data.result.records ?? []
// list.forEach(course=>{
// const id = course.courseId
//
// apiCourse.getTeacherByCourseIDs([id]).then(res=>{
// console.log(res, "ids res")
// course.teacher = res.result[0].names[0]
// console.log(`course.teacher`, course.teacher)
// })
// })
this.courseList = list
// todo: 后续优化调用方式
if (this.newData) {
this.courseList = [
{
@@ -1280,6 +1294,7 @@ export default {
} else {
this.moreState = 2;
}
})
.catch(err => {
this.moreState = 2;