lrf402788946 4 年之前
父节点
当前提交
985353b3ea
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/views/stuscore/scoreList.vue

+ 2 - 2
src/views/stuscore/scoreList.vue

@@ -55,13 +55,13 @@ export default {
       let res = await this.query({ lessonid: this.lessonid, teacherid: this.teacherid, ...info });
       if (res.errcode === 0) {
         let nd = _.uniqBy(res.data, 'stuid');
-        nd = nd.filter(f => this.stuList.find(sf => sf._id === f.stuid));
+        nd = nd.filter(f => this.stuList.find(sf => sf._id === f.stuid) && f.score);
         this.$set(this, `list`, nd);
         this.$set(this, `total`, res.total);
         // 教师总分
         let teatotal = nd.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
         // 教师平均分
-        let teapinjuntotal = _.round(teatotal / this.stutotal, 2);
+        let teapinjuntotal = _.round(teatotal / nd.length, 2);
         let data = {
           teatotal: teatotal,
           teapinjuntotal: teapinjuntotal,