fix: 修复画布中进行拖拽图表但未移动时仍会将该操作保存至历史记录问题

This commit is contained in:
Async 2024-03-03 12:01:43 +08:00
parent f4de3189ec
commit a8ea82e125

View File

@ -302,7 +302,11 @@ export const useMouseHandle = () => {
}
})
})
chartEditStore.moveComponentList(prevComponentInstance)
const moveComponentInstance = prevComponentInstance.filter(
item => item.attr.offsetX !== 0 && item.attr.offsetY !== 0
)
moveComponentInstance.length && chartEditStore.moveComponentList(moveComponentInstance)
}
document.removeEventListener('mousemove', mousemove)
document.removeEventListener('mouseup', mouseup)