소스 검색

fix 离线考试-已有作答附件

Michael Wang 6 년 전
부모
커밋
34b3fd363d
1개의 변경된 파일12개의 추가작업 그리고 7개의 파일을 삭제
  1. 12 7
      src/features/OfflineExam/OfflineExamUpload.vue

+ 12 - 7
src/features/OfflineExam/OfflineExamUpload.vue

@@ -169,12 +169,13 @@ export default {
       });
       this.$emit("reloadList");
     },
-    handleError() {
+    handleError(error, file) {
       window._hmt.push(["_trackEvent", "离线考试页面", "上传作答", "上传失败"]);
       this.file = null;
       this.loadingStatus = false;
+      console.log(error);
       this.$Message.error({
-        content: "上传失败",
+        content: file.desc || "上传失败",
         duration: 15,
         closable: true,
       });
@@ -210,11 +211,15 @@ export default {
       }
 
       return new Promise((resolve, reject) => {
-        this.$Modal.confirm({
-          title: "已有作答附件,是否覆盖?",
-          onCancel: () => reject(-1),
-          onOk: () => resolve(),
-        });
+        if (this.course.offlineFileUrl) {
+          this.$Modal.confirm({
+            title: "已有作答附件,是否覆盖?",
+            onCancel: () => reject(-1),
+            onOk: () => resolve(),
+          });
+        } else {
+          resolve();
+        }
       }).then(() => {
         if (file.type.includes("/pdf")) {
           this.fileType = "pdf";