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