zengyicheng 1 年間 前
コミット
48d770005a

+ 40 - 1
src/components/pages/components/classStudentComponents/worksDetail3.vue

@@ -111,7 +111,7 @@
                       <el-button
                         type="primary"
                         size="small"
-                        @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                        @click="openFile2(worksDetail[sIndex].wpptInfo[0])"
                         >查看文档
                       </el-button>
                     </div>
@@ -2248,6 +2248,45 @@ export default {
       this.pptImgUrl = f;
       this.dialogVisible6 = true;
     },
+    openFile2(f) {
+      this.pptImgUrl = f.wpptInfo;
+      var fileA = [
+        "DOC",
+        "DOCX",
+        "DOCM",
+        "DOTM",
+        "DOTX",
+        "PPTX",
+        "PPSX",
+        "PPT",
+        "PPS",
+        "PPTM",
+        "POTM",
+        "PPAM",
+        "POTX",
+        "PPSM",
+        "XLSX",
+        "XLS",
+      ];
+      if (
+        fileA.indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleUpperCase()
+        ) != -1
+      ) {
+        this.showPDF = false; //word 文件
+      } else if (
+        "pdf".indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleLowerCase()
+        ) != -1
+      ) {
+        this.showPDF = true; //pdf
+      }
+      this.dialogVisible6 = true;
+    },
     //获取班级列表
     getClass() {
       let params = {

+ 40 - 1
src/components/pages/components/studentWorksDetail.vue

@@ -340,7 +340,7 @@
                             <el-button
                               type="primary"
                               size="small"
-                              @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                              @click="openFile2(worksDetail[sIndex].wpptInfo[0])"
                             >
                               查看文档</el-button
                             >
@@ -3203,6 +3203,45 @@ export default {
       this.pptImgUrl = f;
       this.dialogVisible6 = true;
     },
+    openFile2(f) {
+      this.pptImgUrl = f.wpptInfo;
+      var fileA = [
+        "DOC",
+        "DOCX",
+        "DOCM",
+        "DOTM",
+        "DOTX",
+        "PPTX",
+        "PPSX",
+        "PPT",
+        "PPS",
+        "PPTM",
+        "POTM",
+        "PPAM",
+        "POTX",
+        "PPSM",
+        "XLSX",
+        "XLS",
+      ];
+      if (
+        fileA.indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleUpperCase()
+        ) != -1
+      ) {
+        this.showPDF = false; //word 文件
+      } else if (
+        "pdf".indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleLowerCase()
+        ) != -1
+      ) {
+        this.showPDF = true; //pdf
+      }
+      this.dialogVisible6 = true;
+    },
     searchWork1() {
       this.page = 1;
       this.chooseTask = "";

+ 40 - 1
src/components/pages/components/worksDetail2GM.vue

@@ -185,7 +185,7 @@
                             </div>
                           </div>
                           <div v-if="worksDetail[sIndex].wpptInfo.length > 0">
-                            <el-button class="btnClassGM" type="primary" size="small" @click="openFile(worksDetail[sIndex].wpptInfo[0])">
+                            <el-button class="btnClassGM" type="primary" size="small" @click="openFile2(worksDetail[sIndex].wpptInfo[0])">
                               查看文档</el-button>
                           </div>
                         </div>
@@ -1082,6 +1082,45 @@ export default {
       this.pptImgUrl = f;
       this.dialogVisible6 = true;
     },
+    openFile2(f) {
+      this.pptImgUrl = f.wpptInfo;
+      var fileA = [
+        "DOC",
+        "DOCX",
+        "DOCM",
+        "DOTM",
+        "DOTX",
+        "PPTX",
+        "PPSX",
+        "PPT",
+        "PPS",
+        "PPTM",
+        "POTM",
+        "PPAM",
+        "POTX",
+        "PPSM",
+        "XLSX",
+        "XLS",
+      ];
+      if (
+        fileA.indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleUpperCase()
+        ) != -1
+      ) {
+        this.showPDF = false; //word 文件
+      } else if (
+        "pdf".indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleLowerCase()
+        ) != -1
+      ) {
+        this.showPDF = true; //pdf
+      }
+      this.dialogVisible6 = true;
+    },
     //获取班级列表
     getClass() {
       this.isLoading = true;

+ 40 - 1
src/components/pages/components/worksDetail3.vue

@@ -111,7 +111,7 @@
                       <el-button
                         type="primary"
                         size="small"
-                        @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                        @click="openFile2(worksDetail[sIndex].wpptInfo[0])"
                         >查看文档
                       </el-button>
                     </div>
@@ -2250,6 +2250,45 @@ export default {
       this.pptImgUrl = f;
       this.dialogVisible6 = true;
     },
+    openFile2(f) {
+      this.pptImgUrl = f.wpptInfo;
+      var fileA = [
+        "DOC",
+        "DOCX",
+        "DOCM",
+        "DOTM",
+        "DOTX",
+        "PPTX",
+        "PPSX",
+        "PPT",
+        "PPS",
+        "PPTM",
+        "POTM",
+        "PPAM",
+        "POTX",
+        "PPSM",
+        "XLSX",
+        "XLS",
+      ];
+      if (
+        fileA.indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleUpperCase()
+        ) != -1
+      ) {
+        this.showPDF = false; //word 文件
+      } else if (
+        "pdf".indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleLowerCase()
+        ) != -1
+      ) {
+        this.showPDF = true; //pdf
+      }
+      this.dialogVisible6 = true;
+    },
     //获取班级列表
     getClass() {
       let params = {

+ 40 - 1
src/components/pages/components/worksDetail3GM.vue

@@ -66,7 +66,7 @@
                       </div>
                     </div>
                     <div v-if="worksDetail[sIndex].wpptInfo.length > 0">
-                      <el-button class="btnClassGM" type="primary" size="small" @click="openFile(worksDetail[sIndex].wpptInfo[0])">查看文档
+                      <el-button class="btnClassGM" type="primary" size="small" @click="openFile2(worksDetail[sIndex].wpptInfo[0])">查看文档
                       </el-button>
                     </div>
                   </div>
@@ -932,6 +932,45 @@ export default {
       this.pptImgUrl = f;
       this.dialogVisible6 = true;
     },
+    openFile2(f) {
+      this.pptImgUrl = f.wpptInfo;
+      var fileA = [
+        "DOC",
+        "DOCX",
+        "DOCM",
+        "DOTM",
+        "DOTX",
+        "PPTX",
+        "PPSX",
+        "PPT",
+        "PPS",
+        "PPTM",
+        "POTM",
+        "PPAM",
+        "POTX",
+        "PPSM",
+        "XLSX",
+        "XLS",
+      ];
+      if (
+        fileA.indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleUpperCase()
+        ) != -1
+      ) {
+        this.showPDF = false; //word 文件
+      } else if (
+        "pdf".indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleLowerCase()
+        ) != -1
+      ) {
+        this.showPDF = true; //pdf
+      }
+      this.dialogVisible6 = true;
+    },
     //获取班级列表
     getClass() {
       this.isLoading = true;

+ 40 - 1
src/components/pages/myReport/components/MyLookComponent/worksDetail3.vue

@@ -111,7 +111,7 @@
                       <el-button
                         type="primary"
                         size="small"
-                        @click="openFile(worksDetail[sIndex].wpptInfo[0])"
+                        @click="openFile2(worksDetail[sIndex].wpptInfo[0])"
                         >查看文档
                       </el-button>
                     </div>
@@ -2249,6 +2249,45 @@ export default {
       this.pptImgUrl = f;
       this.dialogVisible6 = true;
     },
+    openFile2(f) {
+      this.pptImgUrl = f.wpptInfo;
+      var fileA = [
+        "DOC",
+        "DOCX",
+        "DOCM",
+        "DOTM",
+        "DOTX",
+        "PPTX",
+        "PPSX",
+        "PPT",
+        "PPS",
+        "PPTM",
+        "POTM",
+        "PPAM",
+        "POTX",
+        "PPSM",
+        "XLSX",
+        "XLS",
+      ];
+      if (
+        fileA.indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleUpperCase()
+        ) != -1
+      ) {
+        this.showPDF = false; //word 文件
+      } else if (
+        "pdf".indexOf(
+          this.pptImgUrl
+            .split(".")
+            [this.pptImgUrl.split(".").length - 1].toLocaleLowerCase()
+        ) != -1
+      ) {
+        this.showPDF = true; //pdf
+      }
+      this.dialogVisible6 = true;
+    },
     //获取班级列表
     getClass() {
       let params = {