Merge pull request #7666 from dataease/pr@dev-v2@fix_cut

fix: 修复图表剪切后选择其他组件可直接对剪切图表组合并显示问题
This commit is contained in:
王嘉豪 2024-01-17 11:18:09 +08:00 committed by GitHub
commit 7fc1e50c3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View File

@ -53,8 +53,12 @@ const menuOpt = optName => {
}
const cut = () => {
const curInfo = getCurInfo()
copyStore.cut(curInfo.componentData)
if (curComponent.value) {
const curInfo = getCurInfo()
copyStore.cut(curInfo.componentData)
} else if (areaData.value.components.length) {
copyStore.cut()
}
menuOpt('cut')
}

View File

@ -129,6 +129,15 @@ export const copyStore = defineStore('copy', {
composeStore.areaData.components.forEach(component => {
dvMainStore.deleteComponentById(component.id)
})
composeStore.setAreaData({
style: {
left: 0,
top: 0,
width: 0,
height: 0
},
components: []
})
}
snapshotStore.recordSnapshotCache()
this.isCut = true