From 2662ee2475199c06fcd1958ca2fb6259e3a8b3b4 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: Thu, 30 Oct 2025 15:17:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F=E5=A4=8D=E5=88=B6=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E6=97=B6=EF=BC=8C=E8=81=9A=E7=84=A6=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=9A=E4=B8=80=E4=B8=AA=E9=97=AE=E9=A2=98=20(#17315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/copy.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/store/modules/data-visualization/copy.ts b/core/core-frontend/src/store/modules/data-visualization/copy.ts index 36d3bb0749..e529f77249 100644 --- a/core/core-frontend/src/store/modules/data-visualization/copy.ts +++ b/core/core-frontend/src/store/modules/data-visualization/copy.ts @@ -128,7 +128,10 @@ export const copyStore = defineStore('copy', { if (dvInfo.value.type === 'dashboard') { eventBus.emit('addDashboardItem-' + newComponent.canvasId, newComponent) } - if (i === dataArray.length - 1) { + if ( + i === dataArray.length - 1 && + (dataArray.length === 1 || (dataArray.length > 1 && dvInfo.value.type === 'dashboard')) + ) { dvMainStore.setCurComponent({ component: newComponent, index: componentData.value.length - 1