|
@@ -298,6 +298,15 @@ import '@vue-office/docx/lib/index.css'
|
|
|
import VueOfficeExcel from '@vue-office/excel'
|
|
|
// 引入相关样式
|
|
|
import '@vue-office/excel/lib/index.css'
|
|
|
+
|
|
|
+const config = {
|
|
|
+ PAGE_TO_VIEW: 0,
|
|
|
+ SCALE: 1.0,
|
|
|
+ CMAP_URL: 'https://cdn-common.jianyu360.com/cdn/lib/pdfjs-dist/2.1.266/cmaps/',
|
|
|
+ CMAP_PACKED: true,
|
|
|
+ workerSrc: 'https://cdn-common.jianyu360.com/cdn/lib/pdfjs-dist/2.1.266/build/pdf.worker.min.js'
|
|
|
+}
|
|
|
+
|
|
|
@Component({
|
|
|
name: 'details-p',
|
|
|
mixins: [MixinTop],
|
|
@@ -623,7 +632,13 @@ export default class extends Vue {
|
|
|
|
|
|
getNumPages (url: string, type: any) {
|
|
|
try {
|
|
|
- const loadingTask = pdf.createLoadingTask(url)
|
|
|
+ console.log(77777777)
|
|
|
+ const loadingTask = pdf.createLoadingTask({
|
|
|
+ url,
|
|
|
+ cMapUrl: config.CMAP_URL,
|
|
|
+ cMapPacked: config.CMAP_PACKED
|
|
|
+ })
|
|
|
+ console.log(loadingTask)
|
|
|
loadingTask.promise.then((pdf: any) => {
|
|
|
const nums = type === 'preview' ? this.previewConfig.pageNums : pdf.numPages
|
|
|
this.pdfPage.url = loadingTask
|
|
@@ -633,6 +648,7 @@ export default class extends Vue {
|
|
|
console.error('pdf加载失败', err)
|
|
|
})
|
|
|
} catch (e: any) {
|
|
|
+ console.log(4444444444)
|
|
|
console.log(e)
|
|
|
}
|
|
|
}
|