scorpio il y a 2 ans
Parent
commit
e47bd47c3d
1 fichiers modifiés avec 15 ajouts et 8 suppressions
  1. 15 8
      src/views/contract/component/info.vue

+ 15 - 8
src/views/contract/component/info.vue

@@ -102,6 +102,8 @@
 </template>
 
 <script>
+import api from '@/api/index.js'
+
 export default {
   name: 'info',
   props: {
@@ -204,14 +206,19 @@ export default {
      * 以图片形式查看文件
      */
     libraryDetail() {
-      this.$api.project
-        .articleDetailByFile(this.form.fileFolder.fileId)
-        .then(res => {
-          if (res.code === 200) {
-            this.preList = res.data.imgs.map(e => e.filePath)
-            this.showImage = true
-          }
-        })
+      if (api.offices.includes(this.form.fileFolder.suffix)) {
+        this.$api.project
+          .articleDetailByFile(this.form.fileFolder.fileId)
+          .then(res => {
+            if (res.code === 200) {
+              this.preList = res.data.imgs.map(e => e.filePath)
+              this.showImage = true
+            }
+          })
+      } else {
+        this.preList = [this.form.fileFolder.url]
+        this.showImage = true
+      }
     }
   }
 }