Răsfoiți Sursa

浏览修改

yusheng 1 an în urmă
părinte
comite
89bf6ec51b
1 a modificat fișierele cu 36 adăugiri și 35 ștergeri
  1. 36 35
      src/views/doc/components/browse.vue

+ 36 - 35
src/views/doc/components/browse.vue

@@ -7,7 +7,7 @@
     <iframe
       :src="fileUrl"
       width="100%"
-      style="height: calc(70vh - 280px);margin-top: 30px;"
+      style="height: calc(70vh - 280px); margin-top: 30px"
       frameborder="0"
       allowfullscreen="true"
     ></iframe>
@@ -31,46 +31,47 @@
 </template>
 
 <script>
-import { getFileType } from '../util.js';
+  import { getFileType } from '../util.js';
 
-export default {
-  data() {
-    return {
-      fileType: 1,
-      fileUrl: '',
-      showEditFlag: false
-    };
-  },
+  export default {
+    data() {
+      return {
+        fileType: 1,
+        fileUrl: '',
+        showEditFlag: false
+      };
+    },
 
-  methods: {
-    setFileUrl(row) {
-      this.fileUrl=''
-      let file = row.storagePath[0];
-      let fileNames=file.storePath.split('/')
-      let url = window.location.origin+'/api/main/file/getFile?objectName='+file.storePath+'&fullfilename='+fileNames[fileNames.length-1]
-      this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
-     
+    methods: {
+      setFileUrl(row) {
+        this.fileUrl = '';
+        setTimeout(() => {
+          let file = row.storagePath[0];
+          let fileNames = file.storePath.split('/');
+          let url =window.location.origin +'/api/main/file/getFile?objectName=' +file.storePath +'&fullfilename=' +fileNames[fileNames.length - 1];
+          this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+        });
+      }
     }
-  }
-};
+  };
 </script>
 <style scoped lang="scss">
-.browse {
-  position: relative;
-  .fullscreen {
-    position: absolute;
-    top: 10px;
-    right: 10px;
-    font-size: 16px;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    flex-direction: column;
-    cursor: pointer;
-    background: #fff;
-    i {
+  .browse {
+    position: relative;
+    .fullscreen {
+      position: absolute;
+      top: 10px;
+      right: 10px;
       font-size: 16px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+      cursor: pointer;
+      background: #fff;
+      i {
+        font-size: 16px;
+      }
     }
   }
-}
 </style>