|
@@ -641,13 +641,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
sentSelectedEventTitle(item) {
|
|
|
- let index = this.getCourseIndex(item.subjects)
|
|
|
- this.$EventBus.$emit('classIndex', index + 1)
|
|
|
- let path = item.type === 'Exam' ? '/studentWeb/examView' : (item.type === 'Homework' ? '/studentWeb/homeworkView' : '/studentWeb/eventView')
|
|
|
- this.$router.push({
|
|
|
- path,
|
|
|
- query: {aId: item.id}
|
|
|
- })
|
|
|
+ if(item.type === "Exam" || item.type === "Homework") {
|
|
|
+ let index = this.getCourseIndex(item.subjects, item.classIds)
|
|
|
+ if(index === -1) {
|
|
|
+ this.$Message.error("未找到发布该活动的课程")
|
|
|
+ } else {
|
|
|
+ this.$EventBus.$emit('classIndex', index + 1)
|
|
|
+ let path = item.type === 'Exam' ? '/studentWeb/examView' : '/studentWeb/homeworkView'
|
|
|
+ this.$router.push({
|
|
|
+ path,
|
|
|
+ query: {aId: item.id}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/studentWeb/eventView',
|
|
|
+ query: {aId: item.id}
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
toRecord(item) {
|
|
|
let index = this.getCourseIndex([item.courseId])
|
|
@@ -699,9 +710,10 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- getCourseIndex(ids) {
|
|
|
+ getCourseIndex(ids, classIds) {
|
|
|
return this.getAllCourse.findIndex(course => {
|
|
|
- return ids.includes(course.id) || ids.includes(course.subject.id)
|
|
|
+ // 要同时匹配课程和班级id
|
|
|
+ return (ids.includes(course.id) || ids.includes(course.subject.id)) && classIds.includes(course.list)
|
|
|
})
|
|
|
},
|
|
|
},
|