From 1e46d557a4e001d1fcaa2db65e3f2d4408fceb16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Fri, 31 Oct 2025 10:07:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=9B=BE=E7=89=87=E5=85=BC=E5=AE=B9safari?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=20(#17320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/visualization/UserViewEnlarge.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue index 55f0705085..d653867471 100644 --- a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue +++ b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue @@ -184,6 +184,8 @@ import { exportPermission } from '@/utils/utils' import EmptyBackground from '../empty-background/src/EmptyBackground.vue' import { supportExtremumChartType } from '@/views/chart/components/js/extremumUitl' import ChartCarouselTooltip from '@/views/chart/components/js/g2plot_tooltip_carousel' +import html2canvas from 'html2canvas' +import JsPDF from 'jspdf' const downLoading = ref(false) const dvMainStore = dvMainStoreWithOut() const dialogShow = ref(false) @@ -436,8 +438,12 @@ const htmlToImage = () => { : 500 setTimeout(() => { initWatermark() - toPng(viewContainer.value) - .then(dataUrl => { + html2canvas(viewContainer.value) + .then(canvas => { + const dom = document.body.appendChild(canvas) + dom.style.display = 'none' + document.body.removeChild(dom) + const dataUrl = dom.toDataURL('image/png', 1) downLoading.value = false const a = document.createElement('a') a.setAttribute('download', viewInfo.value.title)