forked from github/dataease
fix: MAC平台,在大屏编辑界面按shift键后,无法使用command键选择图层进行组合
This commit is contained in:
parent
aacdcd26bf
commit
c61b7fcf6e
@ -65,6 +65,12 @@ const onClick = (e, index) => {
|
||||
composeStore.setLaterIndex(null)
|
||||
}
|
||||
// ctrl or command 按下时 鼠标点击为选择需要组合的组件(取消需要组合的组件在ComposeShow组件中)
|
||||
console.log(
|
||||
'isCtrlOrCmdDown=' +
|
||||
isCtrlOrCmdDown.value +
|
||||
';all=' +
|
||||
!!(isCtrlOrCmdDown.value && !areaData.value.components.includes(componentData.value[index]))
|
||||
)
|
||||
if (isCtrlOrCmdDown.value && !areaData.value.components.includes(componentData.value[index])) {
|
||||
areaDataPush(componentData.value[index])
|
||||
if (curComponent.value && curComponent.value.id !== componentData.value[index].id) {
|
||||
|
@ -109,11 +109,11 @@ export function listenGlobalKeyDown() {
|
||||
} else if (keyCode === shiftKey) {
|
||||
isShiftDown = true
|
||||
composeStore.setIsShiftDownStatus(true)
|
||||
releaseKeyCheck()
|
||||
releaseKeyCheck('shift')
|
||||
} else if (keyCode === ctrlKey || keyCode === commandKey) {
|
||||
isCtrlOrCommandDown = true
|
||||
composeStore.setIsCtrlOrCmdDownStatus(true)
|
||||
releaseKeyCheck()
|
||||
releaseKeyCheck('ctrl')
|
||||
} else if ((keyCode == deleteKey || keyCode == macDeleteKey) && curComponent.value) {
|
||||
deleteComponent()
|
||||
} else if (isCtrlOrCommandDown) {
|
||||
@ -125,6 +125,7 @@ export function listenGlobalKeyDown() {
|
||||
lockMap[keyCode]()
|
||||
}
|
||||
}
|
||||
console.log('1111=isCtrlOrCommandDown' + isCtrlOrCommandDown + ';isShiftDown=' + isShiftDown)
|
||||
}
|
||||
|
||||
window.onkeyup = e => {
|
||||
@ -150,11 +151,12 @@ export function releaseAttachKey() {
|
||||
}
|
||||
|
||||
//当前不支持同时ctrl + shift操作
|
||||
function releaseKeyCheck() {
|
||||
if (isCtrlOrCommandDown && isShiftDown) {
|
||||
function releaseKeyCheck(keyType) {
|
||||
if (keyType === 'shift' && isCtrlOrCommandDown) {
|
||||
isCtrlOrCommandDown = false
|
||||
composeStore.setIsCtrlOrCmdDownStatus(false)
|
||||
isShiftDown = true
|
||||
} else if (keyType === 'ctrl' && isShiftDown) {
|
||||
isShiftDown = false
|
||||
composeStore.setIsShiftDownStatus(false)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user