mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 修改右键判定区域,新增历史记录store
This commit is contained in:
@@ -55,6 +55,7 @@ export type TargetChartType = {
|
||||
export enum ChartEditStoreEnum {
|
||||
EDIT_RANGE = 'editRange',
|
||||
EDIT_CANVAS = 'editCanvas',
|
||||
RIGHT_MENU_SHOW = 'rightMenuShow',
|
||||
MOUSE_POSITION = 'mousePosition',
|
||||
TARGET_CHART = 'targetChart',
|
||||
COMPONENT_LIST = 'componentList'
|
||||
@@ -63,6 +64,7 @@ export enum ChartEditStoreEnum {
|
||||
// Store 类型
|
||||
export interface chartEditStoreType {
|
||||
[ChartEditStoreEnum.EDIT_CANVAS]: EditCanvasType
|
||||
[ChartEditStoreEnum.RIGHT_MENU_SHOW]: boolean
|
||||
[ChartEditStoreEnum.MOUSE_POSITION]: MousePositionType
|
||||
[ChartEditStoreEnum.TARGET_CHART]: TargetChartType
|
||||
[ChartEditStoreEnum.COMPONENT_LIST]: any[]
|
||||
|
||||
@@ -32,6 +32,8 @@ export const useChartEditStoreStore = defineStore({
|
||||
// 默认背景色
|
||||
background: undefined
|
||||
},
|
||||
// 右键菜单
|
||||
rightMenuShow: false,
|
||||
// 鼠标定位
|
||||
mousePosition: {
|
||||
x: 0,
|
||||
@@ -49,6 +51,9 @@ export const useChartEditStoreStore = defineStore({
|
||||
getMousePosition(): MousePositionType {
|
||||
return this.mousePosition
|
||||
},
|
||||
getRightMenuShow(): boolean {
|
||||
return this.rightMenuShow
|
||||
},
|
||||
getEditCanvas(): EditCanvasType {
|
||||
return this.editCanvas
|
||||
},
|
||||
@@ -64,6 +69,10 @@ export const useChartEditStoreStore = defineStore({
|
||||
setEditCanvasItem< T extends keyof EditCanvasType, K extends EditCanvasType[T] >(key: T, value: K) {
|
||||
this.editCanvas[key] = value
|
||||
},
|
||||
// * 设置右键菜单
|
||||
setRightMenuShow(value: boolean) {
|
||||
this.rightMenuShow = value
|
||||
},
|
||||
// * 设置目标数据 hover
|
||||
setTargetHoverChart(hoverIndex?:TargetChartType["hoverIndex"]) {
|
||||
this.targetChart.hoverIndex = hoverIndex
|
||||
|
||||
Reference in New Issue
Block a user