Parcourir la source

答题列表判断未答题情况不显示数据,答题报告增加答对颜色

natasha il y a 11 mois
Parent
commit
9406bfb13d

+ 13 - 5
src/views/home/recovery/AnswerData.vue

@@ -54,19 +54,27 @@
       <el-table-column prop="finish_time" label="完成时间" width="180" />
       <el-table-column prop="answer_duration" label="耗时" width="180">
         <template slot-scope="{ row }">
-          <span>{{ secondFormatConversion(row.answer_duration, 'chinese') }}</span>
+          <span>{{ row.finish_time ? secondFormatConversion(row.answer_duration, 'chinese') : '' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="right_count" label="正确" width="160">
+        <template slot-scope="{ row }">
+          <span>{{ row.finish_time ? row.right_count : '' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="error_count" label="错误" width="160">
+        <template slot-scope="{ row }">
+          <span>{{ row.finish_time ? row.error_count : '' }}</span>
         </template>
       </el-table-column>
-      <el-table-column prop="right_count" label="正确" width="160" />
-      <el-table-column prop="error_count" label="错误" width="160" />
       <el-table-column label="正确率">
         <template slot-scope="{ row }">
-          <span>{{ row.right_percent }}</span>
+          <span>{{ row.finish_time ? row.right_percent + '%' : '' }}</span>
         </template>
       </el-table-column>
 
       <el-table-column prop="operation" label="操作" fixed="right" width="200">
-        <template slot-scope="{ row }">
+        <template slot-scope="{ row }" v-if="row.finish_time">
           <span class="link" @click="viewUserAnswerRecordLis(row.exercise_share_record_id, row.id)">查看</span>
         </template>
       </el-table-column>

+ 10 - 1
src/views/home/recovery/AnswerRecordList.vue

@@ -52,7 +52,11 @@
             :key="question_id"
             :class="[
               'answer-list-item',
-              { subjectivity: is_objective === 'false', error: answer_status === 2 || answer_status === 0 },
+              {
+                subjectivity: is_objective === 'false',
+                error: answer_status === 2 || answer_status === 0,
+                right: answer_status === 1,
+              },
               { remarked: is_remarked === 'true' },
             ]"
             @click="selectQuestion(i)"
@@ -291,6 +295,11 @@ export default {
             background-color: $error-color;
           }
 
+          &.right {
+            color: #fff;
+            background-color: #3acb85;
+          }
+
           &.subjectivity {
             color: $font-color;
             background-color: #fef2a4;