فهرست منبع

离线 bug fix

lideyin 4 سال پیش
والد
کامیت
5cbfb32f90
1فایلهای تغییر یافته به همراه11 افزوده شده و 10 حذف شده
  1. 11 10
      src/modules/oe/views/examScheduling.vue

+ 11 - 10
src/modules/oe/views/examScheduling.vue

@@ -481,7 +481,6 @@ export default {
     },
     //计算是否显示图片上传框
     uploadDisabled() {
-      debugger;
       return this.fileList.length >= this.fileLimit;
     }
   },
@@ -491,7 +490,6 @@ export default {
       this.removeImgs();
     },
     handleChange(file, fileList) {
-      debugger;
       this.fileList = fileList;
       this.calcSummary(this.fileList);
     },
@@ -716,6 +714,11 @@ export default {
         });
     },
     openUploadAnswerDialog(examStudentId) {
+      this.fileList = [];
+      this.imageAnswerFileList = [];
+      // this.offlineAnswerFile = "";
+      this.cleanOfflineFile();
+
       this.$http
         .get("/api/ecs_oe_admin/exam/record/data/findByExamStudentId", {
           params: { examStudentId: examStudentId }
@@ -738,7 +741,6 @@ export default {
     },
     uploadAnswerChange(event) {
       if (event.target.files.length > 0) {
-        debugger;
         this.offlineAnswerFile = event.target.files[0];
       } else {
         this.offlineAnswerFile = "";
@@ -782,7 +784,7 @@ export default {
             headers: { "Content-Type": "multipart/form-data" }
           };
           let param = new FormData();
-          debugger;
+
           param.append("file", this.offlineAnswerFile);
           param.append("examRecordDataId", this.currentOfflineExamRecordDataId);
           this.$http
@@ -822,7 +824,6 @@ export default {
             "/OFFLINE_UPLOAD_FILE_TYPE"
         )
         .then(response => {
-          debugger;
           var allowfileSuffixs = response.data;
           if (!allowfileSuffixs || allowfileSuffixs.length == 0) {
             return false;
@@ -842,7 +843,6 @@ export default {
         });
     },
     beforeUpload(file) {
-      debugger;
       var index = file.name.lastIndexOf(".");
       var fileNameLength = file.name.length;
       var fileSuffix = file.name
@@ -891,7 +891,6 @@ export default {
       return promise; //通过返回一个promis对象解决
     },
     submitUpload() {
-      debugger;
       this.uploadAnswerDialogLoading = true;
       let config = {
         headers: { "Content-Type": "multipart/form-data" }
@@ -928,11 +927,13 @@ export default {
         });
     },
     cleanOfflineFile() {
-      this.$refs.offlineFileInput.value = "";
+      if (this.$refs.offlineFileInput) {
+        this.$refs.offlineFileInput.value = "";
+      }
+
       this.offlineAnswerFile = "";
     },
     downloadAnswer(files) {
-      debugger;
       if (files && files.length > 0) {
         if (files[0].fileType != "image") {
           window.open(files[0].offlineFileUrl);
@@ -964,7 +965,7 @@ export default {
     },
     batchSubmitUpload() {
       this.$refs.upload.submit();
-      debugger;
+
       let params = new FormData();
       params.append("examRecordDataId", this.currentOfflineExamRecordDataId);
       params.append("fileType", this.fileType);