From e9126bc34f33b7d559286d3df1dd40a61faf57d2 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 15 Jul 2024 22:22:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E9=9A=90=E8=97=8F=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/RealTimeListTree.vue | 25 ++++++++++++++++--- .../store/modules/data-visualization/copy.ts | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue index 636197873e..525c6334eb 100644 --- a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue +++ b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue @@ -12,6 +12,7 @@ import ContextMenuAsideDetails from '@/components/data-visualization/canvas/Cont import ComposeShow from '@/components/data-visualization/canvas/ComposeShow.vue' import { composeStoreWithOut } from '@/store/modules/data-visualization/compose' import RealTimeGroup from '@/components/data-visualization/RealTimeGroup.vue' +import { contextmenuStoreWithOut } from '@/store/modules/data-visualization/contextmenu' const dropdownMore = ref(null) const lockStore = lockStoreWithOut() @@ -19,6 +20,7 @@ const dvMainStore = dvMainStoreWithOut() const snapshotStore = snapshotStoreWithOut() const layerStore = layerStoreWithOut() const composeStore = composeStoreWithOut() +const contextmenuStore = contextmenuStoreWithOut() const { areaData, isCtrlOrCmdDown, isShiftDown, laterIndex } = storeToRefs(composeStore) @@ -78,6 +80,7 @@ const hiddenAreaOnClick = (e, element) => { } const onClick = (e, index) => { + contextmenuStore.hideContextMenu() // 初始化点击是 laterIndex=0 if (!curComponent.value) { composeStore.setLaterIndex(null) @@ -198,12 +201,24 @@ const getIconName = item => { } } +const menuAsideHiddenClose = (param, element) => { + const iconDom = document.getElementById('close-button') + if (iconDom) { + iconDom.click() + } + if (param?.opt === 'rename') { + setTimeout(() => { + editComponentName(element) + }, 200) + } +} + const menuAsideClose = (param, index) => { const iconDom = document.getElementById('close-button') if (iconDom) { iconDom.click() } - if (param.opt === 'rename') { + if (param?.opt === 'rename') { setTimeout(() => { editComponentName(getComponent(index)) }, 200) @@ -292,7 +307,10 @@ const areaClick = area => { effect="dark" :hide-timeout="0" > - + @@ -300,7 +318,7 @@ const areaClick = area => { @@ -545,7 +563,6 @@ const areaClick = area => { justify-content: flex-end; align-items: center; flex-grow: 1; - cursor: none; i { font-size: 16px; cursor: pointer; diff --git a/core/core-frontend/src/store/modules/data-visualization/copy.ts b/core/core-frontend/src/store/modules/data-visualization/copy.ts index c8c3ed4aaa..7c495711db 100644 --- a/core/core-frontend/src/store/modules/data-visualization/copy.ts +++ b/core/core-frontend/src/store/modules/data-visualization/copy.ts @@ -108,6 +108,7 @@ export const copyStore = defineStore('copy', { // 旧-新ID映射关系 const idMap = {} const newComponent = deepCopyHelper(data, idMap) + newComponent['category'] = 'base' if (newComponent.canvasId.includes('Group')) { newComponent.canvasId = 'canvas-main' }