lsc 2 years ago
parent
commit
c0a6cfb4c5
1 changed files with 94 additions and 94 deletions
  1. 94 94
      src/components/pages/addCourse.vue

+ 94 - 94
src/components/pages/addCourse.vue

@@ -5264,53 +5264,53 @@ export default {
 
       var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
       var _this = this;
-      // if (type == 3) {
-      //   var b = [
-      //     "DOC",
-      //     "DOCX",
-      //     "DOCM",
-      //     "DOTM",
-      //     "DOTX",
-      //     "PPTX",
-      //     "PPSX",
-      //     "PPT",
-      //     "PPS",
-      //     "PPTM",
-      //     "POTM",
-      //     "PPAM",
-      //     "POTX",
-      //     "PPSM",
-      //   ];
-      //   if (
-      //     b.indexOf(
-      //       file.name
-      //         .split(".")
-      //         [file.name.split(".").length - 1].toLocaleUpperCase()
-      //     ) != -1
-      //   ) {
-      //     if (file.size / 1024 / 1024 > 50) {
-      //       this.$message.error("上传文件大于50兆,请重新选择文件!");
-      //       this.inputShow = true;
-      //       var a = _this.$refs.upload1.uploadFiles;
-      //       a.splice(a.length - 1, a.length);
-      //       // loading.close();
-      //       return;
-      //     }
-      //   } else if (
-      //     file.name
-      //       .split(".")
-      //       [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
-      //   ) {
-      //     if (file.size / 1024 / 1024 > 50) {
-      //       this.$message.error("添加成上传文件大于50兆,请重新选择文件!");
-      //       this.inputShow = true;
-      //       var a = _this.$refs.upload1.uploadFiles;
-      //       a.splice(a.length - 1, a.length);
-      //       // loading.close();
-      //       return;
-      //     }
-      //   }
-      // }
+      if (type == 3) {
+        var b = [
+          "DOC",
+          "DOCX",
+          "DOCM",
+          "DOTM",
+          "DOTX",
+          "PPTX",
+          "PPSX",
+          "PPT",
+          "PPS",
+          "PPTM",
+          "POTM",
+          "PPAM",
+          "POTX",
+          "PPSM",
+        ];
+        if (
+          b.indexOf(
+            file.name
+              .split(".")
+              [file.name.split(".").length - 1].toLocaleUpperCase()
+          ) != -1
+        ) {
+          if (file.size / 1024 / 1024 > 80) {
+            this.$message.error("上传文件大于80兆,请重新选择文件!");
+            this.inputShow = true;
+            var a = _this.$refs.upload1.uploadFiles;
+            a.splice(a.length - 1, a.length);
+            // loading.close();
+            return;
+          }
+        } else if (
+          file.name
+            .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
+        ) {
+          if (file.size / 1024 / 1024 > 80) {
+            this.$message.error("添加成上传文件大于80兆,请重新选择文件!");
+            this.inputShow = true;
+            var a = _this.$refs.upload1.uploadFiles;
+            a.splice(a.length - 1, a.length);
+            // loading.close();
+            return;
+          }
+        }
+      }
       this.inputShow = false;
       _this.unitJson[unitIndex].chapterInfo[0].taskJson[
         itemTaskIndex
@@ -5424,53 +5424,53 @@ export default {
 
       var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
       var _this = this;
-      // if (type == 3) {
-      //   var b = [
-      //     "DOC",
-      //     "DOCX",
-      //     "DOCM",
-      //     "DOTM",
-      //     "DOTX",
-      //     "PPTX",
-      //     "PPSX",
-      //     "PPT",
-      //     "PPS",
-      //     "PPTM",
-      //     "POTM",
-      //     "PPAM",
-      //     "POTX",
-      //     "PPSM",
-      //   ];
-      //   if (
-      //     b.indexOf(
-      //       file.name
-      //         .split(".")
-      //         [file.name.split(".").length - 1].toLocaleUpperCase()
-      //     ) != -1
-      //   ) {
-      //     if (file.size / 1024 / 1024 > 50) {
-      //       this.$message.error("上传文件大于50兆,请重新选择文件!");
-      //       this.inputShow = true;
-      //       var a = _this.$refs.upload1.uploadFiles;
-      //       a.splice(a.length - 1, a.length);
-      //       // loading.close();
-      //       return;
-      //     }
-      //   } else if (
-      //     file.name
-      //       .split(".")
-      //       [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
-      //   ) {
-      //     if (file.size / 1024 / 1024 > 50) {
-      //       this.$message.error("添加成上传文件大于50兆,请重新选择文件!");
-      //       this.inputShow = true;
-      //       var a = _this.$refs.upload1.uploadFiles;
-      //       a.splice(a.length - 1, a.length);
-      //       // loading.close();
-      //       return;
-      //     }
-      //   }
-      // }
+      if (type == 3) {
+        var b = [
+          "DOC",
+          "DOCX",
+          "DOCM",
+          "DOTM",
+          "DOTX",
+          "PPTX",
+          "PPSX",
+          "PPT",
+          "PPS",
+          "PPTM",
+          "POTM",
+          "PPAM",
+          "POTX",
+          "PPSM",
+        ];
+        if (
+          b.indexOf(
+            file.name
+              .split(".")
+              [file.name.split(".").length - 1].toLocaleUpperCase()
+          ) != -1
+        ) {
+          if (file.size / 1024 / 1024 > 80) {
+            this.$message.error("上传文件大于80兆,请重新选择文件!");
+            this.inputShow = true;
+            var a = _this.$refs.upload1.uploadFiles;
+            a.splice(a.length - 1, a.length);
+            // loading.close();
+            return;
+          }
+        } else if (
+          file.name
+            .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
+        ) {
+          if (file.size / 1024 / 1024 > 80) {
+            this.$message.error("添加成上传文件大于80兆,请重新选择文件!");
+            this.inputShow = true;
+            var a = _this.$refs.upload1.uploadFiles;
+            a.splice(a.length - 1, a.length);
+            // loading.close();
+            return;
+          }
+        }
+      }
       this.inputShow = false;
       _this.unitJson[unitIndex].chapterInfo[0].taskJson[
         itemTaskIndex