mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 处理界面展示相关联的问题
This commit is contained in:
@@ -1,34 +1,41 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { store } from '@/store'
|
||||
import { ChartLayoutType } from './chartLayoutStore.d'
|
||||
import { ChartLayoutType, ChartLayoutFilterType } from './chartLayoutStore.d'
|
||||
import { setLocalStorage, getLocalStorage } from '@/utils'
|
||||
import { GO_Chart_Layout_Store } from '@/settings/storageConst'
|
||||
|
||||
const storageChartLayout: ChartLayoutType = getLocalStorage(
|
||||
GO_Chart_Layout_Store
|
||||
)
|
||||
|
||||
export const useChartLayoutStore = defineStore({
|
||||
id: 'useChartLayoutStore',
|
||||
state: (): ChartLayoutType => ({
|
||||
// 图层控制
|
||||
layers: true,
|
||||
// 图表组件
|
||||
charts: true,
|
||||
// 详情设置
|
||||
details: true,
|
||||
// 对齐线
|
||||
alignLine: true,
|
||||
// 滤镜
|
||||
filter: {
|
||||
// 色相
|
||||
hueRotate: 0,
|
||||
// 饱和度
|
||||
saturate: 0,
|
||||
// 亮度
|
||||
brightness: 100,
|
||||
// 对比度
|
||||
contrast: 100,
|
||||
// 不透明度
|
||||
unOpacity: 100
|
||||
}
|
||||
}),
|
||||
state: (): ChartLayoutType =>
|
||||
storageChartLayout || {
|
||||
// 图层控制
|
||||
layers: true,
|
||||
// 图表组件
|
||||
charts: true,
|
||||
// 详情设置
|
||||
details: true,
|
||||
// 对齐线
|
||||
alignLine: true,
|
||||
// 滤镜
|
||||
filter: {
|
||||
// 色相
|
||||
hueRotate: 0,
|
||||
// 饱和度
|
||||
saturate: 0,
|
||||
// 亮度
|
||||
brightness: 100,
|
||||
// 对比度
|
||||
contrast: 100,
|
||||
// 不透明度
|
||||
unOpacity: 100
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getLayers(e): boolean {
|
||||
getLayers(): boolean {
|
||||
return this.layers
|
||||
},
|
||||
getCharts(): boolean {
|
||||
@@ -40,13 +47,22 @@ export const useChartLayoutStore = defineStore({
|
||||
getAlignLine(): boolean {
|
||||
return this.alignLine
|
||||
},
|
||||
getFilter(): object {
|
||||
getFilter(): ChartLayoutFilterType {
|
||||
return this.filter
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setItem(key: string, value: boolean): void {
|
||||
;(this as any)[key] = value
|
||||
setLocalStorage(GO_Chart_Layout_Store, this.$state)
|
||||
},
|
||||
setFilter<T extends keyof ChartLayoutType>(key: T, value: boolean): void {
|
||||
;(this.filter as any)[key] = value
|
||||
setLocalStorage(GO_Chart_Layout_Store, this.$state)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
export function useChartLayoutSettingWithOut() {
|
||||
return useChartLayoutStore(store)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user