浏览代码

feat: pdf预览调整

yangfeng 3 月之前
父节点
当前提交
9e2cee80da
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14 3
      apps/bigmember_pc/src/views/reportDownload/preview.vue

+ 14 - 3
apps/bigmember_pc/src/views/reportDownload/preview.vue

@@ -6,12 +6,22 @@
       :style="{ 'padding-bottom': !loginFlag ? adHeight + 'px' : 0 }"
       v-loading="loading"
     >
-      <iframe
+      <!-- <iframe
         class="iframe"
         :src="pdfUrl"
         :style="{ height: iframeHeight }"
         frameborder="0"
-      ></iframe>
+        type="application/pdf"
+      ></iframe> -->
+      <object
+        class="iframe"
+        :data="pdfUrl"
+        :style="{ height: iframeHeight }"
+        type="application/pdf"
+        style="width: 100%; height: 100%"
+      >
+        <p>您的浏览器不支持PDF预览,请<a :href="pdfUrl">点击下载</a></p>
+      </object>
       <AdSense
         v-show="!loginFlag"
         ref="adSense"
@@ -121,7 +131,8 @@ export default {
   }
   .iframe {
     flex: 1;
-    width: 100%;
+    width: 1200px !important;
+    margin: 0 auto;
   }
   .adsense {
     padding: 0;