goview_vue/src/packages/public/publicConfig.ts

137 lines
3.0 KiB
TypeScript
Raw Normal View History

2022-02-04 12:17:50 +08:00
import { getUUID } from '@/utils'
import { RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
import { groupTitle } from '@/settings/designSetting'
import { BaseEvent, EventLife } from '@/enums/eventEnum'
2022-07-15 00:11:42 +08:00
import {
RequestHttpEnum,
RequestDataTypeEnum,
RequestHttpIntervalEnum,
RequestContentTypeEnum,
RequestBodyEnum
} from '@/enums/httpEnum'
2022-11-12 21:49:04 +08:00
import {
ChartFrameEnum,
PublicConfigType,
CreateComponentType,
CreateComponentGroupType
} from '@/packages/index.d'
2022-04-22 10:04:55 +08:00
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
2022-03-17 20:18:46 +08:00
// 请求基础属性
2022-12-15 19:37:43 +08:00
export const requestConfig: RequestConfigType = {
2022-03-17 20:18:46 +08:00
requestDataType: RequestDataTypeEnum.STATIC,
requestHttpType: RequestHttpEnum.GET,
requestUrl: '',
2022-07-11 09:01:19 +08:00
requestInterval: undefined,
requestIntervalUnit: RequestHttpIntervalEnum.SECOND,
2022-07-15 00:11:42 +08:00
requestContentType: RequestContentTypeEnum.DEFAULT,
requestParamsBodyType: RequestBodyEnum.NONE,
requestSQLContent: {
sql: 'select * from where'
},
requestParams: {
Body: {
'form-data': {},
'x-www-form-urlencoded': {},
json: '',
xml: ''
},
Header: {},
Params: {}
}
2022-03-17 20:18:46 +08:00
}
2022-02-04 12:17:50 +08:00
// 单实例类
export class PublicConfigClass implements PublicConfigType {
2022-02-04 12:17:50 +08:00
public id = getUUID()
2022-08-06 13:04:25 +08:00
public isGroup = false
2022-02-04 12:17:50 +08:00
// 基本信息
2022-04-22 10:04:55 +08:00
public attr = { ...chartInitConfig, zIndex: -1 }
2022-04-19 22:07:54 +08:00
// 基本样式
2022-03-09 09:21:47 +08:00
public styles = {
// 使用滤镜
filterShow: false,
2022-04-25 16:17:22 +08:00
// 色相
hueRotate: 0,
2022-04-19 22:07:54 +08:00
// 饱和度
saturate: 1,
// 对比度
contrast: 1,
// 亮度
brightness: 1,
2022-04-25 16:17:22 +08:00
// 透明
opacity: 1,
2022-05-03 16:24:31 +08:00
// 旋转
rotateZ: 0,
rotateX: 0,
rotateY: 0,
// 倾斜
skewX: 0,
skewY: 0,
2022-07-15 00:11:42 +08:00
// 混合模式
blendMode: 'normal',
2022-04-19 22:07:54 +08:00
// 动画
2022-03-09 09:21:47 +08:00
animations: []
}
// 预览
public preview = {
overFlowHidden: false
}
// 状态
public status = {
lock: false,
hide: false
}
// 请求
public request = cloneDeep(requestConfig)
// 数据过滤
public filter = undefined
2022-10-11 18:31:29 +08:00
// 事件
2022-11-12 21:49:04 +08:00
public events = {
baseEvent: {
[BaseEvent.ON_CLICK]: undefined,
[BaseEvent.ON_DBL_CLICK]: undefined,
[BaseEvent.ON_MOUSE_ENTER]: undefined,
[BaseEvent.ON_MOUSE_LEAVE]: undefined
},
advancedEvents: {
[EventLife.VNODE_MOUNTED]: undefined,
[EventLife.VNODE_BEFORE_MOUNT]: undefined
}
}
2022-02-04 18:28:02 +08:00
}
// 多选成组类
export class PublicGroupConfigClass extends PublicConfigClass implements CreateComponentGroupType {
2022-08-06 13:04:25 +08:00
// 成组
public isGroup = true
// 名称
public chartConfig = {
2022-08-15 11:43:32 +08:00
key: 'group',
chartKey: 'group',
conKey: 'group',
category: 'group',
categoryName: 'group',
package: 'group',
chartFrame: ChartFrameEnum.COMMON,
title: groupTitle,
image: ''
}
2022-08-06 13:04:25 +08:00
// 组成员列表
public groupList: Array<CreateComponentType> = []
// ---- 原有 ---
2022-08-15 11:43:32 +08:00
// key
public key = 'group'
// 配置
public option = {}
2022-08-06 13:04:25 +08:00
// 标识
public id = getUUID()
// 基本信息
public attr = { w: 0, h: 0, x: 0, y: 0, offsetX: 0, offsetY: 0, zIndex: -1 }
}