mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
课程目录内容的一个过滤
This commit is contained in:
@@ -1050,11 +1050,19 @@
|
|||||||
});
|
});
|
||||||
this.sectionList = rs.result.sections;
|
this.sectionList = rs.result.sections;
|
||||||
}else if(rs.result.course.type==10){ //无目录课程
|
}else if(rs.result.course.type==10){ //无目录课程
|
||||||
rs.result.contents.forEach(c => {
|
//如果是多个的话,就需要过滤一下
|
||||||
|
let indexNum=0;
|
||||||
|
let delIndexs=[];
|
||||||
|
rs.result.contents.forEach((c,cidx) => {
|
||||||
c.status = 0; //
|
c.status = 0; //
|
||||||
c.studyItemId = '';
|
c.studyItemId = '';
|
||||||
c.lastStudyTime = 0;
|
c.lastStudyTime = 0;
|
||||||
if(c.sortIndex==2){
|
if(c.sortIndex==1){
|
||||||
|
indexNum++;
|
||||||
|
if(indexNum>1){
|
||||||
|
delIndexs.push(cidx);
|
||||||
|
}
|
||||||
|
}else if(c.sortIndex==2){
|
||||||
c.contentName='作业';
|
c.contentName='作业';
|
||||||
}else if(c.sortIndex==3){
|
}else if(c.sortIndex==3){
|
||||||
c.contentName='考试';
|
c.contentName='考试';
|
||||||
@@ -1062,6 +1070,11 @@
|
|||||||
c.contentName='评估';
|
c.contentName='评估';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(delIndexs.length>0){
|
||||||
|
delIndexs.forEach(delIdx=>{
|
||||||
|
rs.result.contents.splice(delIdx,1);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.courseInfo = rs.result.course;
|
this.courseInfo = rs.result.course;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user