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