From 80211d8c842c65d89450eebf5af09203dc1bb68a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 26 Oct 2023 10:41:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E5=B1=82?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E7=82=B9=E5=87=BB=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E5=8C=BA=E5=9F=9FBlur=E6=9C=AA=E8=A7=A6=E5=8F=91=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/RealTimeComponentList.vue | 7 +++++-- .../components/data-visualization/canvas/CanvasCore.vue | 2 +- .../src/components/data-visualization/canvas/Shape.vue | 6 +++--- core/core-frontend/src/views/data-visualization/index.vue | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/RealTimeComponentList.vue b/core/core-frontend/src/components/data-visualization/RealTimeComponentList.vue index fc5d380ca5..e4033579da 100644 --- a/core/core-frontend/src/components/data-visualization/RealTimeComponentList.vue +++ b/core/core-frontend/src/components/data-visualization/RealTimeComponentList.vue @@ -93,7 +93,9 @@ let nameEdit = ref(false) let editComponentId = ref('') let inputName = ref('') let nameInput = ref(null) +let curEditComponent = null const editComponentName = item => { + curEditComponent = curComponent.value editComponentId.value = `#component-label-${item.id}` nameEdit.value = true inputName.value = item.name @@ -106,11 +108,12 @@ const closeEditComponentName = () => { if (!inputName.value || !inputName.value.trim()) { return } - if (inputName.value.trim() === curComponent.value.name) { + if (inputName.value.trim() === curEditComponent.name) { return } - curComponent.value.name = inputName.value + curEditComponent.name = inputName.value inputName.value = '' + curEditComponent = null } const lock = () => { diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 8cc26b05ac..a36fa7de9c 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -252,7 +252,7 @@ const handleMouseDown = e => { } // 如果没有选中组件 在画布上点击时需要调用 e.preventDefault() 防止触发 drop 事件 if (!curComponent.value || isPreventDrop(curComponent.value.component)) { - e.preventDefault() + // e.preventDefault() } hideArea() const rectInfo = editorMap.value[canvasId.value].getBoundingClientRect() diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue index 1de352f086..bf14b0aa42 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -385,9 +385,9 @@ const handleMouseDownOnShape = e => { nextTick(() => eventBus.emit('componentClick')) dvMainStore.setInEditorStatus(true) dvMainStore.setClickComponentStatus(true) - if (isPreventDrop(element.value.component)) { - e.preventDefault() - } + // if (isPreventDrop(element.value.component)) { + // e.preventDefault() + // } e.stopPropagation() if (element.value['isLock'] || !isEditMode.value) return diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue index 92c1a4eb0c..d908c04e90 100644 --- a/core/core-frontend/src/views/data-visualization/index.vue +++ b/core/core-frontend/src/views/data-visualization/index.vue @@ -113,7 +113,7 @@ const handleDragOver = e => { } const handleMouseDown = e => { - e.stopPropagation() + // e.stopPropagation() dvMainStore.setClickComponentStatus(false) // 点击画布的空区域 提前清空curComponent 防止右击菜单内容抖动 dvMainStore.setCurComponent({ component: null, index: null })