diff --git a/src/hooks/useLifeHandler.hook.ts b/src/hooks/useLifeHandler.hook.ts index 1972d73..d17184d 100644 --- a/src/hooks/useLifeHandler.hook.ts +++ b/src/hooks/useLifeHandler.hook.ts @@ -36,8 +36,6 @@ export const useLifeHandler = (chartConfig: CreateComponentType | CreateComponen generateFunc(fnStr, e) } } - console.log('baseEvent', baseEvent) - console.log('lifeEvents', lifeEvents) return { ...baseEvent, ...lifeEvents } } diff --git a/src/packages/components/Icons/Default/Icon/index.vue b/src/packages/components/Icons/Default/Icon/index.vue index cbfc81a..4f7bc20 100644 --- a/src/packages/components/Icons/Default/Icon/index.vue +++ b/src/packages/components/Icons/Default/Icon/index.vue @@ -1,31 +1,63 @@ diff --git a/src/packages/components/Informations/Inputs/InputsDate/index.vue b/src/packages/components/Informations/Inputs/InputsDate/index.vue index a8e16bc..091ff72 100644 --- a/src/packages/components/Informations/Inputs/InputsDate/index.vue +++ b/src/packages/components/Informations/Inputs/InputsDate/index.vue @@ -10,94 +10,97 @@ diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index 849299a..9605463 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -1,6 +1,12 @@ -import { BaseEvent, EventLife, InteractEvents, InteractEventOn, InteractActionsType } from '@/enums/eventEnum' -import type { GlobalThemeJsonType } from '@/settings/chartThemes/index' -import type { RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d' +import { + BaseEvent, + EventLife, + InteractEvents, + InteractEventOn, + InteractActionsType, +} from '@/enums/eventEnum'; +import type { GlobalThemeJsonType } from '@/settings/chartThemes/index'; +import type { RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'; export enum ChartFrameEnum { // 支持 dataset 的 echarts 框架 @@ -12,56 +18,56 @@ export enum ChartFrameEnum { // 自定义带数据组件 COMMON = 'common', // 无数据变更 - STATIC = 'static' + STATIC = 'static', } // 组件配置 export type ConfigType = { // 组件 key - key: string + key: string; // 画布组件 key - chartKey: string + chartKey: string; // 右侧设置面板组件 key - conKey: string + conKey: string; // 标题 - title: string + title: string; // 分类 - category: string + category: string; // 分类名称 - categoryName: string + categoryName: string; // 所属包 - package: string + package: string; // 归类 - chartFrame?: ChartFrameEnum + chartFrame?: ChartFrameEnum; // 预览图 - image: string + image: string; // 从指定路径创建创建该组件 - redirectComponent?: string + redirectComponent?: string; // 组件预设的 dataset 值(图片/图标) - dataset?: any + dataset?: any; // 禁用 拖拽或双击生成组件 - disabled?: boolean + disabled?: boolean; // 图标 - icon?: string + icon?: string; // 事件 - configEvents?: { [T: string]: Function } -} + configEvents?: { [T: string]: Function }; +}; // 数据请求 interface requestConfig { - request: RequestConfigType + request: RequestConfigType; } // Echarts 数据类型 interface EchartsDataType { - dimensions: string[] - source: any[] + dimensions: string[]; + source: any[]; } // 组件状态 export interface StatusType { - lock: boolean - hide: boolean + lock: boolean; + hide: boolean; } // 滤镜/变换枚举 @@ -90,7 +96,7 @@ export enum FilterEnum { SKEW_Y = 'skewY', // 混合模式 - BLEND_MODE = 'blendMode' + BLEND_MODE = 'blendMode', } export const BlendModeEnumList = [ @@ -109,68 +115,80 @@ export const BlendModeEnumList = [ { label: '色相', value: 'hue' }, { label: '饱和度', value: 'saturation' }, { label: '颜色', value: 'color' }, - { label: '亮度', value: 'luminosity' } -] + { label: '亮度', value: 'luminosity' }, +]; // 组件实例类 export interface PublicConfigType { - id: string - isGroup: boolean - attr: { x: number; y: number; w: number; h: number; zIndex: number; offsetX: number; offsetY: number } + id: string; + isGroup: boolean; + attr: { + x: number; + y: number; + w: number; + h: number; + zIndex: number; + offsetX: number; + offsetY: number; + }; styles: { - [FilterEnum.FILTERS_SHOW]: boolean - [FilterEnum.OPACITY]: number - [FilterEnum.SATURATE]: number - [FilterEnum.CONTRAST]: number - [FilterEnum.HUE_ROTATE]: number - [FilterEnum.BRIGHTNESS]: number + [FilterEnum.FILTERS_SHOW]: boolean; + [FilterEnum.OPACITY]: number; + [FilterEnum.SATURATE]: number; + [FilterEnum.CONTRAST]: number; + [FilterEnum.HUE_ROTATE]: number; + [FilterEnum.BRIGHTNESS]: number; - [FilterEnum.ROTATE_Z]: number - [FilterEnum.ROTATE_X]: number - [FilterEnum.ROTATE_Y]: number + [FilterEnum.ROTATE_Z]: number; + [FilterEnum.ROTATE_X]: number; + [FilterEnum.ROTATE_Y]: number; - [FilterEnum.SKEW_X]: number - [FilterEnum.SKEW_Y]: number - [FilterEnum.BLEND_MODE]: string + [FilterEnum.SKEW_X]: number; + [FilterEnum.SKEW_Y]: number; + [FilterEnum.BLEND_MODE]: string; // 动画 - animations: string[] - } + animations: string[]; + }; preview?: { // 预览超出隐藏 - overFlowHidden?: boolean - } - filter?: string - status: StatusType - interactActions?: InteractActionsType[] + overFlowHidden?: boolean; + }; + filter?: string; + status: StatusType; + interactActions?: InteractActionsType[]; events: { baseEvent: { - [K in BaseEvent]?: string - } + [K in BaseEvent]?: string; + }; advancedEvents: { - [K in EventLife]?: string - } + [K in EventLife]?: string; + }; interactEvents: { - [InteractEvents.INTERACT_ON]: InteractEventOn | undefined - [InteractEvents.INTERACT_COMPONENT_ID]: string | undefined - [InteractEvents.INTERACT_FN]: { [name: string]: string } - }[] - } + [InteractEvents.INTERACT_ON]: InteractEventOn | undefined; + [InteractEvents.INTERACT_COMPONENT_ID]: string | undefined; + [InteractEvents.INTERACT_FN]: { [name: string]: string }; + }[]; + interactConfigEvents: {}[]; + }; } export interface CreateComponentType extends PublicConfigType, requestConfig { - key: string - chartConfig: ConfigType - option: GlobalThemeJsonType - groupList?: Array + key: string; + chartConfig: ConfigType; + option: GlobalThemeJsonType; + groupList?: Array; } // 组件成组实例类 export interface CreateComponentGroupType extends CreateComponentType { - groupList: Array + groupList: Array; } // 获取组件实例类中某个key对应value类型的方法 -export type PickCreateComponentType = Pick[T] +export type PickCreateComponentType = Pick< + CreateComponentType, + T +>[T]; // 包分类枚举 export enum PackagesCategoryEnum { @@ -182,7 +200,7 @@ export enum PackagesCategoryEnum { ICONS = 'Icons', DECORATES = 'Decorates', CUSTOM = 'Custom', - DIY = 'Diy' + DIY = 'Diy', } // 包分类名称 @@ -195,24 +213,24 @@ export enum PackagesCategoryName { ICONS = '图标', DECORATES = '小组件', CUSTOM = '预警信息', - DIY = 'DIY' + DIY = 'DIY', } // 获取组件 export enum FetchComFlagType { VIEW, - CONFIG + CONFIG, } // 图表包类型 export type PackagesType = { - [PackagesCategoryEnum.CHARTS]: ConfigType[] - [PackagesCategoryEnum.VCHART]: ConfigType[] - [PackagesCategoryEnum.INFORMATIONS]: ConfigType[] - [PackagesCategoryEnum.TABLES]: ConfigType[] - [PackagesCategoryEnum.PHOTOS]: ConfigType[] - [PackagesCategoryEnum.ICONS]: ConfigType[] - [PackagesCategoryEnum.DECORATES]: ConfigType[] - [PackagesCategoryEnum.CUSTOM]: ConfigType[] - [PackagesCategoryEnum.DIY]: ConfigType[] -} + [PackagesCategoryEnum.CHARTS]: ConfigType[]; + [PackagesCategoryEnum.VCHART]: ConfigType[]; + [PackagesCategoryEnum.INFORMATIONS]: ConfigType[]; + [PackagesCategoryEnum.TABLES]: ConfigType[]; + [PackagesCategoryEnum.PHOTOS]: ConfigType[]; + [PackagesCategoryEnum.ICONS]: ConfigType[]; + [PackagesCategoryEnum.DECORATES]: ConfigType[]; + [PackagesCategoryEnum.CUSTOM]: ConfigType[]; + [PackagesCategoryEnum.DIY]: ConfigType[]; +}; diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index 2a21d71..27503f2 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -103,7 +103,8 @@ export class PublicConfigClass implements PublicConfigType { [EventLife.VNODE_MOUNTED]: undefined, [EventLife.VNODE_BEFORE_MOUNT]: undefined }, - interactEvents: [] + interactEvents: [], + interactConfigEvents:[] } } diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteractionConfiguration/index.ts b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteractionConfiguration/index.ts new file mode 100644 index 0000000..9fd7018 --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteractionConfiguration/index.ts @@ -0,0 +1,3 @@ +import ChartEventInteractionConfiguration from './index.vue'; + +export { ChartEventInteractionConfiguration }; diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteractionConfiguration/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteractionConfiguration/index.vue new file mode 100644 index 0000000..e0065ce --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventInteractionConfiguration/index.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue index 78af1c0..ffff705 100644 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue @@ -5,14 +5,16 @@ 组件 id: {{ targetData.id }} - - - + + + +