@zgfe/modules-dm 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +37 -0
  2. package/es/components/demo.d.ts +8 -0
  3. package/es/components/demo.js +23 -0
  4. package/es/constants/api.d.ts +27 -0
  5. package/es/constants/api.js +58 -0
  6. package/es/index.d.ts +5 -0
  7. package/es/index.js +5 -0
  8. package/es/modules/dataCollection/collectionAttributeList.d.ts +20 -0
  9. package/es/modules/dataCollection/collectionAttributeList.js +458 -0
  10. package/es/modules/dataCollection/collectionEventList.d.ts +13 -0
  11. package/es/modules/dataCollection/collectionEventList.js +317 -0
  12. package/es/modules/dataCollection/demo/index.d.ts +2 -0
  13. package/es/modules/dataCollection/demo/index.js +6 -0
  14. package/es/modules/dataCollection/index.d.ts +3 -0
  15. package/es/modules/dataCollection/index.js +97 -0
  16. package/es/modules/dataCollection/styles/index.less +249 -0
  17. package/es/modules/dataCollection/tablePlus.d.ts +34 -0
  18. package/es/modules/dataCollection/tablePlus.js +598 -0
  19. package/es/modules/dataManage/demo/index.d.ts +2 -0
  20. package/es/modules/dataManage/demo/index.js +6 -0
  21. package/es/modules/dataManage/index.d.ts +4 -0
  22. package/es/modules/dataManage/index.js +58 -0
  23. package/es/modules/dataManage/styles/index.less +26 -0
  24. package/es/modules/dataPlan/addEventOrUser.d.ts +34 -0
  25. package/es/modules/dataPlan/addEventOrUser.js +280 -0
  26. package/es/modules/dataPlan/addPlan.d.ts +10 -0
  27. package/es/modules/dataPlan/addPlan.js +644 -0
  28. package/es/modules/dataPlan/demo/index.d.ts +2 -0
  29. package/es/modules/dataPlan/demo/index.js +6 -0
  30. package/es/modules/dataPlan/eventList.d.ts +23 -0
  31. package/es/modules/dataPlan/eventList.js +21 -0
  32. package/es/modules/dataPlan/index.d.ts +4 -0
  33. package/es/modules/dataPlan/index.js +233 -0
  34. package/es/modules/dataPlan/search.d.ts +11 -0
  35. package/es/modules/dataPlan/search.js +42 -0
  36. package/es/modules/dataPlan/styles/index.less +269 -0
  37. package/es/modules/dataPlan/tablePlus.d.ts +22 -0
  38. package/es/modules/dataPlan/tablePlus.js +106 -0
  39. package/es/modules/dataPlan/userAttributeList.d.ts +19 -0
  40. package/es/modules/dataPlan/userAttributeList.js +77 -0
  41. package/es/types/flow.d.ts +395 -0
  42. package/es/types/flow.js +77 -0
  43. package/es/types.d.ts +412 -0
  44. package/es/types.js +106 -0
  45. package/es/utils/ajax.d.ts +3 -0
  46. package/es/utils/ajax.js +7 -0
  47. package/package.json +60 -0
