Merge pull request #7421 from dataease/pr@dev-v2@fix_group-info

Pr@dev v2@fix group info
This commit is contained in:
王嘉豪 2023-12-27 18:49:19 +08:00 committed by GitHub
commit a635695756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -37,7 +37,7 @@ const transformIndex = index => {
return componentData.value.length - 1 - index
}
const areaDataPush = component => {
if (component && !component.isLock && component.isShow) {
if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') {
areaData.value.components.push(component)
}
}

View File

@ -30,7 +30,7 @@ const transformIndex = index => {
return componentData.value.length - 1 - index
}
const areaDataPush = component => {
if (component && !component.isLock && component.isShow) {
if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') {
areaData.value.components.push(component)
}
}

View File

@ -366,7 +366,7 @@ const handleBoardMouseDownOnShape = e => {
}
const areaDataPush = component => {
if (component && !component.isLock && component.isShow) {
if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') {
areaData.value.components.push(component)
}
}

View File

@ -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)
}
}