From d07f25045cb3f2e91b4a58b87f2f615ddf19cff2 Mon Sep 17 00:00:00 2001 From: huanghao1412 Date: Thu, 7 Mar 2024 15:40:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=BB=84=E6=80=81=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E5=9B=BA=E5=AE=9A=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/index.d.ts | 6 +++++- src/packages/public/publicConfig.ts | 3 ++- .../chart/ContentCharts/components/ChartsItemBox/index.vue | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index 4f815f38..eadfa948 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -114,13 +114,17 @@ export const BlendModeEnumList = [ { label: '亮度', value: 'luminosity' } ] +export interface PublicConfigAttrType { + x: number; y: number; w: number; h: number; zIndex: number; offsetX: number; offsetY: number, isHeadInsert?: boolean, isFixedInit?: boolean +} + // 组件实例类 export interface PublicConfigType { id: string isGroup: boolean // isHeadInsert 组件置底 // isFixedInit 组件初始时位置以x,y为准 不以鼠标位置为准 - attr: { x: number; y: number; w: number; h: number; zIndex: number; offsetX: number; offsetY: number, isHeadInsert?: boolean, isFixedInit?: boolean } + attr: PublicConfigAttrType styles: { [FilterEnum.FILTERS_SHOW]: boolean [FilterEnum.OPACITY]: number diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index 99fcaff0..a3ec99e4 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -15,6 +15,7 @@ import { import { ChartFrameEnum, PublicConfigType, + PublicConfigAttrType, CreateComponentType, CreateComponentGroupType } from '@/packages/index.d' @@ -123,7 +124,7 @@ export class PublicConfigClass implements PublicConfigType { public id = getUUID() public isGroup = false // 基本信息 - public attr = { ...chartInitConfig, zIndex: -1 } + public attr = { ...chartInitConfig, zIndex: -1 } as PublicConfigAttrType // 基本样式 public styles = { // 使用滤镜 diff --git a/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue b/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue index 74cebd93..97899e6f 100644 --- a/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue +++ b/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue @@ -129,7 +129,7 @@ const dblclickHandle = async (item: ConfigType) => { newComponent.chartConfig.chartFrame = item.chartFrame } // 组件置底插入 - let isHead = !!newComponent.chartConfig.isHeadInsert + let isHead = !!newComponent.attr.isHeadInsert // 添加 chartEditStore.addComponentList(newComponent, isHead, true) // 选中