fix: 修改注释

This commit is contained in:
MTrun 2022-01-30 00:43:37 +08:00
parent 379a6d259f
commit 1749680268
2 changed files with 18 additions and 9 deletions

View File

@ -1,4 +1,4 @@
// 编辑区域大小 // 编辑画布属性
export enum EditCanvasTypeEnum { export enum EditCanvasTypeEnum {
EDIT_LAYOUT_DOM = 'editLayoutDom', EDIT_LAYOUT_DOM = 'editLayoutDom',
EDIT_CONTENT_DOM = 'editContentDom', EDIT_CONTENT_DOM = 'editContentDom',
@ -8,8 +8,9 @@ export enum EditCanvasTypeEnum {
SCALE = 'scale', SCALE = 'scale',
USER_SCALE = 'userScale', USER_SCALE = 'userScale',
LOCK_SCALE = 'lockScale', LOCK_SCALE = 'lockScale',
BACKGROUND = 'background', BACKGROUND = 'background'
} }
export type EditCanvasType = { export type EditCanvasType = {
// 编辑区域 DOM // 编辑区域 DOM
[EditCanvasTypeEnum.EDIT_LAYOUT_DOM]: HTMLElement | null [EditCanvasTypeEnum.EDIT_LAYOUT_DOM]: HTMLElement | null
@ -35,6 +36,8 @@ export enum EditCanvasTypeEnum {
X = 'x', X = 'x',
Y = 'y' Y = 'y'
} }
// 鼠标位置
export type MousePositionType = { export type MousePositionType = {
// X 轴 // X 轴
[EditCanvasTypeEnum.X]: number [EditCanvasTypeEnum.X]: number
@ -48,17 +51,19 @@ export type TargetChartType = {
selectIndex?: string selectIndex?: string
} }
// Store 类型 // Store 枚举
export enum ChartEditStoreEnum { export enum ChartEditStoreEnum {
EDITCANVAS = 'editCanvas', EDIT_RANGE = 'editRange',
MOUSEPOSITION = 'mousePosition', EDIT_CANVAS = 'editCanvas',
COMPONENT_LIST = 'componentList', MOUSE_POSITION = 'mousePosition',
TARGET_CHART = 'targetChart' TARGET_CHART = 'targetChart',
COMPONENT_LIST = 'componentList'
} }
// Store 类型
export interface chartEditStoreType { export interface chartEditStoreType {
[ChartEditStoreEnum.EDITCANVAS]: EditCanvasType [ChartEditStoreEnum.EDIT_CANVAS]: EditCanvasType
[ChartEditStoreEnum.MOUSEPOSITION]: MousePositionType [ChartEditStoreEnum.MOUSE_POSITION]: MousePositionType
[ChartEditStoreEnum.TARGET_CHART]: TargetChartType [ChartEditStoreEnum.TARGET_CHART]: TargetChartType
[ChartEditStoreEnum.COMPONENT_LIST]: any[] [ChartEditStoreEnum.COMPONENT_LIST]: any[]
} }

View File

@ -12,6 +12,7 @@ import {
export const useChartEditStoreStore = defineStore({ export const useChartEditStoreStore = defineStore({
id: 'useChartEditStoreStore', id: 'useChartEditStoreStore',
state: (): chartEditStoreType => ({ state: (): chartEditStoreType => ({
// 编辑画布属性
editCanvas: { editCanvas: {
// 编辑区域 Dom // 编辑区域 Dom
editLayoutDom: null, editLayoutDom: null,
@ -31,14 +32,17 @@ export const useChartEditStoreStore = defineStore({
// 默认背景色 // 默认背景色
background: undefined background: undefined
}, },
// 鼠标定位
mousePosition: { mousePosition: {
x: 0, x: 0,
y: 0 y: 0
}, },
// 目标图表
targetChart: { targetChart: {
hoverIndex: undefined, hoverIndex: undefined,
selectIndex: undefined selectIndex: undefined
}, },
// 图表数组
componentList: [] componentList: []
}), }),
getters: { getters: {