fix(视图): 修复计算字段弹框热键冲突问题 #5501

This commit is contained in:
wangjiahao 2023-08-01 16:41:19 +08:00
parent 26f34fe409
commit 715b79b3a9

View File

@ -32,8 +32,8 @@ const ignoreComponent = ['de-button', 'de-reset-button']
// 与组件状态无关的操作 // 与组件状态无关的操作
const basemap = { const basemap = {
[vKey]: paste, [vKey]: paste,
[yKey]: redo, [gKey]: redo,
[zKey]: undo [bKey]: undo,
} }
// 组件未锁定状态下可以执行的操作 // 组件未锁定状态下可以执行的操作
@ -41,8 +41,6 @@ const unlockMap = {
...basemap, ...basemap,
[cKey]: copy, [cKey]: copy,
[xKey]: cut, [xKey]: cut,
[gKey]: compose,
[bKey]: decompose,
[dKey]: copyAndPast, [dKey]: copyAndPast,
[deleteKey]: deleteComponent, [deleteKey]: deleteComponent,
[lKey]: lock, [lKey]: lock,
@ -60,7 +58,7 @@ export function listenGlobalKeyDown() {
if (keyCode === ctrlKey || keyCode === commandKey) { if (keyCode === ctrlKey || keyCode === commandKey) {
isCtrlOrCommandDown = true isCtrlOrCommandDown = true
} else if (isCtrlOrCommandDown) { } else if (isCtrlOrCommandDown) {
if (keyCode === zKey || keyCode === yKey || keyCode === dKey || keyCode === sKey || keyCode === enlargeKey) { if (keyCode === bKey || keyCode === gKey || keyCode === dKey || keyCode === sKey || keyCode === enlargeKey) {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
unlockMap[keyCode]() unlockMap[keyCode]()