@@ -12,13 +12,15 @@ import ContextMenuAsideDetails from '@/components/data-visualization/canvas/Cont
12
12
import ComposeShow from ' @/components/data-visualization/canvas/ComposeShow.vue'
13
13
import { composeStoreWithOut } from ' @/store/modules/data-visualization/compose'
14
14
import RealTimeGroup from ' @/components/data-visualization/RealTimeGroup.vue'
15
+ import { contextmenuStoreWithOut } from ' @/store/modules/data-visualization/contextmenu'
15
16
const dropdownMore = ref (null )
16
17
const lockStore = lockStoreWithOut ()
17
18
18
19
const dvMainStore = dvMainStoreWithOut ()
19
20
const snapshotStore = snapshotStoreWithOut ()
20
21
const layerStore = layerStoreWithOut ()
21
22
const composeStore = composeStoreWithOut ()
23
+ const contextmenuStore = contextmenuStoreWithOut ()
22
24
23
25
const { areaData, isCtrlOrCmdDown, isShiftDown, laterIndex } = storeToRefs (composeStore )
24
26
@@ -78,6 +80,7 @@ const hiddenAreaOnClick = (e, element) => {
78
80
}
79
81
80
82
const onClick = (e , index ) => {
83
+ contextmenuStore .hideContextMenu ()
81
84
// 初始化点击是 laterIndex=0
82
85
if (! curComponent .value ) {
83
86
composeStore .setLaterIndex (null )
@@ -198,12 +201,24 @@ const getIconName = item => {
198
201
}
199
202
}
200
203
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
+
201
216
const menuAsideClose = (param , index ) => {
202
217
const iconDom = document .getElementById (' close-button' )
203
218
if (iconDom ) {
204
219
iconDom .click ()
205
220
}
206
- if (param .opt === ' rename' ) {
221
+ if (param ? .opt === ' rename' ) {
207
222
setTimeout (() => {
208
223
editComponentName (getComponent (index ))
209
224
}, 200 )
@@ -292,15 +307,18 @@ const areaClick = area => {
292
307
effect =" dark"
293
308
:hide-timeout =" 0"
294
309
>
295
- <span :class =" 'dropdownMore-' + index" @click =" onClick(transformIndex(index))" >
310
+ <span
311
+ :class =" 'dropdownMore-' + index"
312
+ @click =" hiddenAreaOnClick($event, element)"
313
+ >
296
314
<el-icon class =" component-base" >
297
315
<Icon name =" dv-more" class =" opt-icon" ></Icon >
298
316
</el-icon >
299
317
</span >
300
318
<template #dropdown >
301
319
<context-menu-aside-details
302
320
:element =" element"
303
- @close =" menuAsideClose ($event, index )"
321
+ @close =" menuAsideHiddenClose ($event, element )"
304
322
></context-menu-aside-details >
305
323
</template >
306
324
</el-dropdown >
@@ -545,7 +563,6 @@ const areaClick = area => {
545
563
justify-content : flex-end ;
546
564
align-items : center ;
547
565
flex-grow : 1 ;
548
- cursor : none ;
549
566
i {
550
567
font-size : 16px ;
551
568
cursor : pointer ;
0 commit comments