zhongshujie
3 天以前 1695fcd442fe2cefb6d3b63869ad8a72ebd5210a
src/components/pdfview/index.vue
@@ -1,15 +1,7 @@
<!-- @format -->
<template>
  <el-dialog
    :visible.sync="localDialogVisible"
    @open="hadleOpenDialog"
    width="60vw"
    top="2vh"
    append-to-body
    lock-scroll
    :show-close="false"
    class="custom-dialog"
  >
  <el-dialog :visible.sync="localDialogVisible" @open="hadleOpenDialog" width="60vw" top="2vh" append-to-body
    lock-scroll :show-close="false" class="custom-dialog">
    <div slot="title" class="header_title">
      <span>{{ pdfTitle }}</span>
      <span @click="closeDialog"> x </span>
@@ -54,7 +46,7 @@
    return {
      localDialogVisible: false,
      currentPageSrc: "",
      currentPage: 1,
      currentPage: 3,
      totalPage: 1,
      viewerCon: null,
      preViewMd5: "",
@@ -92,7 +84,7 @@
  methods: {
    hadleOpenDialog() {
      this.preViewMd5 = this.md5;
      this.currentPage = 1;
      this.currentPage = 3;
      this.currentPageSrc = "";
      this.totalPage = 1;
      this.viewerCon?.destroy();
@@ -174,7 +166,7 @@
            if (this.currentPage < this.totalPage) {
              this.currentPage++;
              if (this.currentPage <= this.totalPage) {
                this.createDom(this.currentPage, ele);
                this.createDom(this.currentPage);
              }
            }
          }
@@ -182,6 +174,7 @@
        });
      }
    },
    getFileInfo() {
      // 获取目录
@@ -198,8 +191,8 @@
          } catch (error) {
            console.log(error, "pdf返回值类型错误");
          }
          Math.min(3, res.totalPages);
          for (let i = 0; i <= Math.min(3, res.totalPages); i++) {
          const maxPages = Math.min(3, this.totalPage);
          for (let i = 0; i < maxPages; i++) {
            this.createDom(i + 1);
          }
          this.loading = false;
@@ -211,6 +204,7 @@
          this.loading = false;
        });
    },
    getPageImage(page) {
      const ctx = process.env.VUE_APP_API_URL;
      return (