| | |
| | | <!-- @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> |
| | |
| | | return { |
| | | localDialogVisible: false, |
| | | currentPageSrc: "", |
| | | currentPage: 1, |
| | | currentPage: 3, |
| | | totalPage: 1, |
| | | viewerCon: null, |
| | | preViewMd5: "", |
| | |
| | | methods: { |
| | | hadleOpenDialog() { |
| | | this.preViewMd5 = this.md5; |
| | | this.currentPage = 1; |
| | | this.currentPage = 3; |
| | | this.currentPageSrc = ""; |
| | | this.totalPage = 1; |
| | | this.viewerCon?.destroy(); |
| | |
| | | if (this.currentPage < this.totalPage) { |
| | | this.currentPage++; |
| | | if (this.currentPage <= this.totalPage) { |
| | | this.createDom(this.currentPage, ele); |
| | | this.createDom(this.currentPage); |
| | | } |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | |
| | | getFileInfo() { |
| | | // 获取目录 |
| | |
| | | } 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; |
| | |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | |
| | | getPageImage(page) { |
| | | const ctx = process.env.VUE_APP_API_URL; |
| | | return ( |