From 9707e4af0faa38e3eac47d4150a87065c5ae1d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 1 Oct 2022 21:10:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=9B=BE=E5=B1=82?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=B1=BB=E5=9E=8B=E6=8C=81=E4=B9=85=E5=8C=96?= =?UTF-8?q?=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/index.d.ts | 11 +++++--- .../chartLayoutStore/chartLayoutStore.d.ts | 8 ++++++ .../chartLayoutStore/chartLayoutStore.ts | 9 +++++-- .../components/LayersGroupListItem/index.vue | 2 +- .../components/LayersListItem/index.vue | 2 +- .../components/LayersStatus/index.vue | 5 ++-- src/views/chart/ContentLayers/index.d.ts | 4 --- src/views/chart/ContentLayers/index.vue | 26 ++++++++++++------- 8 files changed, 43 insertions(+), 24 deletions(-) delete mode 100644 src/views/chart/ContentLayers/index.d.ts diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index e7d8cdf4..a565b12b 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -36,6 +36,12 @@ interface EchartsDataType { source: any[] } +// 组件状态 +export interface StatusType { + lock: boolean, + hide: boolean, +} + // 滤镜/变换枚举 export enum FilterEnum { // 是否启用 @@ -84,11 +90,8 @@ export interface PublicConfigType { // 动画 animations: string[] }, - status: { - lock: boolean, - hide: boolean, - }, filter?: string + status: StatusType, setPosition: Function } diff --git a/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts b/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts index fecae02b..135f155a 100644 --- a/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts +++ b/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts @@ -1,7 +1,13 @@ +export enum LayerModeEnum { + THUMBNAIL = 'thumbnail', + TEXT = 'text' +} + export enum ChartLayoutStoreEnum { LAYERS = 'layers', CHARTS = 'charts', DETAILS = 'details', + LAYER_TYPE = 'layerType' } export interface ChartLayoutType { @@ -11,4 +17,6 @@ export interface ChartLayoutType { [ChartLayoutStoreEnum.CHARTS]: boolean // 详情设置 [ChartLayoutStoreEnum.DETAILS]: boolean + // 层级展示方式 + [ChartLayoutStoreEnum.LAYER_TYPE]: LayerModeEnum } diff --git a/src/store/modules/chartLayoutStore/chartLayoutStore.ts b/src/store/modules/chartLayoutStore/chartLayoutStore.ts index e2c4ac9b..6a8bcc1a 100644 --- a/src/store/modules/chartLayoutStore/chartLayoutStore.ts +++ b/src/store/modules/chartLayoutStore/chartLayoutStore.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia' -import { ChartLayoutType } from './chartLayoutStore.d' +import { ChartLayoutType, LayerModeEnum } from './chartLayoutStore.d' import { setLocalStorage, getLocalStorage } from '@/utils' import { StorageEnum } from '@/enums/storageEnum' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' @@ -20,7 +20,9 @@ export const useChartLayoutStore = defineStore({ // 图表组件 charts: true, // 详情设置(收缩为true) - details: false + details: false, + // 图层类型(默认图片) + layerType: LayerModeEnum.THUMBNAIL }, getters: { getLayers(): boolean { @@ -31,6 +33,9 @@ export const useChartLayoutStore = defineStore({ }, getDetails(): boolean { return this.details + }, + getLayerType(): LayerModeEnum { + return this.layerType } }, actions: { diff --git a/src/views/chart/ContentLayers/components/LayersGroupListItem/index.vue b/src/views/chart/ContentLayers/components/LayersGroupListItem/index.vue index d9156753..587eb85b 100644 --- a/src/views/chart/ContentLayers/components/LayersGroupListItem/index.vue +++ b/src/views/chart/ContentLayers/components/LayersGroupListItem/index.vue @@ -51,10 +51,10 @@ import { useDesignStore } from '@/store/modules/designStore/designStore' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useContextMenu, divider } from '@/views/chart/hooks/useContextMenu.hook' import { MenuOptionsItemType } from '@/views/chart/hooks/useContextMenu.hook.d' +import { LayerModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d' import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d' import { LayersListItem } from '../LayersListItem' import { LayersStatus } from '../LayersStatus/index' -import { LayerModeEnum } from '../../index.d' import { icon } from '@/plugins' const props = defineProps({ diff --git a/src/views/chart/ContentLayers/components/LayersListItem/index.vue b/src/views/chart/ContentLayers/components/LayersListItem/index.vue index 8562b55f..2e72cff0 100644 --- a/src/views/chart/ContentLayers/components/LayersListItem/index.vue +++ b/src/views/chart/ContentLayers/components/LayersListItem/index.vue @@ -24,8 +24,8 @@ import { computed, PropType } from 'vue' import { requireErrorImg } from '@/utils' import { useDesignStore } from '@/store/modules/designStore/designStore' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' +import { LayerModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d' import { LayersStatus } from '../LayersStatus/index' -import { LayerModeEnum } from '../../index.d' const props = defineProps({ componentData: { diff --git a/src/views/chart/ContentLayers/components/LayersStatus/index.vue b/src/views/chart/ContentLayers/components/LayersStatus/index.vue index e0cc2547..a43d8aa0 100644 --- a/src/views/chart/ContentLayers/components/LayersStatus/index.vue +++ b/src/views/chart/ContentLayers/components/LayersStatus/index.vue @@ -20,9 +20,8 @@