diff --git a/src/components/PdfViewer/viewer.vue b/src/components/PdfViewer/viewer.vue index b1454f38..5602d54f 100644 --- a/src/components/PdfViewer/viewer.vue +++ b/src/components/PdfViewer/viewer.vue @@ -38,6 +38,8 @@ 下载 打印 + 复制图片 + @@ -46,7 +48,7 @@
-
+
currentPdfUrl==>",this.loadPdfUrl) + // console.log("====>currentPdfUrl==>",this.loadPdfUrl) const publicPath ='/static/' - // return pdf.createLoadingTask({ - // url: this.loadPdfUrl, - // cMapUrl: `${publicPath}cmaps/`, - // cMapPacked: true - // }) return pdf.createLoadingTask({ - url: this.loadPdfUrl + url: this.loadPdfUrl, + cMapUrl: `${publicPath}cmaps/`, + cMapPacked: true }) + // return pdf.createLoadingTask({ + // url: this.loadPdfUrl + // }) } }, watch: { - pdfList(){ + "pdfList": { + handler (newValue, oldValue) { + console.log("===>watch pdfList==>",this.pdfList); + // 按照给定的数据排序 + this.cacheFileList=this.pdfList; - // 按照给定的数据排序 - this.cacheFileList=this.pdfList; + this.initA4List(); + this.showFirstFile(); + }, + deep: true + }, - this.initA4List(); - this.showFirstFile(); - }, thisPageCount(value) { - console.log("===>thisPageCount==>",value); + // console.log("===>thisPageCount==>",value); if(this.isA4){ this.doScale(75); @@ -147,32 +151,30 @@ export default { this.doScale(25); } }, - // isLoadComplete(newVal,oldVal){ - // console.log("===isLoadComplete=>this.cacheFileList==>",isLoadComplete,this.cacheFileList) - - // if(this.isA4){ - // this.showA4Page(1); - // }else{ - // let newTmpList = this.cacheFileList.sort((one, two) => { - // return one.seqNo - two.seqNo; - // }); - // this.cacheFileList=newTmpList; - // this.showFirstFile(1); - // // this.showSinglePage(1); - // } - // } }, mounted() { this.initA4List(); this.showFirstFile(); window.addEventListener('mousewheel', this.handleScroll, { passive: false }) - }, methods: { closeDialog(){ this.$emit("close"); }, + async copyImage() { + const canvas=this.$refs.pdf.$refs.canvas; + let dataURL = canvas.toDataURL({ pixelRatio: 1 }); + const data = await fetch(dataURL); + const blob = await data.blob(); + let ClipboardItem = window.ClipboardItem; + await navigator.clipboard.write([ + new ClipboardItem({ + [blob.type]: blob, + }), + ]); + this.$modal.msgSuccess('复制成功') + }, initA4List(){ this.cacheA4FileList=[]; const newList = Object.assign([], this.pdfList); @@ -482,7 +484,7 @@ export default { height: 200px; // background-image: radial-gradient(circle, rgb(165, 165, 165) 1px, #fff 1px); background-image: radial-gradient(circle, #9b9b9b 1px, #f0f0f0 1px); - background-size: 30px 30px; + background-size: 50px 50px; background-position: center center; } diff --git a/src/components/PdfViewer/xdpdf/componentFactory.js b/src/components/PdfViewer/xdpdf/componentFactory.js index 7ea49106..8424c24e 100644 --- a/src/components/PdfViewer/xdpdf/componentFactory.js +++ b/src/components/PdfViewer/xdpdf/componentFactory.js @@ -10,14 +10,17 @@ export default function(pdfjsWrapper) { render: function(h) { return h('span', { attrs: { - style: 'position: relative; display: block' + style: 'position: relative; display: block;' } }, [ h('canvas', { attrs: { - style: 'display: inline-block; width: 100%; height: 100%; vertical-align: top', + style: 'display: inline-block; width: 100%; height: 100%; vertical-align: top;-webkit-box-shadow:0 15px 15px rgb(0 0 0 / 37%);box-shadow: 0 15px 15px rgb(0 0 0 / 37%);', }, - ref:'canvas' + ref:'canvas', + on:{ + click:this.handleClick, + } }), h('span', { style: 'display: inline-block; width: 100%; height: 100%', @@ -61,6 +64,9 @@ export default function(pdfjsWrapper) { }, }, methods: { + handleClick:function() { + console.log("==pdf=handleClick=>"); + }, resize: function(size) { // check if the element is attached to the dom tree || resizeSensor being destroyed diff --git a/src/components/PdfViewer/xdpdf/pdfjsWrapper.js b/src/components/PdfViewer/xdpdf/pdfjsWrapper.js index 4519efab..6f846abe 100644 --- a/src/components/PdfViewer/xdpdf/pdfjsWrapper.js +++ b/src/components/PdfViewer/xdpdf/pdfjsWrapper.js @@ -84,10 +84,16 @@ export default function(PDFJS) { // 1in == 72pt // 1in == 96px - var PRINT_RESOLUTION = dpi === undefined ? 300 : dpi; + // var PRINT_RESOLUTION = dpi === undefined ? 300 : dpi; + // var PRINT_UNITS = PRINT_RESOLUTION / 72.0; + // var CSS_UNITS = 96.0 / 72.0; + + var PRINT_RESOLUTION = dpi === undefined ? 300 : dpi; var PRINT_UNITS = PRINT_RESOLUTION / 72.0; var CSS_UNITS = 96.0 / 72.0; + console.log("==>printPage==>PRINT_RESOLUTION=",PRINT_RESOLUTION) + var printContainerElement = document.createElement('div'); printContainerElement.setAttribute('id', 'print-container') diff --git a/src/utils/TanexPrinterSdk.js b/src/utils/TanexPrinterSdk.js index 12ac063f..34d120bb 100644 --- a/src/utils/TanexPrinterSdk.js +++ b/src/utils/TanexPrinterSdk.js @@ -21,8 +21,8 @@ class TanexPrinterSdk { VERSION="1.0.0" MAX_SENT_RETRY_COUNT = 9; - WS_URL = 'ws://'+process.env.VUE_APP_PRINTER_HOST+'/ws'; - // WS_URL = "ws://192.168.88.189:17080/ws"; + // WS_URL = 'ws://'+process.env.VUE_APP_PRINTER_HOST+'/ws'; + WS_URL = "ws://192.168.88.189:17080/ws"; HTTP_GET_PDF = 'http://'+process.env.VUE_APP_PRINTER_HOST+'/api/downPdfFile'; diff --git a/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue b/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue index 9812c4a3..069db4ba 100644 --- a/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue +++ b/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue @@ -76,33 +76,17 @@ @keyup.enter.native="handleQuery" /> - - 开票拒绝 - - + -->
@@ -180,14 +141,6 @@