浏览代码

文档管理模块的分模块的分享和预览界面更改

yxc 2 年之前
父节点
当前提交
aa839393f9
共有 3 个文件被更改,包括 176 次插入79 次删除
  1. 8 7
      src/views1/File/Individual/IndividualView.vue
  2. 74 51
      src/views1/File/Part/PartView.vue
  3. 94 21
      src/views1/File/Publi/PublicView.vue

+ 8 - 7
src/views1/File/Individual/IndividualView.vue

@@ -228,7 +228,7 @@
         </el-dialog>
 
         <!-- 预览对话框 -->
-        <div class="dhk" v-if="a">
+        <div class="dhk" v-if="preview">
           <video :src="vid" controls v-if="vid1"></video>
           <audio :src="aud" controls v-if="aud1"></audio>
 
@@ -292,7 +292,7 @@
         rotationAngle: 0,
 
         // 预览界面
-        a: false,
+        preview: false,
 
         //视频路径和显示
         vid: "",
@@ -408,7 +408,7 @@
 
       // 预览关闭
       gb() {
-        this.a = false;
+        this.preview = false;
       },
 
       //选择标签关闭
@@ -523,6 +523,7 @@
 
       //预览
       handlePreview(row) {
+        console.log(row);
         // console.log( this.$route.meta.title);
         // row.isEdit = false;
         // this.$tab.openPage(
@@ -541,19 +542,19 @@
 
         //判断后缀名
         if (videos.some(item => item == row.docType)) {
-          this.a = true;
+          this.preview = true;
           this.vid1 = true;
           this.aud1 = false;
           this.img1 = false;
           this.vid = row.docPath;
         } else if (audios.some(item => item == row.docType)) {
-          this.a = true;
+          this.preview = true;
           this.aud1 = true;
           this.vid1 = false;
           this.img1 = false;
           this.aud = row.docPath;
         } else if (pictures.some(item => item == row.docType)) {
-          this.a = true;
+          this.preview = true;
           this.aud1 = false;
           this.vid1 = false;
           this.img1 = true;
@@ -889,7 +890,7 @@
         }
       }
     }
