From c783552fa1920d969da6b545408e29f47090c32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=8D=A3=E5=AE=8F?= <2241220001@qq.com> Date: Mon, 2 Sep 2024 18:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E6=8A=A5=E5=91=8A=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Feedback/Inspection/Report/index.vue | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/views/Daichuli/Feedback/Inspection/Report/index.vue b/src/views/Daichuli/Feedback/Inspection/Report/index.vue index 28d5b3c..4bd05d6 100644 --- a/src/views/Daichuli/Feedback/Inspection/Report/index.vue +++ b/src/views/Daichuli/Feedback/Inspection/Report/index.vue @@ -193,21 +193,26 @@ export default { this.pdSubType === productSubTypeVal.ACS_TYPESOFLANDCOVER || this.pdSubType === productSubTypeVal.ACS_VEGETATIONPHENOLOGY ) { - this.base64Data = this.$refs.reportQT.myCharts.getDataURL({ - type: "png", - pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 - backgroundColor: "#fff", - excludeComponents: ["toolbox", "dataZoom"], - }); + this.$refs.reportQT.myCharts.on("finished",()=>{ + this.base64Data = this.$refs.reportQT.myCharts.getDataURL({ + type: "png", + pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 + backgroundColor: "#fff", + excludeComponents: ["toolbox", "dataZoom"], + }); + this.exportPdf(this.reportMsg); + }) } else { - this.base64Data = this.$refs.reportRT.myCharts.getDataURL({ - type: "png", - pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 - backgroundColor: "#fff", - excludeComponents: ["toolbox", "dataZoom"], - }); + this.$refs.reportRT.myCharts.on("finished",()=>{ + this.base64Data = this.$refs.reportRT.myCharts.getDataURL({ + type: "png", + pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 + backgroundColor: "#fff", + excludeComponents: ["toolbox", "dataZoom"], + }); + this.exportPdf(this.reportMsg); + }) } - this.exportPdf(this.reportMsg); }, created() { if (