From 56cdf07f8496685ba906ea75e7eb2faebb35371b Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 06 十一月 2024 17:04:11 +0800
Subject: [PATCH] 加入富文本编辑器

---
 src/components/pdfview/index.vue |   69 ++++++----------------------------
 1 files changed, 13 insertions(+), 56 deletions(-)

diff --git a/src/components/pdfview/index.vue b/src/components/pdfview/index.vue
index ea9089b..138cb9c 100644
--- a/src/components/pdfview/index.vue
+++ b/src/components/pdfview/index.vue
@@ -88,9 +88,10 @@
       window.open(await getResourcePath(this.preViewMd5))
     },
     domViewer() {
-      let ele = (this.container ? this.container : document).getElementById(
-        'imageParent'
-      )
+      // let ele = (this.container ? this.container : document).getElementById(
+      //   'imageParent'
+      // )
+      let ele = document.getElementById('imageParent')
       this.viewerCon = new Viewer(ele, {
         inline: false,
         container: this.container
@@ -140,7 +141,15 @@
       this.MG.file
         .getPdfInfo({ md5: this.preViewMd5 })
         .then((res) => {
-          this.totalPage = res.totalPages
+          try {
+            if(typeof res === 'string' &&  res !== null ){
+              this.totalPage = JSON.parse(res).totalPages
+            }else if(typeof res === 'object' && res !== null) {
+              this.totalPage = res.totalPages
+            }
+          } catch (error) {
+              console.log(error,'pdf杩斿洖鍊肩被鍨嬮敊璇�');
+          }      
           this.createDom(this.currentPage)
           this.loading = false
         })
@@ -153,8 +162,6 @@
     },
     getPageImage(page) {
       const ctx = process.env.VUE_APP_API_URL
-      console.log(this.preViewMd5)
-
       return (
         ctx +
         '/file/GetPdfPageImage' +
@@ -168,53 +175,3 @@
   },
 }
 </script>
-<style scoped lang="less">
-// .pdfBox-component {
-//   width: 100%;
-//   height: 100%;
-//   position: relative;
-// }
-
-// .preview {
-//   width: 100%;
-//   height: 100%;
-
-//   .imageBox {
-//     height: calc(100% - 30px);
-//     overflow-x: hidden;
-//     overflow-y: auto;
-//     background: #ccc;
-//     box-sizing: border-box;
-//   }
-
-//   .imageBox:hover {
-//     cursor: zoom-in !important;
-//   }
-
-//   .bottom_tool {
-//     height: 30px;
-//     background-color: rgba(0, 0, 0, 0.8);
-//     display: flex;
-//     justify-content: flex-end;
-//     align-items: center;
-
-//     svg {
-//       margin-right: 15px;
-//       fill: #d1d1d1;
-//     }
-
-//     svg:hover {
-//       fill: #fff;
-//       cursor: pointer;
-//     }
-//   }
-// }
-
-// .notBox {
-//   position: absolute;
-//   top: 0;
-//   left: 0;
-//   width: 100%;
-//   height: calc(100% - 30px);
-//   min-height: 300px;
-// }</style>

--
Gitblit v1.9.1