浏览代码

阅卷评卷界面功能优化--离线

nikang 6 年之前
父节点
当前提交
348b101922

+ 3 - 6
src/modules/marking/views/MarkSettingMain.vue

@@ -367,12 +367,10 @@ export default {
     beforeUpload(file) {
     beforeUpload(file) {
       console.log(file);
       console.log(file);
     },
     },
-    uploadProgress(event, file, fileList) {
-      console.log(fileList.length);
+    uploadProgress() {
       console.log("uploadProgress");
       console.log("uploadProgress");
     },
     },
-    uploadSuccess(response, file, fileList) {
-      console.log(fileList.length);
+    uploadSuccess(response) {
       console.log("uploadSuccess");
       console.log("uploadSuccess");
       console.log(response);
       console.log(response);
       if (!response || response.length == 0) {
       if (!response || response.length == 0) {
@@ -390,8 +388,7 @@ export default {
         this.impDialog = false;
         this.impDialog = false;
       }
       }
     },
     },
-    uploadError(err, file, fileList) {
-      console.log(fileList.length);
+    uploadError(err) {
       var result = err.message.match(/\{.+}/);
       var result = err.message.match(/\{.+}/);
       var errMessage = JSON.parse(result[0]).desc;
       var errMessage = JSON.parse(result[0]).desc;
       this.$notify({
       this.$notify({

+ 2 - 2
src/modules/marking/views/MarkerDetail.vue

@@ -164,7 +164,7 @@ export default {
       this.$http
       this.$http
         .get(
         .get(
           MARKING_API +
           MARKING_API +
-            "/markCourses/all/Marker/0/" +
+            "/markCourses/all/marker/0/" +
             this.pageSize +
             this.pageSize +
             "?workId=" +
             "?workId=" +
             this.workId +
             this.workId +
@@ -183,7 +183,7 @@ export default {
       this.$http
       this.$http
         .get(
         .get(
           MARKING_API +
           MARKING_API +
-            "/markCourses/all/Marker/" +
+            "/markCourses/all/marker/" +
             (this.currentPage - 1) +
             (this.currentPage - 1) +
             "/" +
             "/" +
             this.pageSize +
             this.pageSize +

+ 1 - 1
src/modules/marking/views/Marking.vue

@@ -598,7 +598,7 @@ export default {
             self.examType
             self.examType
         )
         )
         .then(response => {
         .then(response => {
-          if (!response) {
+          if (!response.data) {
             self.$notify({
             self.$notify({
               message: "该任务下试卷已评完,如有剩余任务将自动切换任务",
               message: "该任务下试卷已评完,如有剩余任务将自动切换任务",
               type: "info"
               type: "info"

+ 28 - 37
src/modules/marking/views/TpMain.vue

@@ -81,7 +81,8 @@ img {
             <div v-html="getPdfUrl()" style="float: left;"></div>
             <div v-html="getPdfUrl()" style="float: left;"></div>
             <div
             <div
               v-if="
               v-if="
-                this.studentPaper.studentSubjectiveHtml != '' &&
+                this.studentPaper.studentSubjectiveHtml &&
+                  this.studentPaper.studentSubjectiveHtml != '' &&
                   this.studentPaper.studentSubjectiveHtml.indexOf('.pdf') > -1
                   this.studentPaper.studentSubjectiveHtml.indexOf('.pdf') > -1
               "
               "
               style="float: right;margin-right: 20px;"
               style="float: right;margin-right: 20px;"
@@ -102,11 +103,7 @@ img {
                 打印
                 打印
               </el-button>
               </el-button>
             </div>
             </div>
-            <div
-              class="paper"
-              id="answer-content"
-              v-html="getAnswerHtml()"
-            ></div>
+            <div class="paper" id="answer-content">{{ getAnswerHtml }}</div>
           </div>
           </div>
         </el-tab-pane>
         </el-tab-pane>
       </template>
       </template>
@@ -146,7 +143,8 @@ export default {
       activeName: "first",
       activeName: "first",
       drawing: {},
       drawing: {},
       tmpSignScores: this.signScores,
       tmpSignScores: this.signScores,
-      tmpMarkSign: this.markSign
+      tmpMarkSign: this.markSign,
+      answerHtml: null
     };
     };
   },
   },
   props: [
   props: [
@@ -161,36 +159,16 @@ export default {
   methods: {
   methods: {
     getPdfUrl() {
     getPdfUrl() {
       var url = this.studentPaper.studentSubjectiveHtml;
       var url = this.studentPaper.studentSubjectiveHtml;
+      console.log("paperUrl", url);
       var content = "";
       var content = "";
-      if (
-        this.studentPaper.studentSubjectiveHtml != "" &&
-        this.studentPaper.studentSubjectiveHtml.indexOf(".pdf") > -1
-      ) {
-        content =
-          "<embed src='" + url + "'  width='800px' height='800px'></embed>";
-      }
-      if (
-        this.studentPaper.studentSubjectiveHtml != "" &&
-        this.studentPaper.studentSubjectiveHtml.indexOf(".zip") > -1
-      ) {
-        content = "<a href='" + url + "'>下载</a>";
-      }
-      return content;
-    },
-    getAnswerHtml() {
-      var content = "";
-      if (this.studentPaper.basePaperId) {
-        var paperId = this.studentPaper.basePaperId;
-        $.ajax({
-          type: "GET",
-          url: Q_API + "/extract/getAnswerHtml/" + paperId,
-          async: false,
-          success: function(response) {
-            console.log("response:" + response);
-            content = response;
-          }
-        });
-        console.log("answer:" + content);
+      if (url) {
+        if (url != "" && url.indexOf(".pdf") > -1) {
+          content =
+            "<embed src='" + url + "'  width='800px' height='800px'></embed>";
+        }
+        if (url != "" && url.indexOf(".zip") > -1) {
+          content = "<a href='" + url + "'>下载</a>";
+        }
       }
       }
       return content;
       return content;
     },
     },
@@ -342,7 +320,7 @@ export default {
     },
     },
     pdfDown() {
     pdfDown() {
       var url = this.studentPaper.studentSubjectiveHtml;
       var url = this.studentPaper.studentSubjectiveHtml;
-      if (url != "") {
+      if (url != "undefined" && url != "") {
         url = url.replace(UPAI_YUN, "");
         url = url.replace(UPAI_YUN, "");
         let xhr = new XMLHttpRequest();
         let xhr = new XMLHttpRequest();
         xhr.responseType = "blob";
         xhr.responseType = "blob";
@@ -372,6 +350,19 @@ export default {
     }
     }
   },
   },
   computed: {
   computed: {
+    async getAnswerHtml() {
+      var content = "";
+      if (this.studentPaper.basePaperId) {
+        var paperId = this.studentPaper.basePaperId;
+        await this.$http
+          .get(Q_API + "/extract/getAnswerHtml/" + paperId)
+          .then(response => {
+            console.log("html", response.data);
+            content = response.data;
+          });
+      }
+      return content;
+    },
     itemTitle() {
     itemTitle() {
       if (!this.markSign) return "无";
       if (!this.markSign) return "无";
       var title = "无";
       var title = "无";