@toolspack/ttd-pdfjs 0.1.7 → 0.1.8
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/README.md +2 -1
- package/lib/ttd-pdfjs.common.js +87 -89
- package/lib/ttd-pdfjs.umd.js +87 -89
- package/lib/ttd-pdfjs.umd.min.js +3 -3
- package/package.json +1 -1
- package/src/packages/pdfjs/PdfView.vue +17 -27
package/package.json
CHANGED
|
@@ -6,24 +6,22 @@
|
|
|
6
6
|
@page="onChangePage" @zoom="onScale" @rotate="onRotate"></switch-page>
|
|
7
7
|
</div>
|
|
8
8
|
<div class="pdf-view-area-wapper">
|
|
9
|
-
<div
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</div>
|
|
9
|
+
<div
|
|
10
|
+
class="center pdf-view-area"
|
|
11
|
+
@drop="onDrop"
|
|
12
|
+
@dragover="onDragOver"
|
|
13
|
+
:key="pdfurl"
|
|
14
|
+
:style="{'border': border?'1px solid #666': ''}"
|
|
15
|
+
v-if="pdfurl"
|
|
16
|
+
>
|
|
17
|
+
<div v-if="fileLoading" class="pdf-view-loading">文件加载中...</div>
|
|
18
|
+
<div v-else-if="pageRendering" class="pdf-view-rendering">内容渲染中...</div>
|
|
19
|
+
<canvas :key="pdfurl +'canvas'" class="canvasstyle" :style="{with: showWidth?showWidth+'px':'auto'}" ref="canvas"></canvas>
|
|
20
|
+
<div class="label-area">
|
|
21
|
+
<slot></slot>
|
|
24
22
|
</div>
|
|
25
|
-
<div v-else class="pdf-view-empty">未找到资源,请联系管理员!</div>
|
|
26
23
|
</div>
|
|
24
|
+
<div v-else class="pdf-view-empty">未找到资源,请联系管理员!</div>
|
|
27
25
|
</div>
|
|
28
26
|
</div>
|
|
29
27
|
</template>
|
|
@@ -179,7 +177,8 @@ export default {
|
|
|
179
177
|
if (!canvas) {
|
|
180
178
|
return false
|
|
181
179
|
}
|
|
182
|
-
|
|
180
|
+
// pdf 组件不应该 有滚动条
|
|
181
|
+
this.style.width = `${viewport.width + 2}px`;
|
|
183
182
|
this.pdfWidth = `${viewport.width}px`;
|
|
184
183
|
canvas.height = viewport.height
|
|
185
184
|
canvas.width = viewport.width
|
|
@@ -271,7 +270,6 @@ export default {
|
|
|
271
270
|
// url = encodeURI(url)
|
|
272
271
|
// console.log('-----encodeURI------', url)
|
|
273
272
|
// }
|
|
274
|
-
console.log('----PdfView---', url)
|
|
275
273
|
if (this.pdfDoc) {
|
|
276
274
|
// console.log('pdfDocument is ready destroy,,')
|
|
277
275
|
this.pdfDoc.destroy();
|
|
@@ -384,10 +382,6 @@ export default {
|
|
|
384
382
|
|
|
385
383
|
<style lang="less" scoped>
|
|
386
384
|
.pdf-view {
|
|
387
|
-
height: 100%;
|
|
388
|
-
width: 100%;
|
|
389
|
-
display: flex;
|
|
390
|
-
flex-direction: column;
|
|
391
385
|
box-sizing: border-box;
|
|
392
386
|
min-width: 688px;
|
|
393
387
|
}
|
|
@@ -396,11 +390,7 @@ export default {
|
|
|
396
390
|
margin: 10px 0;
|
|
397
391
|
}
|
|
398
392
|
.pdf-view-area-wapper {
|
|
399
|
-
|
|
400
|
-
overflow: auto;
|
|
401
|
-
width: 100%;
|
|
402
|
-
flex-shrink: 0%;
|
|
403
|
-
box-sizing: border-box;
|
|
393
|
+
overflow: hidden;
|
|
404
394
|
}
|
|
405
395
|
.pdf-view-area {
|
|
406
396
|
position: relative;
|