publicConfig.ts
4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import { getUUID } from '@/utils'
import { RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
import { groupTitle } from '@/settings/designSetting'
import { BaseEvent, EventLife } from '@/enums/eventEnum'
import {
RequestHttpEnum,
RequestDataTypeEnum,
RequestHttpIntervalEnum,
RequestContentTypeEnum,
RequestBodyEnum
} from '@/enums/httpEnum'
import { ChartFrameEnum, PublicConfigType, CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
/**
* 这里更新版本有冲突
* ft 修改在公共接口下拉框里默认选择公共接口,不选择静态
* 修改后的代码在注释之间,并标注好源代码和修改后代码,方便回溯
* 源代码 requestDataType: RequestDataTypeEnum.STATIC,
* 修改后的代码 requestDataType: RequestDataTypeEnum.Pond,
*/
// 请求基础属性
export const requestConfig: RequestConfigType = {
requestDataType: RequestDataTypeEnum.Pond,
requestHttpType: RequestHttpEnum.GET,
requestUrl: '',
requestInterval: undefined,
requestIntervalUnit: RequestHttpIntervalEnum.SECOND,
requestContentType: RequestContentTypeEnum.DEFAULT,
requestParamsBodyType: RequestBodyEnum.NONE,
requestSQLContent: {
sql: 'select * from where'
},
requestParams: {
Body: {
'form-data': {},
'x-www-form-urlencoded': {},
json: '',
xml: ''
},
Header: {},
Params: {}
},
pondRequestOriginUrl: '',
pondRequestInterval: 0,
pondRequestIntervalUnit: '',
pondRequestGlobalTokenSuffix: '',
pondRequestGlobalTokenKey: '',
pondRequestHttpType: RequestHttpEnum.GET,
pondRequestContentType: RequestContentTypeEnum.DEFAULT,
pondRequestUrl:'',
pondRequestSQLContent: {
sql: ''
},
pondRequestParamsBodyType: RequestBodyEnum.NONE,
pondRequestParams: {
"Body": {
"form-data": {},
"x-www-form-urlencoded": {},
"json": "",
"xml": ""
},
"Header": {},
"Params": {}
},
pondRequestGlobalIsToken: true
}
// 单实例类
export class PublicConfigClass implements PublicConfigType {
public id = getUUID()
public isGroup = false
// 基本信息
public attr = { ...chartInitConfig, zIndex: -1 }
// 基本样式
public styles = {
// 使用滤镜
filterShow: false,
// 色相
hueRotate: 0,
// 饱和度
saturate: 1,
// 对比度
contrast: 1,
// 亮度
brightness: 1,
// 透明
opacity: 1,
// 旋转
rotateZ: 0,
rotateX: 0,
rotateY: 0,
// 倾斜
skewX: 0,
skewY: 0,
// 混合模式
blendMode: 'normal',
// 动画
animations: [],
// 动画配置
animationsStyleConfig: {
animationPlayState: 'paused',
animationTimingFunction: 'ease',
animationDuration: 0,
animationDelay: 0,
animationIterationCount: 'infinite'
}
}
// 预览
public preview = {
overFlowHidden: false
}
// 状态
public status = {
lock: false,
hide: false
}
// 请求
public request = cloneDeep(requestConfig)
// 数据过滤
public filter = undefined
// 事件
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
},
interactEvents: []
}
}
// 多选成组类
export class PublicGroupConfigClass extends PublicConfigClass implements CreateComponentGroupType {
// 成组
public isGroup = true
// 名称
public chartConfig = {
key: 'group',
chartKey: 'group',
conKey: 'group',
category: 'group',
categoryName: 'group',
package: 'group',
chartFrame: ChartFrameEnum.COMMON,
title: groupTitle,
image: ''
}
// 组成员列表
public groupList: Array<CreateComponentType> = []
// ---- 原有 ---
// key
public key = 'group'
// 配置
public option = {}
// 标识
public id = getUUID()
// 基本信息
public attr = { w: 0, h: 0, x: 0, y: 0, offsetX: 0, offsetY: 0, zIndex: -1 }
}