mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
Merge branch 'dev' into master-fetch-dev
This commit is contained in:
commit
367d0a23ca
@ -8,24 +8,25 @@ 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,
|
// 图表组件
|
||||||
// 图表组件
|
charts: true,
|
||||||
charts: true,
|
// 详情设置(收缩为true)
|
||||||
// 详情设置(收缩为true)
|
details: false,
|
||||||
details: false,
|
// 组件列表展示类型(默认单列)
|
||||||
// 组件列表展示类型(默认单列)
|
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
|
||||||
@ -46,8 +47,8 @@ export const useChartLayoutStore = defineStore({
|
|||||||
actions: {
|
actions: {
|
||||||
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