fix: 修改右键判定区域,新增历史记录store

This commit is contained in:
MTrun
2022-01-31 23:37:43 +08:00
parent 0a223afab2
commit c6a7be352b
9 changed files with 128 additions and 46 deletions
@@ -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