mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
featr: 新增图层选中的样式
This commit is contained in:
@@ -4,7 +4,8 @@ import { loadingStart, loadingFinish, loadingError } from '@/utils'
|
||||
import {
|
||||
chartEditStoreType,
|
||||
EditCanvasType,
|
||||
MousePositionType
|
||||
MousePositionType,
|
||||
TargetChartType
|
||||
} from './chartEditStore.d'
|
||||
|
||||
// 编辑区域内容
|
||||
@@ -35,7 +36,8 @@ export const useChartEditStoreStore = defineStore({
|
||||
y: 0
|
||||
},
|
||||
targetChart: {
|
||||
index: 0
|
||||
hoverIndex: undefined,
|
||||
selectIndex: undefined
|
||||
},
|
||||
componentList: []
|
||||
}),
|
||||
@@ -46,11 +48,25 @@ export const useChartEditStoreStore = defineStore({
|
||||
getEditCanvas(): EditCanvasType {
|
||||
return this.editCanvas
|
||||
},
|
||||
getTargetChart():TargetChartType {
|
||||
return this.targetChart
|
||||
},
|
||||
getComponentList(): any[] {
|
||||
return this.componentList
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
// * 设置 editCanvas 数据项
|
||||
setEditCanvasItem< T extends keyof EditCanvasType, K extends EditCanvasType[T] >(key: T, value: K) {
|
||||
this.editCanvas[key] = value
|
||||
},
|
||||
// * 设置目标数据
|
||||
setTargetHoverChart(hoverIndex?:TargetChartType["hoverIndex"]) {
|
||||
this.targetChart.hoverIndex = hoverIndex
|
||||
},
|
||||
setTargetSelectChart(selectIndex?:TargetChartType["selectIndex"]) {
|
||||
this.targetChart.selectIndex = selectIndex
|
||||
},
|
||||
// * 新增组件列表
|
||||
addComponentList<T>(chartData: T): void {
|
||||
this.componentList.push(chartData)
|
||||
@@ -75,13 +91,6 @@ export const useChartEditStoreStore = defineStore({
|
||||
loadingError()
|
||||
}
|
||||
},
|
||||
// * 设置数据项
|
||||
setEditCanvasItem<
|
||||
T extends keyof EditCanvasType,
|
||||
K extends EditCanvasType[T]
|
||||
>(key: T, value: K) {
|
||||
this.editCanvas[key] = value
|
||||
},
|
||||
// * 设置页面样式属性
|
||||
setPageStyle<T extends keyof CSSStyleDeclaration>(
|
||||
key: T,
|
||||
|
||||
Reference in New Issue
Block a user