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) // 选中