dedsudiyu il y a 1 an
Parent
commit
f59f7c8804

+ 1 - 1
src/views/hierarchicalControl/hierarchicalControl/gradeManage/addPage.vue

@@ -141,7 +141,7 @@
                   </el-radio-group>
                 </el-form-item>
                 <el-tooltip placement="top" v-if="minItem.isUpload == 1" style="margin-left:10px;">
-                  <div slot="content">文档格式包含: pdf / doc / docx / ppt / pptx
+                  <div slot="content">文档格式包含: pdf / doc / docx
                     <br/>视频格式包含: mp4
                     <br/>图片格式包含: png / jpeg / gif
                   </div>

+ 1 - 3
src/views/hierarchicalControl/hierarchicalControl/gradeManageWork/addPage.vue

@@ -94,7 +94,7 @@
               </el-upload>
             </div>
             <div class="right-upload-box">
-              <p v-if="documentType">文件请上传 pdf / doc / docx / ppt / pptx格式</p>
+              <p v-if="documentType">文件请上传 pdf / doc / docx 格式</p>
               <p v-if="videoType">视频请上传 mp4</p>
               <p v-if="pictureType">图片请上传 png / jpeg / gif 格式</p>
             </div>
@@ -183,8 +183,6 @@
           self.indexOfList.push('application/pdf');
           self.indexOfList.push('application/msword');
           self.indexOfList.push('application/vnd.openxmlformats-officedocument.wordprocessingml.document');
