mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-22 21:46:23 +08:00
fix: 解决点击图表分列没反应的bug
This commit is contained in:
parent
ac55ace49b
commit
4f1dc1acd7
@ -8,13 +8,12 @@ const chartEditStore = useChartEditStore()
|
|||||||
|
|
||||||
const { GO_CHART_LAYOUT_STORE } = StorageEnum
|
const { GO_CHART_LAYOUT_STORE } = StorageEnum
|
||||||
|
|
||||||
const storageChartLayout: ChartLayoutType = getLocalStorage(GO_CHART_LAYOUT_STORE)
|
const storageChartLayout: Partial<ChartLayoutType> = getLocalStorage(GO_CHART_LAYOUT_STORE)
|
||||||
|
|
||||||
// 编辑区域布局和静态设置
|
// 编辑区域布局和静态设置
|
||||||
export const useChartLayoutStore = defineStore({
|
export const useChartLayoutStore = defineStore({
|
||||||
id: 'useChartLayoutStore',
|
id: 'useChartLayoutStore',
|
||||||
state: (): ChartLayoutType =>
|
state: (): ChartLayoutType => ({
|
||||||
storageChartLayout || {
|
|
||||||
// 图层控制
|
// 图层控制
|
||||||
layers: true,
|
layers: true,
|
||||||
// 图表组件
|
// 图表组件
|
||||||
@ -24,8 +23,10 @@ export const useChartLayoutStore = defineStore({
|
|||||||
// 组件列表展示类型(默认单列)
|
// 组件列表展示类型(默认单列)
|
||||||
chartType: ChartModeEnum.SINGLE,
|
chartType: ChartModeEnum.SINGLE,
|
||||||
// 图层类型(默认图片)
|
// 图层类型(默认图片)
|
||||||
layerType: LayerModeEnum.THUMBNAIL
|
layerType: LayerModeEnum.THUMBNAIL,
|
||||||
},
|
// 防止值不存在
|
||||||
|
...storageChartLayout
|
||||||
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getLayers(): boolean {
|
getLayers(): boolean {
|
||||||
return this.layers
|
return this.layers
|
||||||
@ -47,7 +48,7 @@ export const useChartLayoutStore = defineStore({
|
|||||||
setItem<T extends keyof ChartLayoutType, K extends ChartLayoutType[T]>(key: T, value: K): void {
|
setItem<T extends keyof ChartLayoutType, K extends ChartLayoutType[T]>(key: T, value: K): void {
|
||||||
this.$patch(state => {
|
this.$patch(state => {
|
||||||
state[key] = value
|
state[key] = value
|
||||||
});
|
})
|
||||||
setLocalStorage(GO_CHART_LAYOUT_STORE, this.$state)
|
setLocalStorage(GO_CHART_LAYOUT_STORE, this.$state)
|
||||||
// 重新计算拖拽区域缩放比例
|
// 重新计算拖拽区域缩放比例
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user