Skip to content

Commit f2069aa

Browse files
authored
Merge pull request dataease#10967 from dataease/[email protected]@fix_hidden-area
fix(数据大屏): 数据大屏隐藏区域相关问题优化
2 parents b7f1975 + f2c19fa commit f2069aa

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

core/core-frontend/src/components/data-visualization/RealTimeListTree.vue

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ import ContextMenuAsideDetails from '@/components/data-visualization/canvas/Cont
1212
import ComposeShow from '@/components/data-visualization/canvas/ComposeShow.vue'
1313
import { composeStoreWithOut } from '@/store/modules/data-visualization/compose'
1414
import RealTimeGroup from '@/components/data-visualization/RealTimeGroup.vue'
15+
import { contextmenuStoreWithOut } from '@/store/modules/data-visualization/contextmenu'
1516
const dropdownMore = ref(null)
1617
const lockStore = lockStoreWithOut()
1718
1819
const dvMainStore = dvMainStoreWithOut()
1920
const snapshotStore = snapshotStoreWithOut()
2021
const layerStore = layerStoreWithOut()
2122
const composeStore = composeStoreWithOut()
23+
const contextmenuStore = contextmenuStoreWithOut()
2224
2325
const { areaData, isCtrlOrCmdDown, isShiftDown, laterIndex } = storeToRefs(composeStore)
2426
@@ -78,6 +80,7 @@ const hiddenAreaOnClick = (e, element) => {
7880
}
7981
8082
const onClick = (e, index) => {
83+
contextmenuStore.hideContextMenu()
8184
// 初始化点击是 laterIndex=0
8285
if (!curComponent.value) {
8386
composeStore.setLaterIndex(null)
@@ -198,12 +201,24 @@ const getIconName = item => {
198201
}
199202
}
200203
204+
const menuAsideHiddenClose = (param, element) => {
205+
const iconDom = document.getElementById('close-button')
206+
if (iconDom) {
207+
iconDom.click()
208+
}
209+
if (param?.opt === 'rename') {
210+
setTimeout(() => {
211+
editComponentName(element)
212+
}, 200)
213+
}
214+
}
215+
201216
const menuAsideClose = (param, index) => {
202217
const iconDom = document.getElementById('close-button')
203218
if (iconDom) {
204219
iconDom.click()
205220
}
206-
if (param.opt === 'rename') {
221+
if (param?.opt === 'rename') {
207222
setTimeout(() => {
208223
editComponentName(getComponent(index))
209224
}, 200)
@@ -292,15 +307,18 @@ const areaClick = area => {
292307
effect="dark"
293308
:hide-timeout="0"
294309
>
295-
<span :class="'dropdownMore-' + index" @click="onClick(transformIndex(index))">
310+
<span
311+
:class="'dropdownMore-' + index"
312+
@click="hiddenAreaOnClick($event, element)"
313+
>
296314
<el-icon class="component-base">
297315
<Icon name="dv-more" class="opt-icon"></Icon>
298316
</el-icon>
299317
</span>
300318
<template #dropdown>
301319
<context-menu-aside-details
302320
:element="element"
303-
@close="menuAsideClose($event, index)"
321+
@close="menuAsideHiddenClose($event, element)"
304322
></context-menu-aside-details>
305323
</template>
306324
</el-dropdown>
@@ -545,7 +563,6 @@ const areaClick = area => {
545563
justify-content: flex-end;
546564
align-items: center;
547565
flex-grow: 1;
548-
cursor: none;
549566
i {
550567
font-size: 16px;
551568
cursor: pointer;

core/core-frontend/src/store/modules/data-visualization/copy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const copyStore = defineStore('copy', {
108108
// 旧-新ID映射关系
109109
const idMap = {}
110110
const newComponent = deepCopyHelper(data, idMap)
111+
newComponent['category'] = 'base'
111112
if (newComponent.canvasId.includes('Group')) {
112113
newComponent.canvasId = 'canvas-main'
113114
}

0 commit comments

Comments
 (0)