diff --git a/frontend/src/components/canvas/components/editor/Preview.vue b/frontend/src/components/canvas/components/editor/Preview.vue index 453227c1a2..2414ade6ec 100644 --- a/frontend/src/components/canvas/components/editor/Preview.vue +++ b/frontend/src/components/canvas/components/editor/Preview.vue @@ -443,6 +443,9 @@ export default { bus.$off('trigger-reset-button', this.triggerResetButton) }, methods: { + getCanvasHeight() { + return this.mainHeightCount + }, openChartDetailsDialog(paramInfo) { if (this.canvasId === 'canvas-main') { this.showChartInfo = paramInfo.showChartInfo diff --git a/frontend/src/views/panel/export/PDFPreExport.vue b/frontend/src/views/panel/export/PDFPreExport.vue index 0f5ec3e882..bb4469e738 100644 --- a/frontend/src/views/panel/export/PDFPreExport.vue +++ b/frontend/src/views/panel/export/PDFPreExport.vue @@ -82,7 +82,7 @@ export default { mainCanvasStyle() { if (this.toExport) { return { - width: '4096px' + width: '1280px' } } else { return { @@ -93,7 +93,7 @@ export default { templateHtmlStyle() { if (this.toExport) { return { - fontSize: '48px!important' + fontSize: '14px!important' } } else { return {} @@ -133,17 +133,16 @@ export default { _this.toExport = true setTimeout(() => { html2canvas(document.getElementById('exportPdf')).then(function(canvas) { - _this.exportLoading = false - const contentWidth = canvas.width / 4 - const contentHeight = canvas.height / 4 - const pageData = canvas.toDataURL('image/jpeg', 1.0) - const lp = contentWidth > contentHeight ? 'l' : 'p' - const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight]) - PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) - PDF.save(_this.panelName + '.pdf') - _this.$emit('closePreExport') - } - ) + _this.exportLoading = false + const contentWidth = canvas.width / 2 + const contentHeight = canvas.height / 2 + const pageData = canvas.toDataURL('image/jpeg', 1.0) + const lp = contentWidth > contentHeight ? 'l' : 'p' + const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight]) + PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) + PDF.save(_this.panelName + '.pdf') + _this.$emit('closePreExport') + }) }, 1500) }, 500) } diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 48118c3784..79e7c8142d 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -17,7 +17,7 @@ style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;" >