askbot-dragon 1.3.81 → 1.3.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.3.81",
3
+ "version": "1.3.83",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
package/public/index.html CHANGED
@@ -38,7 +38,7 @@
38
38
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.1.266/pdf_viewer.js" integrity="sha512-/Kuwn901frjpfp2NMgB9S/LEtm+ilDzwVy/iS8MlY0BeIwkvtjGTxnjY8u+fn8QyDxS23OLJ+M2g++W/zsb0nw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
39
39
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.1.266/pdf_viewer.css" integrity="sha512-0LYOXoVuJYymEk9nBWqkOCflK2quQSJHaKavRoiaaq7LFM0ThLErV8uqE9vBuXAliN+8qbymsx0u5C9B/pHn7g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
40
40
  <!-- hammer.js -->
41
- <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
41
+ <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
42
42
  <style>
43
43
  *{
44
44
  margin: 0;
@@ -21,7 +21,7 @@ if(pdfjsLib) {
21
21
  // 'pdfjs-dist/build/pdf.worker';
22
22
  }
23
23
  const { TextLayerBuilder } = window['pdfjs-dist/web/pdf_viewer']
24
- import { zoomElement } from '../assets/js/hammer'
24
+ // import { zoomElement } from '../assets/js/hammer'
25
25
  export default {
26
26
  name: 'pdfView',
27
27
  props:['tagIds'],
@@ -77,8 +77,9 @@ export default {
77
77
  methods: {
78
78
  getpdfResloutePage (pdfResloute) {
79
79
  // 根据当前页面宽度设置缩放比例
80
- this.scale = this.$refs.pdfView.clientWidth / pdfResloute.pageWidth
81
- // this.scale = 1
80
+ // this.scale = Math.round(this.$refs.pdfView.clientWidth / pdfResloute.pageWidth * 100) / 100
81
+ // console.log(this.scale,'this.scale');
82
+ this.scale = 1
82
83
  // 从后端获取到当前分片后所有的pdf页码,初始化数组,数组下{} 对应每页pdf文件
83
84
  this.pdfUrl = pdfResloute.publicPageFileUrl.substring(0, pdfResloute.publicPageFileUrl.lastIndexOf('/') + 1)
84
85
  this.initPages(pdfResloute.total)
@@ -174,7 +175,7 @@ export default {
174
175
  this.pageSize = pageSize
175
176
  // 创建内容绘制区,并设置大小
176
177
  this.contentView.style.width = `${pageSize.width}px`;
177
- this.contentView.style.height = `${(this.totalPageCount * (pageSize.height + this.PAGE_INTVERVAL)) + this.PAGE_INTVERVAL}px`;
178
+ this.contentView.style.height = `${(this.totalPageCount * (pageSize.height + this.PAGE_INTVERVAL)) * (this.$refs.pdfView.clientWidth / pageSize.width) + this.PAGE_INTVERVAL}px`;
178
179
  this.contentView.style.margin = '0 auto 0'
179
180
  this.contentView.style.position = 'relative'
180
181
  // contentView.style.overflowY = 'auto'
@@ -262,6 +263,8 @@ export default {
262
263
  pageDom.appendChild(textLayer.textLayerDiv);
263
264
  page.dom = pageDom;
264
265
  this.contentView.appendChild(pageDom);
266
+ this.contentView.style.transform = `scale(${this.$refs.pdfView.clientWidth / this.pageSize.width}, ${this.$refs.pdfView.clientWidth / this.pageSize.width})`
267
+
265
268
  if (this.changetoolbar) {
266
269
  setTimeout(() => {
267
270
  this.renderHighlights()
@@ -283,7 +286,7 @@ export default {
283
286
  } else {
284
287
  this.$refs.pdfView.scrollTop = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL))}`
285
288
  }
286
- zoomElement(this.contentView)
289
+ // zoomElement(this.contentView)
287
290
  }, 100)
288
291
  }
289
292
  })