|
|
@@ -21,7 +21,7 @@
|
|
|
<div class="course-item-content">
|
|
|
<div style="font-weight: bold; font-size: 16px; margin: 5px 0">{{item.courseName}}</div>
|
|
|
<div style="line-height: 1.5;" class="collapsed" ><span style="color: rgba(0, 0, 0, 0.6)">课程描述:</span>{{item.description}}</div>
|
|
|
- <div style="line-height: 1.5; margin-top: 5px" class="collapsed" ><span style="color: rgba(0, 0, 0, 0.6)">任课教师:</span>{{item.teacherIds.join(",")}}</div>
|
|
|
+ <div style="line-height: 1.5; margin-top: 5px" class="collapsed" ><span style="color: rgba(0, 0, 0, 0.6)">任课教师:</span>{{item.teacherNames.join(",")}}</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
<template v-if="getCoursesSlice().length < 5">
|
|
|
@@ -54,75 +54,13 @@
|
|
|
const role:'teachers' | 'student' = store.user.role === 'STUDENT' ? 'student':'teachers';
|
|
|
|
|
|
const props = defineProps<{
|
|
|
- title:string,
|
|
|
+ title: string,
|
|
|
type: 'all' | 'my'
|
|
|
}>()
|
|
|
|
|
|
// 课程数据
|
|
|
const courses = reactive({
|
|
|
- course: [
|
|
|
- {
|
|
|
- courseId: 5,
|
|
|
- courseName: '英文论文写作',
|
|
|
- description: '',
|
|
|
- teacherIds: [],
|
|
|
- courseImages: [],
|
|
|
- targetGrade: null,
|
|
|
- startTime: new Date(),
|
|
|
- endTime: new Date(),
|
|
|
- },
|
|
|
- {
|
|
|
- courseId: 7,
|
|
|
- courseName: '数学分析',
|
|
|
- description: '',
|
|
|
- teacherIds: [],
|
|
|
- courseImages: [],
|
|
|
- targetGrade: null,
|
|
|
- startTime: new Date(),
|
|
|
- endTime: new Date(),
|
|
|
- },
|
|
|
- {
|
|
|
- courseId: 8,
|
|
|
- courseName: '线性代数',
|
|
|
- description: '',
|
|
|
- teacherIds: [],
|
|
|
- courseImages: [],
|
|
|
- targetGrade: null,
|
|
|
- startTime: new Date(),
|
|
|
- endTime: new Date(),
|
|
|
- },
|
|
|
- // {
|
|
|
- // courseId: 4,
|
|
|
- // courseName: '计算机科学',
|
|
|
- // description: '',
|
|
|
- // teacherIds: [],
|
|
|
- // courseImages: [],
|
|
|
- // targetGrade: null,
|
|
|
- // startTime: new Date(),
|
|
|
- // endTime: new Date(),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // courseId: 5,
|
|
|
- // courseName: '物理学基础',
|
|
|
- // description: '',
|
|
|
- // teacherIds: [],
|
|
|
- // courseImages: [],
|
|
|
- // targetGrade: null,
|
|
|
- // startTime: new Date(),
|
|
|
- // endTime: new Date(),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // courseId: 6,
|
|
|
- // courseName: '化学基础',
|
|
|
- // description: '',
|
|
|
- // teacherIds: [],
|
|
|
- // courseImages: [],
|
|
|
- // targetGrade: null,
|
|
|
- // startTime: new Date(),
|
|
|
- // endTime: new Date(),
|
|
|
- // },
|
|
|
- // 可以根据需要添加更多课程对象
|
|
|
- ],
|
|
|
+ course: [],
|
|
|
})
|
|
|
|
|
|
//只获取前五个课程
|
|
|
@@ -200,20 +138,9 @@
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- 用于显示教师姓名
|
|
|
+ * 处理课程图片
|
|
|
*/
|
|
|
const processCourses = () => {
|
|
|
- for(let i:number = 0; i < courses.course.length; i++){
|
|
|
- for(let j = 0; j < courses.course[i].teacherIds.length; j++){
|
|
|
- apis.findUserById(courses.course[i].teacherIds[j])
|
|
|
- .then((res:any) => {
|
|
|
- courses.course[i].teacherIds[j] = res.data.data.records[0].name
|
|
|
- })
|
|
|
- .catch((err:any) => {
|
|
|
- console.log("错误信息",err)
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
for(let i:number = 0; i < courses.course.length; i++){
|
|
|
courses.course[i].courseImages[0] = courses.course[i].courseImages[0].split("?")[0]
|
|
|
}
|