fix: 修复图表剪切后选择其他组件可直接对剪切图表组合并显示问题

This commit is contained in:
wangjiahao 2024-01-17 11:15:48 +08:00
parent 278cee6d20
commit afe73c918b
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