Browse Source

pdf获取总页数

lsc 2 years ago
parent
commit
1fa85d1791
2 changed files with 13 additions and 1 deletions
  1. 3 0
      src/components/components/pdf.vue
  2. 10 1
      src/components/liveProjectDetail.vue

+ 3 - 0
src/components/components/pdf.vue

@@ -68,6 +68,9 @@ export default {
     ppage(val) {
       this.pageNum = val;
     },
+    pageTotalNum(val) {
+      this.$emit("getPageTotal", val);
+    },
   },
   computed: {},
   created() {},

+ 10 - 1
src/components/liveProjectDetail.vue

@@ -38,7 +38,12 @@
           style="width: 100%; height: 100%; border: none"
           src="https://view.officeapps.live.com/op/view.aspx?src=https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0701%E5%AE%9E%E6%97%B6%E8%AF%BE%E5%A0%82%E6%A8%A1%E6%8B%9F%E6%BC%94%E7%A4%BA%E8%AF%BE%E4%BB%B61656644341323.pptx"
         ></iframe>-->
-        <pdf :pdfUrl="pdfUrl" style="width: 100%; height: 100%" :ppage="ppage"></pdf>
+        <pdf
+          :pdfUrl="pdfUrl"
+          style="width: 100%; height: 100%"
+          :ppage="ppage"
+          @getPageTotal="getPageTotal"
+        ></pdf>
       </div>
       <div
         v-if="steps > 0 && steps < 3"
@@ -378,6 +383,7 @@ export default {
       pdfUrl:
         "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0629%E5%AE%9E%E6%97%B6%E8%AF%BE%E5%A0%82%E6%A8%A1%E6%8B%9F%E6%BC%94%E7%A4%BA%E8%AF%BE%E4%BB%B61656920880446.pdf",
       ppage: 2,
+      pageTotal: 0,
       timer: null,
       isLoading: false,
       formLabelWidth: "100px",
@@ -686,6 +692,9 @@ export default {
           console.error(err);
         });
     },
+    getPageTotal(total) {
+      this.pageTotal = total;
+    },
   },
   beforeDestroy() {
     clearInterval(this.timer);