perf: 优化事件代码结构

This commit is contained in:
奔跑的面条
2022-11-12 21:49:04 +08:00
parent 38fb7b381a
commit ae75d9b5e6
9 changed files with 118 additions and 38 deletions
+20 -2
View File
@@ -1,5 +1,4 @@
import { getUUID } from '@/utils'
import { ChartFrameEnum, PublicConfigType, CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
import { RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
import { groupTitle } from '@/settings/designSetting'
import {
@@ -9,6 +8,14 @@ import {
RequestContentTypeEnum,
RequestBodyEnum
} from '@/enums/httpEnum'
import {
BaseEvent,
EventLife,
ChartFrameEnum,
PublicConfigType,
CreateComponentType,
CreateComponentGroupType
} from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
@@ -82,7 +89,18 @@ export class PublicConfigClass implements PublicConfigType {
// 数据过滤
public filter = undefined
// 事件
public events = undefined
public events = {
baseEvent: {
[BaseEvent.ON_CLICK]: undefined,
[BaseEvent.ON_DBL_CLICK]: undefined,
[BaseEvent.ON_MOUSE_ENTER]: undefined,
[BaseEvent.ON_MOUSE_LEAVE]: undefined
},
advancedEvents: {
[EventLife.VNODE_MOUNTED]: undefined,
[EventLife.VNODE_BEFORE_MOUNT]: undefined
}
}
}
// 多选成组类