소스 검색

一些小需求

dusenyao 1 년 전
부모
커밋
dbb696b810

+ 7 - 1
src/api/app.js

@@ -79,7 +79,9 @@ export function fileUpload(
   if (isGlobalprogress) {
     store.commit(`app/${app.SHOW_PROGRESS}`, true);
     onUploadProgress = ({ loaded, progress, total }) => {
-      store.commit(`app/${app.SET_UPLOAD_INFO}`, { loaded, progress, total });
+      // 因为上传进度为 1 后,上传事件还会继续一段时间,所以这里将进度设置为 0.99
+      let precent = progress >= 1 ? 0.99 : progress;
+      store.commit(`app/${app.SET_UPLOAD_INFO}`, { loaded, progress: precent, total });
     };
   }
 
@@ -96,6 +98,10 @@ export function fileUpload(
       onUploadProgress,
       timeout: 0,
     })
+    .then((res) => {
+      store.commit(`app/${app.SET_UPLOAD_INFO}`, { loaded: 0, progress: 1, total: 0 });
+      return res;
+    })
     .finally(() => {
       store.commit(`app/${app.SET_UPLOAD_CONTROLLER}`, null);
     });

+ 4 - 0
src/views/exercise_questions/answer/components/AnswerReport.vue

@@ -2,6 +2,10 @@
   <div class="answer-report">
     <div class="title">测试报告</div>
     <div class="answer-info">
+      <div v-if="recordReport.answer_record.is_remarked === 'true'">
+        <span>总得分</span>
+        <span>{{ recordReport.answer_record.total_score }} 分</span>
+      </div>
       <div>
         <span>耗时</span>
         <span>{{ secondFormatConversion(recordReport.answer_record.answer_duration, 'chinese') }}</span>

+ 10 - 2
src/views/exercise_questions/answer/index.vue

@@ -143,7 +143,9 @@
         </template>
 
         <template v-else>
-          <el-button v-if="curQuestionIndex > 0" round @click="fillQuestionAnswer('pre')">上一题</el-button>
+          <el-button v-if="curQuestionIndex > 0" type="primary" round @click="fillQuestionAnswer('pre')">
+            上一题
+          </el-button>
           <el-button
             v-if="
               curQuestionIndex === questionList.length - 1 &&
@@ -151,7 +153,7 @@
               !isShow &&
               user_answer_record_info.is_exist_answer_record !== 'true'
             "
-            type="primary"
+            class="confirm"
             round
             @click="confirmSubmitAnswer"
           >
@@ -266,6 +268,7 @@ export default {
           right_count: 0,
           error_count: 0,
           is_remarked: 'false',
+          total_score: 0,
         },
         question_list: [],
       }, // 答题报告
@@ -747,6 +750,11 @@ export default {
       .el-button {
         font-size: 16px;
       }
+
+      .confirm {
+        color: #fff;
+        background-color: #5ac448;
+      }
     }
 
     .el-button {

+ 1 - 1
src/views/exercise_questions/create/components/common/SelectQuestionType.vue

@@ -91,7 +91,7 @@ export default {
   }
 
   .el-cascader-menu__wrap {
-    height: 320px;
+    height: 355px;
   }
 }
 </style>

+ 1 - 5
src/views/exercise_questions/data/questionType.js

@@ -38,6 +38,7 @@ export const questionTypeDataOption = [
       { label: '选择声调', value: 'choose_tone', data: ChooseToneData },
       { label: '问答题', value: 'essay_question', data: essayQuestionData },
       { label: '填表题', value: 'table_fill', data: getTableFillData() },
+      { value: 'activity', label: '活动题', data: activityData },
     ],
   },
   {
@@ -83,11 +84,6 @@ export const questionTypeDataOption = [
     label: '阅读题',
     data: readData,
   },
-  {
-    value: 'activity',
-    label: '活动题',
-    data: activityData,
-  },
 ];
 
 // 题型选项