fix: 修复使用快捷键反复切换桌面应用导致的数据大屏组件移动失效问题

This commit is contained in:
wangjiahao 2023-12-04 15:08:16 +08:00
parent 5b762ec871
commit df2627bd9f
3 changed files with 16 additions and 2 deletions

View File

@ -1,6 +1,11 @@
<template>
<div class="pic-main">
<img v-if="propValue['url']" :style="imageAdapter" :src="imgUrlTrans(propValue['url'])" />
<img
draggable="false"
v-if="propValue['url']"
:style="imageAdapter"
:src="imgUrlTrans(propValue['url'])"
/>
<div v-else class="pic-upload">
<span
><el-button @click="uploadImg" text style="color: #646a73" icon="Plus"

View File

@ -142,6 +142,13 @@ export function listenGlobalKeyDown() {
}
}
export function releaseAttachKey() {
isCtrlOrCommandDown = false
composeStore.setIsCtrlOrCmdDownStatus(false)
isShiftDown = false
composeStore.setIsShiftDownStatus(false)
}
//当前不支持同时ctrl + shift操作
function releaseKeyCheck() {
if (isCtrlOrCommandDown && isShiftDown) {

View File

@ -19,7 +19,7 @@ import { getDatasetTree } from '@/api/dataset'
import { Tree } from '@/views/visualized/data/dataset/form/CreatDsGroup.vue'
import { findDragComponent, findNewComponent, initCanvasData } from '@/utils/canvasUtils'
import CanvasCore from '@/components/data-visualization/canvas/CanvasCore.vue'
import { listenGlobalKeyDown } from '@/utils/DeShortcutKey'
import { listenGlobalKeyDown, releaseAttachKey } from '@/utils/DeShortcutKey'
import { adaptCurThemeCommonStyle } from '@/utils/canvasStyle'
import { changeComponentSizeWithScale } from '@/utils/changeComponentsSizeWithScale'
import { useEmitt } from '@/hooks/web/useEmitt'
@ -175,6 +175,7 @@ watch(
)
onMounted(() => {
window.addEventListener('blur', releaseAttachKey)
if (editMode.value === 'edit') {
window.addEventListener('storage', eventCheck)
}
@ -224,6 +225,7 @@ onMounted(() => {
onUnmounted(() => {
window.removeEventListener('storage', eventCheck)
window.removeEventListener('blur', releaseAttachKey)
})
const previewStatus = computed(() => editMode.value === 'preview')