From ec31351791f263e2ee5770d01d3f6ec685d406e7 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 14 Jun 2024 12:42:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=A4=A7=E5=B1=8F=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/MultiplexPreviewShow.vue | 2 +- .../src/views/data-visualization/PreviewShow.vue | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/data-visualization/MultiplexPreviewShow.vue b/core/core-frontend/src/views/data-visualization/MultiplexPreviewShow.vue index a1c9e0c776..c5d2c42bcd 100644 --- a/core/core-frontend/src/views/data-visualization/MultiplexPreviewShow.vue +++ b/core/core-frontend/src/views/data-visualization/MultiplexPreviewShow.vue @@ -95,7 +95,7 @@ watch( const init = () => { dvMainStore.initCurMultiplexingComponents() curMultiplexTargetComponentsInfo.value = [] - componentData.value.forEach(item => { + componentData.value?.forEach(item => { curMultiplexTargetComponentsInfo.value.push({ id: item.id, label: item.label, diff --git a/core/core-frontend/src/views/data-visualization/PreviewShow.vue b/core/core-frontend/src/views/data-visualization/PreviewShow.vue index c8297eb9af..ffb166e139 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewShow.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewShow.vue @@ -80,11 +80,13 @@ const loadCanvasData = (dvId, weight?) => { state.canvasViewInfoPreview = canvasViewInfoPreview state.dvInfo = dvInfo state.curPreviewGap = curPreviewGap - dvMainStore.updateCurDvInfo(dvInfo) dataInitState.value = true - nextTick(() => { - dvPreview.value?.restore() - }) + if (props.showPosition === 'preview') { + dvMainStore.updateCurDvInfo(dvInfo) + nextTick(() => { + dvPreview.value?.restore() + }) + } } ) } @@ -151,7 +153,9 @@ defineExpose({ }) onBeforeMount(() => { - dvMainStore.canvasDataInit() + if (props.showPosition === 'preview') { + dvMainStore.canvasDataInit() + } })