Explorar el Código

优化:阅卷取卷慢的问题

xiatian hace 6 años
padre
commit
ff0e17a2e6

+ 7 - 4
src/modules/marking/views/MarkSettingWork.vue

@@ -79,7 +79,7 @@
 </template>
 
 <script>
-import { DATA_PROCESS_API } from "@/constants/constants";
+import { DATA_PROCESS_API, MARKING_API } from "@/constants/constants";
 import { mapState } from "vuex";
 export default {
   data() {
@@ -169,11 +169,14 @@ export default {
       var url = "/marking/" + row.id + "/" + row.examType;
       self.$http
         .get(
-          DATA_PROCESS_API + "/markTasks?workId=" + row.id + "&userId=" + userId
+          MARKING_API +
+            "/markTasks/count?workId=" +
+            row.id +
+            "&userId=" +
+            userId
         )
         .then(response => {
-          console.log(response);
-          if (response.data.length > 0) {
+          if (response.data > 0) {
             self.$router.push({
               path: url
             });

+ 6 - 2
src/modules/marking/views/Marking.vue

@@ -350,6 +350,8 @@ export default {
       this.getChangeTasks();
     },
     async tasksSelect(index, row) {
+      this.taskVisible = false;
+      this.loading = true;
       this.answerHtml = null;
       await this.initMarkItem();
       await this.markInit();
@@ -358,7 +360,7 @@ export default {
       await this.getAnswerHtml();
       await this.getMarkRange();
       await this.getMarkedTask();
-      this.taskVisible = false;
+      this.loading = false;
     },
     markedClick() {
       this.markedTaskVisible = true;
@@ -383,13 +385,15 @@ export default {
       this.getMarkedTask();
     },
     async markTaskSelect(index, row) {
+      this.markedTaskVisible = false;
+      this.loading = true;
       this.backMark = true;
       this.paperMark = true;
       this.textarea = row.markRemark;
       await this.getMarkedPaper(row.studentPaperId);
       await this.getMarkedResultItems(row.id);
       await this.getAnswerHtml();
-      this.markedTaskVisible = false;
+      this.loading = false;
     },
     async markInit() {
       console.log("markInit");