Merge pull request #10031 from dataease/pr@dev-v2@fix_preview-delete

fix(数据大屏): 修复编辑时全屏预览可以删除组件问题
This commit is contained in:
王嘉豪 2024-06-03 12:25:26 +08:00 committed by GitHub
commit 18b63b9156
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ const composeStore = composeStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const copyStore = copyStoreWithOut()
const lockStore = lockStoreWithOut()
const { curComponent, isInEditor } = storeToRefs(dvMainStore)
const { curComponent, isInEditor, editMode } = storeToRefs(dvMainStore)
const { areaData } = storeToRefs(composeStore)
const ctrlKey = 17,
@ -101,7 +101,7 @@ let isShiftDown = false
// 全局监听按键操作并执行相应命令
export function listenGlobalKeyDown() {
window.onkeydown = e => {
if (!isInEditor || checkDialog()) return
if (!isInEditor.value || editMode.value === 'preview' || checkDialog()) return
const { keyCode } = e
if (positionMoveKey[keyCode] && curComponent.value) {
positionMoveKey[keyCode](keyCode)