From b2afdad156c4dcf579872dd822972bf0b3614dc9 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Mon, 15 Dec 2025 18:35:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=90=AB=E6=9C=89=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=BB=A5=E5=8F=8A=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E5=87=BA=E5=BA=94=E7=94=A8=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E5=92=8C=E6=A0=B7=E5=BC=8F=E6=A8=A1=E7=89=88=EF=BC=8Csnapshop?= =?UTF-8?q?=E5=BF=AB=E7=85=A7=E4=B8=AD=E5=9C=B0=E5=9B=BE=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20#17051?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/dashboard/DashboardPreviewShow.vue | 6 ++++++ .../src/views/data-visualization/PreviewShow.vue | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue b/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue index 5b76b0f7d2..1236da67c5 100644 --- a/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue +++ b/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue @@ -189,6 +189,11 @@ const checkTemplate = () => { const fileDownload = (downloadType, attachParams) => { downloadStatus.value = true + const mapElementIds = + state.canvasDataPreview + ?.filter(ele => mapChartTypes.includes(ele.innerType)) + .map(ele => ele.id) || [] + mapElementIds.forEach(id => useEmitt().emitter.emit('l7-prepare-picture', id)) nextTick(() => { const vueDom = previewCanvasContainer.value.querySelector('.canvas-container') download2AppTemplate(downloadType, vueDom, state.dvInfo.name, attachParams, () => { @@ -198,6 +203,7 @@ const fileDownload = (downloadType, attachParams) => { type: state.dvInfo.type === 'dashboard' ? 'panel' : 'screen' } downloadType === 'app' ? exportLogApp(param) : exportLogTemplate(param) + mapElementIds.forEach(id => useEmitt().emitter.emit('l7-unprepare-picture', id)) }) }) } diff --git a/core/core-frontend/src/views/data-visualization/PreviewShow.vue b/core/core-frontend/src/views/data-visualization/PreviewShow.vue index c8176c57c4..9ef30dbf76 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewShow.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewShow.vue @@ -119,9 +119,15 @@ const loadCanvasData = (dvId, weight?, ext?) => { } ) } - +// 地图类图表,需要预先准备图片 +const mapChartTypes = ['bubble-map', 'flow-map', 'heat-map', 'map', 'symbolic-map'] const download = type => { downloadStatus.value = true + const mapElementIds = + state.canvasDataPreview + ?.filter(ele => mapChartTypes.includes(ele.innerType)) + .map(ele => ele.id) || [] + mapElementIds.forEach(id => useEmitt().emitter.emit('l7-prepare-picture', id)) setTimeout(() => { const vueDom = previewCanvasContainer.value.querySelector('.canvas-container') downloadCanvas2(type, vueDom, state.dvInfo.name, () => { @@ -131,12 +137,17 @@ const download = type => { type: state.dvInfo.type === 'dashboard' ? 'panel' : 'screen' } type === 'img' ? exportLogImg(param) : exportLogPDF(param) + mapElementIds.forEach(id => useEmitt().emitter.emit('l7-unprepare-picture', id)) }) }, 200) } - const fileDownload = (downloadType, attachParams) => { downloadStatus.value = true + const mapElementIds = + state.canvasDataPreview + ?.filter(ele => mapChartTypes.includes(ele.innerType)) + .map(ele => ele.id) || [] + mapElementIds.forEach(id => useEmitt().emitter.emit('l7-prepare-picture', id)) nextTick(() => { const vueDom = previewCanvasContainer.value.querySelector('.canvas-container') download2AppTemplate(downloadType, vueDom, state.dvInfo.name, attachParams, () => { @@ -146,6 +157,7 @@ const fileDownload = (downloadType, attachParams) => { type: state.dvInfo.type === 'dashboard' ? 'panel' : 'screen' } downloadType === 'app' ? exportLogApp(param) : exportLogTemplate(param) + mapElementIds.forEach(id => useEmitt().emitter.emit('l7-unprepare-picture', id)) }) }) }