lrf402788946 4 years ago
parent
commit
37e443c293
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/views/user/league.vue

+ 3 - 1
src/views/user/league.vue

@@ -19,7 +19,7 @@
                   <el-col :span="24" class="info">
                     <el-col :span="8" class="one">团队:{{ getGroupscore(item.groupid, tag.subid) || '暂无' }} </el-col>
                     <el-col :span="8" class="one">个人:{{ getpscore(item.stuid, tag._id) || '暂无' }} </el-col>
-                    <el-col :span="8" class="one">作业: {{ gethomework(item.stuid, tag._id) || '暂无' }} </el-col>
+                    <el-col :span="8" class="one">作业: {{ gethomework(item.stuid, tag._id) || '暂无' }}</el-col>
                   </el-col>
                 </el-col>
               </el-collapse-item>
@@ -149,6 +149,8 @@ export default {
       let psSum = getPScore.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
       // 作业
       let homework = this.homeworkList.filter(f => f.studentid == data.stuid);
+      // 二次过滤,排除,课表里没有的课程
+      homework = homework.filter(f => this.lessonList.find(lf => lf._id === f.lessonid));
       let hwSum = homework.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
       // // 团队
       let groupscore = this.groupscoreList.filter(f => f.groupid == data.groupid);