-
+    //预览弹窗
     .dhk {
       width: calc(100vw * (1500 / 1920));
       height: calc(100vh * (850 / 1080));

+ 74 - 51
src/views1/File/Part/PartView.vue

@@ -156,39 +156,14 @@
               align="left"
               :header-cell-style="{'text-align':'center'}"
             >
-              <el-table-column type="selection" width="55" align="center" />
+            <el-table-column type="selection" width="55" align="center" />
               <el-table-column label="文件名称" align="left" prop="docName" />
-              <el-table-column
-                label="文件大小"
-                align="center"
-                prop="docSize"
-                :formatter="fileSizeData"
-                width="100"
-              />
-              <el-table-column
-                label="修改时间"
-                align="center"
-                prop="updateTime"
-              />
-              <el-table-column
-                label="文件级别"
-                align="center"
-                prop="docLevel"
-                :formatter="fileLevelData"
-                width="90"
-              />
-              <el-table-column
-                label="文件年份"
-                align="center"
-                prop="createYear"
-                width="90"
-              />
-              <el-table-column
-                label="标签"
-                align="center"
-                prop="tagName"
-                width="250"
-              >
+              <el-table-column label="文件大小" align="center" prop="docSize" :formatter="fileSizeData" width="100" />
+              <el-table-column label="修改时间" align="center" prop="updateTime" />
+              <el-table-column label="文件级别" align="center" prop="docLevel" :formatter="fileLevelData" width="90" />
+              <el-table-column label="文件年份" align="center" prop="createYear" width="90" />
+              <el-table-column label="文件类型" align="center" prop="docType" />
+              <el-table-column label="标签" align="center" prop="tagName" width="250">
                 <template slot-scope="scope">
                   <div v-if="scope.row.tagList != []">
                     <el-tag v-for="item in scope.row.tagList" :key="item.tagId">
@@ -368,7 +343,7 @@
 
 
                <!-- 预览对话框 -->
-      <div class="dhk" v-if="a">
+      <div class="dhk" v-if="preview">
        <video :src="vid" controls v-if="vid1"></video>
        <audio :src="aud" controls v-if="aud1"></audio>
 
@@ -423,7 +398,7 @@ export default {
     rotationAngle: 0,
     
     // 预览界面
-    a:false,
+    preview:false,
     
     //视频路径和显示
     vid:"",
@@ -651,27 +626,29 @@ export default {
 
       //判断后缀名
       if(sp.some(item=>item==row.docType)){
-        this.a=true;
+        this.preview=true;
         this.vid1=true;
         this.aud1=false;
         this.img1=false;
         this.vid=row.docPath;
       }else if(yp.some(item=>item==row.docType)){
-        this.a=true;
+        this.preview=true;
         this.aud1=true;
         this.vid1=false;
         this.img1=false;
         this.aud=row.docPath;
       }else if(tp.some(item=>item==row.docType)){
-        this.a=true;
+        this.preview=true;
         this.aud1=false;
         this.vid1=false;
         this.img1=true;
         this.imgg=row.docPath;
       }
       else{
-        this.$tab.openPage(
-        window.open("/individual/Pre/user/" + row.docId, '_blank'),
+        row.isEdit = false;
+          this.$tab.openPage(
+            window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
+              '_blank'),
       );
       }
     },
@@ -681,18 +658,63 @@ export default {
     },
     //预览
     handlePreview(row) {
-      row.isEdit = false;
-      this.$tab.openPage("文件[" + row.docName + "]预览", '/doc/oo-edit/index/' + row.docId, row);
-    },
-    //在线编辑
-    handleEdit(row) {
-      row.isEdit = true;
-      this.$tab.openPage(
-        "文件[" + row.docName + "]在线编辑",
-        "/doc/oo-edit/index/" + row.docId,
-        row
-      );
-    },
+        console.log(row);
+        // console.log( this.$route.meta.title);
+        // row.isEdit = false;
+        // this.$tab.openPage(
+        //   // "文件[" + row.docName + "]预览",
+        // document.title = row.docName,
+        //   // window.open("/individual/Pre/user/" + row.docId, '_blank'),
+        //   // row
+        // );
+
+        //图片后缀名
+        var pictures = ['jpeg', 'tiff', 'raw', 'bmp', 'gif', 'png', 'jpg'];
+        //音频后缀名
+        var audios = ['mid', 'mp3', 'wav', 'wma', 'ra', 'ogg', 'flac', 'aac', 'ape'];
+        //视频后缀名
+        var videos = ['asf', 'avi', 'mp4', 'ogm', 'ifo', 'mpg', 'mov', 'mpeg', 'mpg', 'vob', 'wmv', 'rm', 'rmvb'];
+
+        //判断后缀名
+        if (videos.some(item => item == row.docType)) {
+          this.preview = true;
+          this.vid1 = true;
+          this.aud1 = false;
+          this.img1 = false;
+          this.vid = row.docPath;
+        } else if (audios.some(item => item == row.docType)) {
+          this.preview = true;
+          this.aud1 = true;
+          this.vid1 = false;
+          this.img1 = false;
+          this.aud = row.docPath;
+        } else if (pictures.some(item => item == row.docType)) {
+          this.preview = true;
+          this.aud1 = false;
+          this.vid1 = false;
+          this.img1 = true;
+          this.imgg = row.docPath;
+        } else {
+          row.isEdit = false;
+          this.$tab.openPage(
+            window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
+              '_blank'),
+            // window.open("/individual/Pre/user/" + row.docId +"/title/"+ row.docName, '_blank'),
+          );
+          // console.log(111);
+        }
+        // console.log(row.docPath);
+        // console.log(vid);
+      },
+
+      //在线编辑
+      handleEdit(row) {
+        row.isEdit = true;
+        this.$tab.openPage(
+          window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
+            '_blank')
+        );
+      },
     //先获取左边目录树,拿到目录ID和spaceId才能查询
     dirTree() {
         this.loading = true;
@@ -977,6 +999,7 @@ export default {
       }
     }
   }
