From 57d4f3fd2d64134c2a2d8df940ba8a6b3758af98 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 14 Oct 2021 18:20:27 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E6=89=93=E5=8C=85=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pom.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/pom.xml b/backend/pom.xml index 649a9928ca..a9dfd85ce0 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -268,10 +268,15 @@ src/main/resources - + true + + static/**/*.woff + static/**/*.woff2 + static/**/*.ttf + From c6482a8e844180413c0f3a55a178687f13a93430 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 15 Oct 2021 10:36:25 +0800 Subject: [PATCH 2/6] =?UTF-8?q?refactor:PDF=E5=AF=BC=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=87=BA=E7=AD=89=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=87=86=E5=A4=87=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?PDF=E5=AF=BC=E5=87=BA=E5=90=8E=E8=87=AA=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=AF=B9=E8=AF=9D=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/zh.js | 5 +- .../src/views/panel/export/PDFPreExport.vue | 34 ++++--- .../src/views/panel/list/PanelViewShow.vue | 97 +++++++++++-------- 3 files changed, 85 insertions(+), 51 deletions(-) diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 27f0413953..cfffdb0f43 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1333,7 +1333,10 @@ export default { new_window: '新窗口', now_window: '当前窗口', hyperLinks: '超链接', - link_open_tips: '仪表板非编辑状态可打开链接' + link_open_tips: '仪表板非编辑状态可打开链接', + data_loading: '数据准备中...', + export_loading: '导出中...', + export_pdf: '导出PDF' }, plugin: { local_install: '本地安装', diff --git a/frontend/src/views/panel/export/PDFPreExport.vue b/frontend/src/views/panel/export/PDFPreExport.vue index af64d5e2bb..3051561bae 100644 --- a/frontend/src/views/panel/export/PDFPreExport.vue +++ b/frontend/src/views/panel/export/PDFPreExport.vue @@ -1,5 +1,11 @@ @@ -36,6 +42,7 @@ export default { }, data() { return { + exportLoading: false, activeName: '', templateContentChange: '', time: '', @@ -82,15 +89,20 @@ export default { }, save() { const _this = this - html2canvas(document.getElementById('exportPdf')).then(function(canvas) { - const contentWidth = canvas.width - const contentHeight = canvas.height - const pageData = canvas.toDataURL('image/jpeg', 1.0) - const PDF = new JsPDF('l', 'px', [contentWidth, contentHeight]) - PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) - PDF.save(_this.panelName + '.pdf') - } - ) + _this.exportLoading = true + setTimeout(() => { + html2canvas(document.getElementById('exportPdf')).then(function(canvas) { + _this.exportLoading = false + const contentWidth = canvas.width + const contentHeight = canvas.height + const pageData = canvas.toDataURL('image/jpeg', 1.0) + const PDF = new JsPDF('l', 'px', [contentWidth, contentHeight]) + PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) + PDF.save(_this.panelName + '.pdf') + _this.$emit('closePreExport') + } + ) + }, 50) } } diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 623cdfd0d7..5f0535aa92 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -1,5 +1,11 @@