From 9f5fb5f1c28ef60fdf723bc5e06440ce233bc8c9 Mon Sep 17 00:00:00 2001 From: duxiaoning <17621883433@163.com> Date: Fri, 6 Sep 2024 14:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=AD=A3=E5=B0=84=E7=AE=AD?= =?UTF-8?q?=E5=A4=B4=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Feedback/Inspection/Report/index.vue | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/views/Daichuli/Feedback/Inspection/Report/index.vue b/src/views/Daichuli/Feedback/Inspection/Report/index.vue index a1c6f48..e222856 100644 --- a/src/views/Daichuli/Feedback/Inspection/Report/index.vue +++ b/src/views/Daichuli/Feedback/Inspection/Report/index.vue @@ -193,25 +193,33 @@ 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"], - }); - setTimeout(() => { + new Promise((res, rej) => { + setTimeout(() => { + res(this.$refs.reportQT.myCharts.getDataURL({ + type: "png", + pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 + backgroundColor: "#fff", + excludeComponents: ["toolbox", "dataZoom"], + })) + }, 500) + }).then((res) => { + this.base64Data = res; this.exportPdf(this.reportMsg); - }, 1500); + }) } else { - this.base64Data = this.$refs.reportRT.myCharts.getDataURL({ - type: "png", - pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 - backgroundColor: "#fff", - excludeComponents: ["toolbox", "dataZoom"], - }); - setTimeout(() => { + new Promise((res, rej) => { + setTimeout(() => { + res(this.$refs.reportRT.myCharts.getDataURL({ + type: "png", + pixelRatio: 1.5, //放大两倍下载,之后压缩到同等大小展示。解决生成图片在移动端模糊问题 + backgroundColor: "#fff", + excludeComponents: ["toolbox", "dataZoom"], + })) + }, 500) + }).then((res) => { + this.base64Data = res; this.exportPdf(this.reportMsg); - }, 1500); + }) } }, created() {