+  //预览弹窗
   .dhk{
     width: calc(100vw * (1500 / 1920));
     height: calc(100vh * (850 / 1080));

+ 94 - 21
src/views1/File/Publi/PublicView.vue

@@ -158,6 +158,7 @@
                 align="center"
                 prop="createYear"
               />
+              <el-table-column label="文件类型" align="center" prop="docType" />
               <el-table-column
                 label="标签"
                 align="center"
@@ -319,7 +320,7 @@
         </el-dialog>
 
                 <!-- 预览对话框 -->
-      <div class="dhk" v-if="a">
+      <div class="dhk" v-if="preview">
        <video :src="vid" controls v-if="vid1"></video>
        <audio :src="aud" controls v-if="aud1"></audio>
 
@@ -369,7 +370,7 @@ export default {
       rotationAngle: 0,
     
     // 预览界面
-    a:false,
+    preview:false,
     
     //视频路径和显示
     vid:"",
@@ -484,7 +485,7 @@ export default {
 
     // 预览关闭
     gb(){
-    this.a=false;
+    this.preview=false;
     },
 
     //选择标签关闭
@@ -591,30 +592,66 @@ export default {
     },
     //分享
     handleShare(row) {
-      this.$router.push("/doc/share-user/user/" + row.docId);
-    },
+        this.$router.push("/home/file/individual/share/user/" + row.docId);
+      },
     /**下载按钮操作*/
     handleDownload(row) {
       location.href = row.docPath;
     },
     //预览
     handlePreview(row) {
-      row.isEdit = false;
-      this.$tab.openPage(
-        "文件[" + row.docName + "]预览",
-        "/doc/oo-edit/index/" + row.docId,
-        row
-      );
-    },
-    //在线编辑
-    handleEdit(row) {
-      row.isEdit = true;
-      this.$tab.openPage(
-        "文件[" + row.docName + "]在线编辑",
-        "/doc/oo-edit/index/" + row.docId,
-        row
-      );
-    },
+        // console.log( this.$route.meta.title);
+        // row.isEdit = false;
+        // this.$tab.openPage(
+        //   // "文件[" + row.docName + "]预览",
+        // document.title = row.docName,
+        //   // window.open("/individual/Pre/user/" + row.docId, '_blank'),
+        //   // row
+        // );
+
+        //图片后缀名
+        var pictures = ['jpeg', 'tiff', 'raw', 'bmp', 'gif', 'png', 'jpg'];
+        //音频后缀名
+        var audios = ['mid', 'mp3', 'wav', 'wma', 'ra', 'ogg', 'flac', 'aac', 'ape'];
+        //视频后缀名
+        var videos = ['asf', 'avi', 'mp4', 'ogm', 'ifo', 'mpg', 'mov', 'mpeg', 'mpg', 'vob', 'wmv', 'rm', 'rmvb'];
+
+        //判断后缀名
+        if (videos.some(item => item == row.docType)) {
+          this.preview = true;
+          this.vid1 = true;
+          this.aud1 = false;
+          this.img1 = false;
+          this.vid = row.docPath;
+        } else if (audios.some(item => item == row.docType)) {
+          this.preview = true;
+          this.aud1 = true;
+          this.vid1 = false;
+          this.img1 = false;
+          this.aud = row.docPath;
+        } else if (pictures.some(item => item == row.docType)) {
+          this.preview = true;
+          this.aud1 = false;
+          this.vid1 = false;
+          this.img1 = true;
+          this.imgg = row.docPath;
+        } else {
+          row.isEdit = false;
+          this.$tab.openPage(
+            window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
+              '_blank'),
+          );
+        }
+      },
+
+      //在线编辑
+      handleEdit(row) {
+        row.isEdit = true;
+        this.$tab.openPage(
+          window.open('/individual/Pre/user/' + row.docId + "?row=" + JSON.stringify(row),
+            '_blank')
+        );
+      },
     //先获取左边目录树,拿到目录ID和spaceId才能查询
     dirTree() {
       this.loading = true;
@@ -902,6 +939,42 @@ export default {
       }
     }
   }
+  //弹窗界面
+  .dhk {
+      width: calc(100vw * (1500 / 1920));
+      height: calc(100vh * (850 / 1080));
+      // background: salmon;
+      background: #0F1540FF;
+      position: absolute;
+      top: 10%;
+      left: 10%;
+      z-index: 99;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+      .gb {
+        position: absolute;
+        top: 0;
+        right: 0;
+      }
+
+      video {
+        width: calc(100vw * (1440 / 1920));
+        height: calc(100vh * (810 / 1080));
+      }
+
+      .el-image {
+        width: calc(100vw * (960 / 1920));
+        height: calc(100vh * (720 / 1080));
+      }
+
+      .el-button-group {
+        position: absolute;
+        top: 10%;
+        right: 1%;
+      }
+    }
 }
 //标签按钮
 ::v-deep .el-tag {