forked from github/dataease
Merge pull request #9785 from dataease/pr@dev-v2@fix_group-move-key
fix(数据大屏): 修复多选图层方向键失效问题 #9766
This commit is contained in:
commit
2ebd61cc65
@ -174,17 +174,30 @@ function move(keyCode) {
|
||||
if (curComponent.value) {
|
||||
if (keyCode === leftKey) {
|
||||
curComponent.value.style.left = --curComponent.value.style.left
|
||||
groupAreaAdaptor(-1, 0)
|
||||
} else if (keyCode === rightKey) {
|
||||
curComponent.value.style.left = ++curComponent.value.style.left
|
||||
groupAreaAdaptor(1, 0)
|
||||
} else if (keyCode === upKey) {
|
||||
curComponent.value.style.top = --curComponent.value.style.top
|
||||
groupAreaAdaptor(0, -1)
|
||||
} else if (keyCode === downKey) {
|
||||
curComponent.value.style.top = ++curComponent.value.style.top
|
||||
groupAreaAdaptor(0, 1)
|
||||
}
|
||||
snapshotStore.recordSnapshotCache('key-move')
|
||||
}
|
||||
}
|
||||
|
||||
function groupAreaAdaptor(leftOffset = 0, topOffset = 0) {
|
||||
if (curComponent.value.component === 'GroupArea') {
|
||||
composeStore.areaData.components.forEach(component => {
|
||||
component.style.top = component.style.top + topOffset
|
||||
component.style.left = component.style.left + leftOffset
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function cut() {
|
||||
copyStore.cut()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user