lsc 2 年之前
父節點
當前提交
820f4acb7a
共有 2 個文件被更改,包括 176 次插入176 次删除
  1. 94 94
      src/components/pages/addCourse.vue
  2. 82 82
      src/components/pages/student/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 > 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;
+      //     }
+      //   }
+      // }
       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 > 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;
+      //     }
+      //   }
+      // }
       this.inputShow = false;
       _this.unitJson[unitIndex].chapterInfo[0].taskJson[
         itemTaskIndex

+ 82 - 82
src/components/pages/student/addCourse.vue

@@ -3829,47 +3829,47 @@ export default {
                 }
             }); //选择桶
             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;
-                        // 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;
-                        // 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 > 50) {
+            //             this.$message.error("上传文件大于50兆,请重新选择文件!");
+            //             this.inputShow = true;
+            //             // 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;
+            //             // loading.close();
+            //             return;
+            //         }
+            //     }
+            // }
             this.inputShow = false;
             _this.unitJson[unitIndex].chapterInfo[0].taskJson[
                 itemTaskIndex
@@ -3974,47 +3974,47 @@ export default {
                 }
             }); //选择桶
             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;
-                        // 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;
-                        // 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 > 50) {
+            //             this.$message.error("上传文件大于50兆,请重新选择文件!");
+            //             this.inputShow = true;
+            //             // 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;
+            //             // loading.close();
+            //             return;
+            //         }
+            //     }
+            // }
             _this.inputShow = false;
             _this.progress = 0;
             _this.proVisible = true;