goview_vue/src/packages/public/publicConfig.ts

33 lines
884 B
TypeScript
Raw Normal View History

2022-02-04 12:17:50 +08:00
import { getUUID } from '@/utils'
import { PublicConfigType } from '@/packages/index.d'
2022-03-17 20:18:46 +08:00
import { RequestDataTypeEnum, RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
2022-03-21 20:56:42 +08:00
import { RequestHttpEnum } from '@/enums/httpEnum'
2022-03-17 20:18:46 +08:00
const requestConfig: RequestConfigType = {
requestDataType: RequestDataTypeEnum.STATIC,
2022-03-21 20:56:42 +08:00
requestHttpType: RequestHttpEnum.GET
2022-03-17 20:18:46 +08:00
}
2022-02-04 12:17:50 +08:00
2022-02-04 18:28:02 +08:00
export class publicConfig implements PublicConfigType {
2022-02-04 12:17:50 +08:00
public id = getUUID()
// 重命名
public rename = undefined
// 基本信息
2022-02-04 18:28:02 +08:00
public attr = { x: 0, y: 0, w: 500, h: 300, zIndex: -1 }
2022-03-09 09:21:47 +08:00
// 基本样式(动画,透明)
public styles = {
opacity: 1,
animations: []
}
// 数据
2022-03-21 20:56:42 +08:00
public data = { ...requestConfig }
2022-03-17 20:18:46 +08:00
// 数据获取
2022-03-21 20:56:42 +08:00
public requestData = []
2022-03-21 23:03:10 +08:00
2022-02-04 12:17:50 +08:00
// 设置坐标
public setPosition(x: number, y: number): void {
this.attr.x = x
this.attr.y = y
}
2022-02-04 18:28:02 +08:00
}