-          self.indexOfList.push('application/vnd.ms-powerpoint');
-          self.indexOfList.push('application/vnd.openxmlformats-officedocument.presentationml.presentation');
         }else if(list[i] == '2'){
           self.videoType = true;
           self.indexOfList.push('video/mp4');

+ 2 - 2
src/views/safetyEducationExam/safeLearning/el_course/coursePreview.vue

@@ -32,7 +32,7 @@
       <!--word-->
       <iframe
         class="iframe"
-        v-if="exerciseData.postfix == 'pdf' || exerciseData.postfix == 'doc' || exerciseData.postfix == 'docx' || exerciseData.postfix == 'ppt' || exerciseData.postfix == 'pptx'"
+        v-if="exerciseData.postfix == 'pdf' || exerciseData.postfix == 'doc' || exerciseData.postfix == 'docx'"
         :src="exerciseData.iframeSrc" scrolling="auto" frameborder="0">
       </iframe>
       <!--富文本-->
@@ -90,7 +90,7 @@
         if(this.exerciseData.postfix == "mp4"){
           // this.getVideo();
           this.loading = true;
-        }else if(this.exerciseData.postfix == "pdf" || this.exerciseData.postfix == "doc" || this.exerciseData.postfix == "docx"||this.exerciseData.postfix == "ppt" || this.exerciseData.postfix == "pptx"){
+        }else if(this.exerciseData.postfix == "pdf" || this.exerciseData.postfix == "doc" || this.exerciseData.postfix == "docx"){
           this.getWord();
         }else if(this.exerciseData.type == 5){
           this.getRichText();

+ 2 - 2
src/views/safetyEducationExam/safeLearning/el_course/edit.vue

@@ -155,7 +155,7 @@
             <!--word-->
             <iframe
               class="iframe"
-              v-if="chapterData.postfix == 'pdf' || chapterData.postfix == 'doc' || chapterData.postfix == 'docx' || chapterData.postfix == 'ppt' || chapterData.postfix == 'pptx'"
+              v-if="chapterData.postfix == 'pdf' || chapterData.postfix == 'doc' || chapterData.postfix == 'docx'"
               :src="chapterData.iframeSrc" scrolling="auto" frameborder="0">
             </iframe>
             <!--富文本-->
@@ -841,7 +841,7 @@ import {getDeptDropList, getDeptNoAuthList} from "@/api/commonality/permission";
         this.$set(this.chapterData,'timeValue',timeValue);
         if(this.chapterData.postfix == "mp4"){
           this.getVideo();
-        }else if(this.chapterData.postfix == "pdf" || this.chapterData.postfix == "doc" || this.chapterData.postfix == "docx"||this.chapterData.postfix == "ppt" || this.chapterData.postfix == "pptx"){
+        }else if(this.chapterData.postfix == "pdf" || this.chapterData.postfix == "doc" || this.chapterData.postfix == "docx"){
           this.getWord();
         }else if(this.chapterData.type == 5){
           this.getRichText();

+ 3 - 5
src/views/safetyEducationExam/safeLearning/el_resources/index.vue

@@ -164,7 +164,7 @@
             <p>支持上传视频、图片、文件类型的课件</p>
             <p>图片请上传 png / jpeg / gif 格式</p>
             <p>视频请上传 mp4</p>
-            <p>文件请上传 pdf / doc / docx / ppt / pptx 格式</p>
+            <p>文件请上传 pdf / doc / docx 格式</p>
           </div>
         </el-form>
       </el-dialog>
@@ -228,7 +228,7 @@
               <p>支持上传视频、图片、文件类型的课件</p>
               <p>图片请上传 png / jpeg / gif 格式</p>
               <p>视频请上传 mp4 / WebM格式 </p>
-              <p>文件请上传 pdf / doc / docx / ppt / pptx 格式</p>
+              <p>文件请上传 pdf / doc / docx 格式</p>
             </div>
           </div>
         </el-form>
@@ -464,7 +464,7 @@ export default {
         },
       },
       attrs: {
-        accept: ["image/png","image/jpeg","image/gif","application/pdf","video/mp4","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]
+        accept: ["image/png","image/jpeg","image/gif","application/pdf","video/mp4","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]
       },
       statusText: {
         success: "上传成功",
@@ -596,8 +596,6 @@ export default {
         file.type == 'application/pdf' ||
         //视频
         file.type == 'video/mp4' ||
-        //ppt
-        file.type == 'application/vnd.ms-powerpoint' || file.type == 'application/vnd.openxmlformats-officedocument.presentationml.presentation' ||
         //word
         file.type == 'application/msword' || file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
       ) {

+ 2 - 2
src/views/safetyEducationExam/safeLearning/safeLearning/learning.vue

@@ -48,7 +48,7 @@
         <!--word-->
         <iframe
           class="iframe"
-          v-if="learningData.postfix == 'pdf' || learningData.postfix == 'doc' || learningData.postfix == 'docx' || learningData.postfix == 'ppt' || learningData.postfix == 'pptx'"
+          v-if="learningData.postfix == 'pdf' || learningData.postfix == 'doc' || learningData.postfix == 'docx'"
           :src="learningData.iframeSrc" scrolling="auto" frameborder="0">
         </iframe>
         <!--富文本-->
@@ -230,7 +230,7 @@
             this.learningData.chapterData = window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + this.learningData.chapterData
             // this.getVideo();
             // this.getVideoTwo();
-          }else if(this.learningData.postfix == "pdf" || this.learningData.postfix == "doc" || this.learningData.postfix == "docx"||this.learningData.postfix == "ppt" || this.learningData.postfix == "pptx"){
+          }else if(this.learningData.postfix == "pdf" || this.learningData.postfix == "doc" || this.learningData.postfix == "docx"){
             this.getWord();
           }else if(this.learningData.type == 5){
             this.getRichText();

+ 28 - 17
src/views/systemManagement/filePreview/index.vue

@@ -80,7 +80,7 @@
     <!--视频预览-->
     <lookVideoDialog ref="lookVideoDialog"></lookVideoDialog>
     <!--文件预览-->
-    <lookDocumentDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDialog>
+    <fullScreenFileLook ref="fullScreenFileLook"></fullScreenFileLook>
   </div>
 </template>
 
@@ -88,13 +88,14 @@
   import { getFileList,getFileCategory } from "@/api/systemManagement/index";
   import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
   import lookVideoDialog from '@/components/lookVideoDialog/lookVideoDialog.vue'
-  import lookDocumentDialog from '@/components/lookDocumentDialog/lookDocumentDialog.vue'
+  import fullScreenFileLook from "@/components/fullScreenFileLook/fullScreenFileLook.vue";
+
   export default {
     name: 'filePreview',
     components: {
       fullScreenView,
       lookVideoDialog,
-      lookDocumentDialog
+      fullScreenFileLook
     },
     data(){
       return{
@@ -156,25 +157,35 @@
       },
       //预览
       tableButton(item){
-        if(item.fileType){
-          if(item.fileType.indexOf("image") !== -1){
-            //图片预览
-            this.$set(this,'fullScreenViewProps',[item.fileUrl]);
-            this.$refs['fullScreenView'].initialize();
+        //判断类型
+        if(item.fileName&&item.fileUrl){
+          let type = '';
+          if(item.fileName.split('.')[1] == 'doc' || item.fileName.split('.')[1] == 'docx'){
+            type = 'docx'
+          }else if(item.fileName.split('.')[1] == 'xls' || item.fileName.split('.')[1] == 'xlsx'){
+            type = 'excel'
+          }else if(item.fileName.split('.')[1] == 'pdf'){
+            type = 'pdf'
+          }else if(item.fileName.split('.')[1] == 'png' || item.fileName.split('.')[1] == 'jpg' || item.fileName.split('.')[1] == 'gif'){
+            type = 'img'
           }else if(item.fileType.indexOf("video") !== -1){
-            //视频预览
-            this.$refs.lookVideoDialog.lookVideoDialogOpen(1,item.url,'预览');
-          }else if( item.fileType.indexOf("application/vnd.ms-excel") !== -1 ||
-            item.fileType.indexOf("application/vnd.ms-powerpoint") !== -1 ||
-            item.fileType.indexOf("application/vnd.ms-word") !== -1 ||
-            item.fileType.indexOf("application/pdf") !== -1 ){
-            //文档预览
-            this.lookDocumentButton(1,item.fileUrl)
+            type = 'mp4'
+          }
+          //整合地址
+          let url = window.location.href.split('://')[0]+'://'+localStorage.getItem('fileBrowseEnvironment')+item.fileUrl;
+          // 判断图片还是文件
+          if(type == 'img'){
+            this.$set(this,'fullScreenViewProps',[url]);
+            this.$refs['fullScreenView'].initialize();
+          }else if(type == 'docx' || type == 'excel' || type == 'pdf'){
+            this.$refs['fullScreenFileLook'].initialize(item.fileName,url,type);
+          }else if(type == 'mp4'){
+            this.$refs.lookVideoDialog.lookVideoDialogOpen(1,url,'预览');
           }else{
             this.msgError('该类型文件暂无法预览')
           }
         }else{
-          this.msgError('该类型文件暂无法预览')
+          this.msgError('数据异常无法预览')
         }
       },
       lookDocumentButton(type,url){