package/es/types.d.ts ADDED
@@ -0,0 +1,412 @@
1
+ import { CycleTimeUnit } from '@zgfe/business-lib/es/cycleTime';
2
+ declare namespace ZModulesCDP {
3
+ enum WebType {
4
+ number = "number",
5
+ string = "string",
6
+ date = "date"
7
+ }
8
+ interface SimpleLinkData {
9
+ /**
10
+ * 连接id
11
+ */
12
+ id: number;
13
+ /**
14
+ * 类别名称
15
+ */
16
+ type: string;
17
+ /**
18
+ * 连接名称
19
+ */
20
+ name: string;
21
+ }
22
+ interface LinkData {
23
+ /**
24
+ * 连接id
25
+ */
26
+ id?: number;
27
+ /**
28
+ * 类别名称
29
+ */
30
+ type: string;
31
+ /**
32
+ * 连接名称
33
+ */
34
+ name: string;
35
+ /**
36
+ * 服务器地址
37
+ */
38
+ hostname: string;
39
+ /**
40
+ * 连接端口
41
+ */
42
+ port: number;
43
+ /**
44
+ * 数据库名称
45
+ */
46
+ database: string;
47
+ /**
48
+ * 用户名
49
+ */
50
+ username: string;
51
+ /**
52
+ * 密码
53
+ */
54
+ password: string;
55
+ /**
56
+ * 创建人姓名
57
+ */
58
+ creator?: string;
59
+ /**
60
+ * 创建时间
61
+ */
62
+ createDate?: number;
63
+ }
64
+ /**
65
+ * 连接类型
66
+ */
67
+ interface LinkType {
68
+ value: string;
69
+ label: string;
70
+ }
71
+ namespace DataSet {
72
+ /**
73
+ * 数据集实例
74
+ */
75
+ interface SimpleInstance {
76
+ /**
77
+ * 数据集id
78
+ */
79
+ id?: number;
80
+ /**
81
+ * 数据集名称
82
+ */
83
+ name: string;
84
+ /**
85
+ * 数据集表名称
86
+ */
87
+ tableName: string;
88
+ /**
89
+ * 数据集描述
90
+ */
91
+ desc: string;
92
+ }
93
+ /**
94
+ * 数据集更新方式
95
+ */
96
+ enum SyncType {
97
+ /**
98
+ * 全量更新
99
+ */
100
+ global = 1,
101
+ /**
102
+ * 增量更新
103
+ */
104
+ incre = 2
105
+ }
106
+ /**
107
+ * 更新类型
108
+ */
109
+ enum UpdateType {
110
+ /**
111
+ * 手动更新
112
+ */
113
+ mumal = 1,
114
+ /**
115
+ * 自动更新
116
+ */
117
+ timer = 2
118
+ }
119
+ /**
120
+ * 数据库表字段基本类型
121
+ */
122
+ interface BaseColumn {
123
+ /**
124
+ * 字段名称
125
+ */
126
+ name: string;
127
+ /**
128
+ * 字段类型(原始数据库中的字段类型)
129
+ */
130
+ type: string;
131
+ /**
132
+ * 是否是主键列
133
+ */
134
+ isPrimaryKey: boolean;
135
+ }
136
+ /**
137
+ * 表字段数据
138
+ */
139
+ interface Column extends BaseColumn {
140
+ /**
141
+ * 字段备注
142
+ */
143
+ comment: string;
144
+ /**
145
+ * 字段类型(web端处理用)
146
+ */
147
+ webType: WebType;
148
+ }
149
+ /**
150
+ * 字段抽取规则
151
+ */
152
+ interface ColumnRule {
153
+ /**
154
+ * 字段名称
155
+ */
156
+ column: string;
157
+ /**
158
+ * 条件操作符
159
+ */
160
+ operator: string;
161
+ /**
162
+ * 条件值
163
+ * 字符串:['value']
164
+ * 数字:["2"]
165
+ * 绝对日期:['2020-02-09', '2020-02-15']
166
+ * 相对日期:["6"]
167
+ */
168
+ value: string[];
169
+ }
170
+ /**
171
+ * 新建数据集参数
172
+ */
173
+ interface CreateParam {
174
+ /**
175
+ * 数据集名称
176
+ */
177
+ datasetName: string;
178
+ /**
179
+ * 数据库类型
180
+ */
181
+ dbType: string;
182
+ /**
183
+ * 数据源id
184
+ */
185
+ dbSourceId: number;
186
+ /**
187
+ * 数据表名称
188
+ */
189
+ dbTableName: string;
190
+ /**
191
+ * 应用id
192
+ */
193
+ appId: number;
194
+ /**
195
+ * 同步字段列表
196
+ */
197
+ columns: Column[];
198
+ /**
199
+ * 抽取设置规则列表
200
+ */
201
+ columnRules: ColumnRule[];
202
+ /**
203
+ * 更新方式
204
+ */
205
+ syncType: SyncType;
206
+ /**
207
+ * 增量更新依据字段
208
+ * 当updateType为增量更新时必传
209
+ */
210
+ updateBy?: Column;
211
+ /**
212
+ * 更新设置
213
+ */
214
+ updateSetting: {
215
+ /**
216
+ * 更新类型:手动更新: 1、定时更新: 2
217
+ */
218
+ type: UpdateType;
219
+ /**
220
+ * 更新规则,自动更新时必传
221
+ */
222
+ rule?: {
223
+ /**
224
+ * 时间单位
225
+ */
226
+ unit: CycleTimeUnit;
227
+ /**
228
+ * 定时任务时间值
229
+ * 周(1-7):[1, 2, 7]: 周几
230
+ * 月(1-28):[2, 3, 9]:几号
231
+ */
232
+ day?: number[];
233
+ /**
234
+ * 时分秒
235
+ * 如:12:03:39
236
+ */
237
+ time: string;
238
+ };
239
+ };
240
+ /**
241
+ * 任务名称
242
+ */
243
+ jobName: string;
244
+ /**
245
+ * 任务描述
246
+ */
247
+ jobDesc: string;
248
+ }
249
+ /**
250
+ * 编辑的任务详情信息
251
+ */
252
+ interface TaskEditInfo extends CreateParam {
253
+ /**
254
+ * 任务id
255
+ */
256
+ id: number;
257
+ /**
258
+ * 数据源名称
259
+ */
260
+ dbSourceName: string;
261
+ }
262
+ /**
263
+ * 任务更新状态
264
+ */
265
+ enum UpdateState {
266
+ success = "SUCCESS",
267
+ fail = "FAILURE",
268
+ running = "RUNNING_EXECUTION"
269
+ }
270
+ /**
271
+ * 任务更新记录
272
+ */
273
+ interface HistoryData {
274
+ /**
275
+ * 记录id
276
+ */
277
+ id: number;
278
+ /**
279
+ * 更新完成时间
280
+ */
281
+ endTime: Date;
282
+ /**
283
+ * 更新数据条数
284
+ */
285
+ successRead: number;
286
+ /**
287
+ * 更新状态
288
+ */
289
+ state: UpdateState;
290
+ }
291
+ interface QueryTaskPara {
292
+ /**
293
+ * 数据集或创建人名称
294
+ */
295
+ name: string;
296
+ }
297
+ /**
298
+ * 任务状态
299
+ */
300
+ enum TaskStatus {
301
+ /**
302
+ * 启用
303
+ */
304
+ enable = 1,
305
+ /**
306
+ * 禁用
307
+ */
308
+ disable = 2,
309
+ /**
310
+ * 已删除
311
+ */
312
+ deleted = 3,
313
+ /**
314
+ * 不合法任务
315
+ */
316
+ invalid = 4
317
+ }
318
+ enum JobType {
319
+ /**
320
+ * 普通数据集
321
+ */
322
+ normal = 1,
323
+ /**
324
+ * 可视化数据集
325
+ */
326
+ visual = 2
327
+ }
328
+ /**
329
+ * 任务信息
330
+ */
331
+ interface Task {
332
+ /**
333
+ * 任务id
334
+ */
335
+ id: number;
336
+ /**
337
+ * 任务名称
338
+ */
339
+ jobName: string;
340
+ /**
341
+ * 数据集名称
342
+ */
343
+ datasetName: string;
344
+ /**
345
+ * 数据库类型
346
+ */
347
+ dbType: string;
348
+ /**
349
+ * 表名称
350
+ */
351
+ tableName: string;
352
+ /**
353
+ * 创建人
354
+ */
355
+ creator: string;
356
+ /**
357
+ * 创建时间
358
+ */
359
+ createTime: Date;
360
+ /**
361
+ * 最近更新完成时间
362
+ */
363
+ lastUpdateTime: Date;
364
+ /**
365
+ * 下次执行时间
366
+ */
367
+ nextRunTime: Date;
368
+ /**
369
+ * 更新方式
370
+ */
371
+ updateType: UpdateType;
372
+ /**
373
+ * 更新状态:成功、失败、执行中
374
+ */
375
+ state: UpdateState;
376
+ /**
377
+ * 启用状态
378
+ */
379
+ status: TaskStatus;
380
+ /**
381
+ * 数据集任务类型,包括普通数据集以及可视化数据集
382
+ */
383
+ jobType: JobType;
384
+ /**
385
+ * 画布id,当任务类型是可视化数据集时有
386
+ */
387
+ flowId?: number;
388
+ }
389
+ /**
390
+ * 创建任务组件特性
391
+ */
392
+ interface CreateProp {
393
+ /**
394
+ * 组件模式
395
+ */
396
+ mode: 'edit' | 'create';
397
+ /**
398
+ * 任务id,mode为edit时必传
399
+ */
400
+ taskId?: number;
401
+ /**
402
+ * 返回按钮点击回调
403
+ */
404
+ onBack?: () => void;
405
+ /**
406
+ * 保存成功回调
407
+ */
408
+ onOk?: () => void;
409
+ }
410
+ }
411
+ }
412
+ export default ZModulesCDP;
package/es/types.js ADDED
@@ -0,0 +1,106 @@
1
+ var ZModulesCDP;
2
+
3
+ (function (ZModulesCDP) {
4
+ var WebType;
5
+
6
+ (function (WebType) {
7
+ WebType["number"] = "number";
8
+ WebType["string"] = "string";
9
+ WebType["date"] = "date";
10
+ })(WebType = ZModulesCDP.WebType || (ZModulesCDP.WebType = {}));
11
+
12
+ var DataSet;
13
+
14
+ (function (DataSet) {
15
+ /**
16
+ * 数据集更新方式
17
+ */
18
+ var SyncType;
19
+
20
+ (function (SyncType) {
21
+ /**
22
+ * 全量更新
23
+ */
24
+ SyncType[SyncType["global"] = 1] = "global";
25
+ /**
26
+ * 增量更新
27
+ */
28
+
29
+ SyncType[SyncType["incre"] = 2] = "incre";
30
+ })(SyncType = DataSet.SyncType || (DataSet.SyncType = {}));
31
+ /**
32
+ * 更新类型
33
+ */
34
+
35
+
36
+ var UpdateType;
37
+
38
+ (function (UpdateType) {
39
+ /**
40
+ * 手动更新
41
+ */
42
+ UpdateType[UpdateType["mumal"] = 1] = "mumal";
43
+ /**
44
+ * 自动更新
45
+ */
46
+
47
+ UpdateType[UpdateType["timer"] = 2] = "timer";
48
+ })(UpdateType = DataSet.UpdateType || (DataSet.UpdateType = {}));
49
+ /**
50
+ * 任务更新状态
51
+ */
52
+
53
+
54
+ var UpdateState;
55
+
56
+ (function (UpdateState) {
57
+ UpdateState["success"] = "SUCCESS";
58
+ UpdateState["fail"] = "FAILURE";
59
+ UpdateState["running"] = "RUNNING_EXECUTION";
60
+ })(UpdateState = DataSet.UpdateState || (DataSet.UpdateState = {}));
61
+ /**
62
+ * 任务状态
63
+ */
64
+
65
+
66
+ var TaskStatus;
67
+
68
+ (function (TaskStatus) {
69
+ /**
70
+ * 启用
71
+ */
72
+ TaskStatus[TaskStatus["enable"] = 1] = "enable";
73
+ /**
74
+ * 禁用
75
+ */
76
+
77
+ TaskStatus[TaskStatus["disable"] = 2] = "disable";
78
+ /**
79
+ * 已删除
80
+ */
81
+
82
+ TaskStatus[TaskStatus["deleted"] = 3] = "deleted";
83
+ /**
84
+ * 不合法任务
85
+ */
86
+
87
+ TaskStatus[TaskStatus["invalid"] = 4] = "invalid";
88
+ })(TaskStatus = DataSet.TaskStatus || (DataSet.TaskStatus = {}));
89
+
90
+ var JobType;
91
+
92
+ (function (JobType) {
93
+ /**
94
+ * 普通数据集
95
+ */
96
+ JobType[JobType["normal"] = 1] = "normal";
97
+ /**
98
+ * 可视化数据集
99
+ */
100
+
101
+ JobType[JobType["visual"] = 2] = "visual";
102
+ })(JobType = DataSet.JobType || (DataSet.JobType = {}));
103
+ })(DataSet = ZModulesCDP.DataSet || (ZModulesCDP.DataSet = {}));
104
+ })(ZModulesCDP || (ZModulesCDP = {}));
105
+
106
+ export default ZModulesCDP;
@@ -0,0 +1,3 @@
1
+ import { ajaxConfig } from '@zgfe/business-lib/es/utils/type';
2
+ declare function request<T>(url: string, options: ajaxConfig<T>): Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<T> | null>;
3
+ export default request;
@@ -0,0 +1,7 @@
1
+ import { ajax } from '@zgfe/business-lib';
2
+
3
+ function request(url, options) {
4
+ return ajax(url, options);
5
+ }
6
+
7
+ export default request;
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@zgfe/modules-dm",
3
+ "version": "1.0.1",
4
+ "module": "es/index.js",
5
+ "typings": "es/index.d.ts",
6
+ "license": "ISC",
7
+ "files": [
8
+ "es"
9
+ ],
10
+ "scripts": {
11
+ "build": "father-build",
12
+ "deploy": "npm run docs:build && npm run docs:deploy",
13
+ "docs:build": "dumi build",
14
+ "docs:deploy": "gh-pages -d docs-dist",
15
+ "prepublishOnly": "npm run build",
16
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
17
+ "pub": "lerna publish",
18
+ "start": "dumi dev",
19
+ "test": "umi-test",
20
+ "test:coverage": "umi-test --coverage"
21
+ },
22
+ "lint-staged": {
23
+ "*.{js,jsx,less,md,json}": [
24
+ "prettier --write"
25
+ ],
26
+ "*.ts?(x)": [
27
+ "prettier --parser=typescript --write"
28
+ ]
29
+ },
30
+ "dependencies": {
31
+ "@ant-design/icons": "^4.7.0",
32
+ "@antv/x6": "^1.33.1",
33
+ "@antv/x6-react-components": "^1.1.15",
34
+ "@antv/x6-react-shape": "^1.6.1",
35
+ "react": "^16.12.0 || ^17.0.0"
36
+ },
37
+ "devDependencies": {
38
+ "@testing-library/jest-dom": "^5.15.1",
39
+ "@testing-library/react": "^12.1.2",
40
+ "@types/jest": "^27.0.3",
41
+ "@types/lodash": "^4.14.182",
42
+ "@umijs/fabric": "^2.8.1",
43
+ "@umijs/test": "^3.0.5",
44
+ "@zgfe/business-lib": "1.1.7-dmd.0",
45
+ "antd": "4.22.6",
46
+ "dumi": "^1.1.0",
47
+ "father-build": "^1.17.2",
48
+ "gh-pages": "^3.0.0",
49
+ "lerna": "^5.1.7",
50
+ "lint-staged": "^10.0.7",
51
+ "lodash": "^4.17.21",
52
+ "prettier": "^2.2.1",
53
+ "umi-request": "^1.4.0",
54
+ "yorkie": "^2.0.0"
55
+ },
56
+ "gitHead": "9320512c29932b5faeb56719862c27aa22a9e52c",
57
+ "gitHooks": {
58
+ "pre-commit": "lint-staged"
59
+ }
60
+ }