fix: 优化组态 创建时固定位置

This commit is contained in:
huanghao1412 2024-03-07 15:40:59 +08:00
parent 23bf1d2af4
commit d07f25045c
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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 = {
// 使用滤镜

View File

@ -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)
//