lsc 2 年之前
父节点
当前提交
99d37e432e
共有 2 个文件被更改,包括 84 次插入84 次删除
  1. 2 2
      src/components/pages/addCourse.vue
  2. 82 82
      src/components/pages/student/addCourse.vue

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

@@ -1762,7 +1762,7 @@
                                 </div>
                               </div>
                             </div>
-                            <!-- <div class="tool">
+                            <div class="tool">
                               <div
                                 class="whiteBIcon"
                                 @click="openTools(itemTaskIndex, 52, toolIndex)"
@@ -1789,7 +1789,7 @@
                                   /><span>已选择</span>
                                 </div>
                               </div>
-                            </div> -->
+                            </div>
                             <div class="tool">
                               <div
                                 class="whiteBIcon"

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

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