lrf402788946 vor 4 Jahren
Ursprung
Commit
0ad4c36073
1 geänderte Dateien mit 19 neuen und 8 gelöschten Zeilen
  1. 19 8
      src/views/stuscore/scoreList.vue

+ 19 - 8
src/views/stuscore/scoreList.vue

@@ -4,15 +4,10 @@
       <el-col :span="24" class="teascore">
         <p>
           教师:<span>{{ teacherinfo.name }}</span> 总分:<span>{{ teascore.teatotal }}分</span> 平均分:<span>{{ teascore.teapinjuntotal }}分</span>
+          未评分名单:<span>{{ noScoreList }}</span>
         </p>
       </el-col>
-      <data-table :fields="fields" :data="list" :opera="opera">
-        <template #custom="{item, row}">
-          <template v-if="item.prop === 'stuid'">
-            {{ getstuname(row.stuid) }}
-          </template>
-        </template>
-      </data-table>
+      <data-table :fields="fields" :data="stuList" :opera="opera"> </data-table>
     </list-frame>
   </div>
 </template>
@@ -33,7 +28,7 @@ export default {
   data: () => ({
     opera: [],
     fields: [
-      { label: '学生姓名', prop: 'stuid', custom: true },
+      { label: '学生姓名', prop: 'name' },
       { label: '评分', prop: 'score' },
     ],
     list: [],
@@ -45,6 +40,8 @@ export default {
     teacherinfo: {},
     // 教师分
     teascore: {},
+    // 没评分
+    noScoreList: '',
   }),
   async created() {
     await this.searchstu();
@@ -68,6 +65,20 @@ export default {
           teapinjuntotal: teapinjuntotal,
         };
         this.$set(this, `teascore`, data);
+        // 没评分的同学
+        let noScoreList = [];
+        let duplicate = _.cloneDeep(this.stuList);
+        duplicate = duplicate.map(i => {
+          const r = res.data.find(f => f.stuid === i._id);
+          if (r) i.score = r.score * 1;
+          else {
+            noScoreList.push(i.name);
+            i.score = '未评分';
+          }
+          return i;
+        });
+        this.$set(this, `noScoreList`, noScoreList.join(';'));
+        this.$set(this, `stuList`, duplicate);
       }
     },
     // 过滤学生