fix(数据大屏): 修复批量复制粘贴时,聚焦组件多一个问题 (#17315)

This commit is contained in:
王嘉豪
2025-10-30 15:17:00 +08:00
committed by GitHub
parent 2270b800c9
commit 2662ee2475

View File

@@ -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