From 2ab7db33450d062a0b036b3baa1aee0e890af459 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 9 Apr 2025 17:14:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=97=B6=E6=96=B0=E9=A1=B5=E9=9D=A2=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=B1=95=E7=A4=BA=E6=9C=80=E6=96=B0=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/components/dashboard/DbToolbar.vue | 2 +- .../src/views/data-visualization/PreviewCanvas.vue | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index d7ffcb4e86..94b702e77d 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -151,7 +151,7 @@ const previewOuter = () => { return } canvasSave(() => { - let url = '#/preview?dvId=' + dvInfo.value.id + '&ignoreParams=true' + let url = '#/preview?dvId=' + dvInfo.value.id + '&ignoreParams=true&editPreview=true' if (embeddedStore.baseUrl) { url = `${embeddedStore.baseUrl}${url}`.replaceAll('\/\/#', '\/#') } diff --git a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue index ab0e39052a..b14218659b 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue @@ -33,6 +33,7 @@ const state = reactive({ dvInfo: null, curPreviewGap: 0, initState: true, + editPreview: false, showPosition: null, showOffset: { top: 3, @@ -117,7 +118,7 @@ const loadCanvasDataAsync = async (dvId, dvType, ignoreParams = false) => { await initCanvasData( dvId, - { busiFlag: dvType, resourceTable: 'core' }, + { busiFlag: dvType, resourceTable: state.editPreview ? 'snapshot' : 'core' }, async function ({ canvasDataResult, canvasStyleResult, @@ -129,6 +130,9 @@ const loadCanvasDataAsync = async (dvId, dvType, ignoreParams = false) => { state.canvasStylePreview = canvasStyleResult state.canvasViewInfoPreview = canvasViewInfoPreview state.dvInfo = dvInfo + if (state.editPreview) { + state.dvInfo.status = 1 + } state.curPreviewGap = curPreviewGap if (state.dvInfo.status) { if (jumpParam || (!ignoreParams && attachParam)) { @@ -196,6 +200,7 @@ onMounted(async () => { const ignoreParams = router.currentRoute.value.query.ignoreParams === 'true' const isPopWindow = router.currentRoute.value.query.popWindow === 'true' const isFrameFlag = window.self !== window.top + state.editPreview = router.currentRoute.value.query.editPreview === 'true' dvMainStore.setIframeFlag(isFrameFlag) dvMainStore.setIsPopWindow(isPopWindow) const { dvType, callBackFlag, taskId, showWatermark } = router.currentRoute.value.query