@zgfe/modules-dm 1.0.11 → 1.0.13
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.
- package/es/components/demo.js +0 -2
- package/es/constants/api.js +2 -2
- package/es/modules/dataCollection/collectionAttributeList.js +56 -93
- package/es/modules/dataCollection/collectionEventList.js +94 -167
- package/es/modules/dataCollection/index.js +21 -36
- package/es/modules/dataCollection/tablePlus.js +63 -111
- package/es/modules/dataManage/index.d.ts +5 -1
- package/es/modules/dataManage/index.js +15 -27
- package/es/modules/dataManage/styles/index.less +0 -15
- package/es/modules/dataPlan/addEventOrUser.js +31 -66
- package/es/modules/dataPlan/addPlan.js +121 -222
- package/es/modules/dataPlan/eventList.js +2 -4
- package/es/modules/dataPlan/index.js +41 -68
- package/es/modules/dataPlan/search.js +0 -4
- package/es/modules/dataPlan/tablePlus.js +2 -5
- package/es/modules/dataPlan/userAttributeList.js +2 -4
- package/es/store/action.js +0 -1
- package/es/store/index.js +9 -19
- package/es/types/flow.js +0 -15
- package/es/types.js +0 -23
- package/es/utils/ajax.js +0 -2
- package/es/utils/index.js +4 -12
- package/package.json +3 -7
package/es/components/demo.js
CHANGED
|
@@ -5,7 +5,6 @@ import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
|
|
|
5
5
|
import { DemoWrapper } from '@zgfe/business-lib';
|
|
6
6
|
import { ConfigProvider } from 'antd';
|
|
7
7
|
import zhCN from 'antd/es/locale/zh_CN';
|
|
8
|
-
|
|
9
8
|
var DemoWrapper2 = function DemoWrapper2(props) {
|
|
10
9
|
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
11
10
|
locale: zhCN
|
|
@@ -19,5 +18,4 @@ var DemoWrapper2 = function DemoWrapper2(props) {
|
|
|
19
18
|
needMeta: true
|
|
20
19
|
}, props.children)));
|
|
21
20
|
};
|
|
22
|
-
|
|
23
21
|
export default DemoWrapper2;
|
package/es/constants/api.js
CHANGED
|
@@ -47,12 +47,12 @@ var apis = {
|
|
|
47
47
|
queryControlSwitch: '/zg/web/v2/managementPlan/queryControlSwitch',
|
|
48
48
|
// 更新 埋点方案控制开关状态
|
|
49
49
|
updateControlSwitch: '/zg/web/v2/managementPlan/updateControlSwitch'
|
|
50
|
-
};
|
|
50
|
+
};
|
|
51
|
+
// for (const api in apis) {
|
|
51
52
|
// if (api != 'propUpload') {
|
|
52
53
|
// (apis as { [prop: string]: string })[api] = `/analysis/api/${
|
|
53
54
|
// (apis as { [prop: string]: string })[api]
|
|
54
55
|
// }`;
|
|
55
56
|
// }
|
|
56
57
|
// }
|
|
57
|
-
|
|
58
58
|
export default apis;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
-
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
13
|
import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
|
|
20
14
|
import { Input, Button, Select, Table, message, Modal, Upload, Popover } from 'antd';
|
|
21
15
|
import React, { useEffect, useState, useContext } from 'react';
|
|
@@ -24,44 +18,36 @@ import request from '../../utils/ajax';
|
|
|
24
18
|
import apis from '../../constants/api';
|
|
25
19
|
import { DmContext } from '../../store';
|
|
26
20
|
import { getAppID } from '../../utils';
|
|
27
|
-
|
|
28
21
|
var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
29
22
|
var classPrefix = 'attr-list';
|
|
30
|
-
|
|
31
23
|
var _useContext = useContext(BizGlobalDataContext),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
currentApp = _useContext.currentApp,
|
|
25
|
+
isDemo = _useContext.isDemo;
|
|
35
26
|
var isOpen = props.isOpen,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
queryPlanData = props.queryPlanData,
|
|
28
|
+
source = props.source,
|
|
29
|
+
eventAttrsData = props.eventAttrsData;
|
|
30
|
+
// 加载中
|
|
40
31
|
var _useState = useState(true),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
loading = _useState2[0],
|
|
34
|
+
setLoading = _useState2[1];
|
|
45
35
|
var _useContext2 = useContext(DmContext),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
state = _useContext2.state;
|
|
37
|
+
// 判断是否在方案中: 处理表格class添加异常样式 | 处理表格行异常信息展示, true异常
|
|
49
38
|
var rowRenderHandle = function rowRenderHandle(name) {
|
|
50
39
|
if (source == 'event' && eventAttrsData.owner == 'zg_abp') {
|
|
51
40
|
// 内置事件属性
|
|
52
41
|
return false;
|
|
53
42
|
}
|
|
54
|
-
|
|
55
43
|
if (source == 'user') {
|
|
56
44
|
var _queryPlanData$unexpe;
|
|
57
|
-
|
|
58
45
|
return (queryPlanData === null || queryPlanData === void 0 ? void 0 : (_queryPlanData$unexpe = queryPlanData.unexpectedPropList) === null || _queryPlanData$unexpe === void 0 ? void 0 : _queryPlanData$unexpe.indexOf(name)) != -1 && isOpen == 1 ? true : false;
|
|
59
46
|
} else {
|
|
60
47
|
if (isOpen != 1) {
|
|
61
48
|
return false;
|
|
62
49
|
} else {
|
|
63
50
|
var _temp2, _temp2$attrList;
|
|
64
|
-
|
|
65
51
|
var _temp = {};
|
|
66
52
|
queryPlanData.eventPlanAndRealDataDiff.map(function (item) {
|
|
67
53
|
if (item.eventName == (eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_name)) _temp = item;
|
|
@@ -69,14 +55,12 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
69
55
|
return Object.keys(_temp).length <= 0 ? true : ((_temp2 = _temp) === null || _temp2 === void 0 ? void 0 : (_temp2$attrList = _temp2.attrList) === null || _temp2$attrList === void 0 ? void 0 : _temp2$attrList.indexOf(name)) == -1 ? true : false;
|
|
70
56
|
}
|
|
71
57
|
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
};
|
|
59
|
+
// 用户属性列表
|
|
75
60
|
var _useState3 = useState([]),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
+
userAttrData = _useState4[0],
|
|
63
|
+
setUserAttrData = _useState4[1];
|
|
80
64
|
var queryUserPropMeta = function queryUserPropMeta() {
|
|
81
65
|
request(apis.getUserPropMeta, {
|
|
82
66
|
method: 'post',
|
|
@@ -95,7 +79,6 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
95
79
|
setLoading(false);
|
|
96
80
|
}).catch(function (err) {}).finally(function () {});
|
|
97
81
|
};
|
|
98
|
-
|
|
99
82
|
useEffect(function () {
|
|
100
83
|
// console.log('eventAttrsData', eventAttrsData);
|
|
101
84
|
if (source == 'user') {
|
|
@@ -106,33 +89,27 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
106
89
|
item.type = item.prop_type;
|
|
107
90
|
return item;
|
|
108
91
|
});
|
|
109
|
-
|
|
110
92
|
setUserAttrData(_temp);
|
|
111
93
|
setLoading(false);
|
|
112
94
|
}
|
|
113
|
-
}, [source, eventAttrsData]);
|
|
114
|
-
|
|
95
|
+
}, [source, eventAttrsData]);
|
|
96
|
+
// 复制属性名称
|
|
115
97
|
var copyAttrName = function copyAttrName(name) {
|
|
116
98
|
navigator.clipboard.writeText(name);
|
|
117
99
|
message.success('复制成功');
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
|
|
100
|
+
};
|
|
101
|
+
// 别名foucs
|
|
121
102
|
var _useState5 = useState(''),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
103
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
104
|
+
aliasFocusData = _useState6[0],
|
|
105
|
+
setAliasFocusData = _useState6[1];
|
|
126
106
|
var aliasFocus = function aliasFocus(e) {
|
|
127
107
|
setAliasFocusData(e.currentTarget.value);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
|
|
108
|
+
};
|
|
109
|
+
// 修改属性
|
|
131
110
|
var attrChangeHandle = function attrChangeHandle(value, record, type) {
|
|
132
111
|
var _params;
|
|
133
|
-
|
|
134
112
|
if (aliasFocusData == value && type == 'alias_name') return; // 失焦判断,内容无修改不请求接口
|
|
135
|
-
|
|
136
113
|
request(source == 'event' ? apis.updateEventAttr : apis.updateUserAttr, {
|
|
137
114
|
method: 'post',
|
|
138
115
|
params: (_params = {
|
|
@@ -142,19 +119,16 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
142
119
|
}).then(function (res) {
|
|
143
120
|
if (res) {
|
|
144
121
|
message.success('修改成功');
|
|
145
|
-
|
|
146
122
|
if (source == 'user') {
|
|
147
123
|
queryUserPropMeta();
|
|
148
124
|
} else {
|
|
149
125
|
props.Refresh();
|
|
150
126
|
}
|
|
151
|
-
|
|
152
127
|
state.updateEventMetas && state.updateEventMetas(); // 更新store
|
|
153
128
|
}
|
|
154
129
|
}).catch(function (err) {}).finally(function () {});
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
|
|
130
|
+
};
|
|
131
|
+
// 表格列
|
|
158
132
|
var columns = [{
|
|
159
133
|
title: '属性名称',
|
|
160
134
|
dataIndex: 'name',
|
|
@@ -231,7 +205,6 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
231
205
|
message.error('demo环境,无法编辑');
|
|
232
206
|
return;
|
|
233
207
|
}
|
|
234
|
-
|
|
235
208
|
setattrId(source == 'event' ? record.attr_id : record.id);
|
|
236
209
|
setAttrAliasNameShow(true);
|
|
237
210
|
}
|
|
@@ -322,8 +295,8 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
322
295
|
}]
|
|
323
296
|
}), rowRenderHandle(record.name) && /*#__PURE__*/React.createElement("div", null, json[record.encryption_type]));
|
|
324
297
|
}
|
|
325
|
-
}];
|
|
326
|
-
|
|
298
|
+
}];
|
|
299
|
+
// 属性值别名 - 表格列
|
|
327
300
|
var attrColumns = [{
|
|
328
301
|
title: '属性值',
|
|
329
302
|
dataIndex: 'original_value'
|
|
@@ -331,27 +304,22 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
331
304
|
title: '属性值别名',
|
|
332
305
|
dataIndex: 'mapping_value'
|
|
333
306
|
}];
|
|
334
|
-
|
|
335
307
|
var _useState7 = useState([]),
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
308
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
309
|
+
attrExcelData = _useState8[0],
|
|
310
|
+
setAttrExcelData = _useState8[1];
|
|
340
311
|
var _useState9 = useState(false),
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
312
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
313
|
+
attrAliasNameShow = _useState10[0],
|
|
314
|
+
setAttrAliasNameShow = _useState10[1];
|
|
345
315
|
var _useState11 = useState(0),
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
316
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
317
|
+
attrId = _useState12[0],
|
|
318
|
+
setattrId = _useState12[1];
|
|
350
319
|
var _useState13 = useState(0),
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
320
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
321
|
+
batchId = _useState14[0],
|
|
322
|
+
setBatchId = _useState14[1];
|
|
355
323
|
var uploadProps = {
|
|
356
324
|
maxCount: 1,
|
|
357
325
|
showUploadList: false,
|
|
@@ -375,19 +343,17 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
375
343
|
}).catch(function (err) {});
|
|
376
344
|
return false;
|
|
377
345
|
}
|
|
378
|
-
};
|
|
379
|
-
|
|
346
|
+
};
|
|
347
|
+
// 清空属性值别名excel数据
|
|
380
348
|
var _useState15 = useState(false),
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
349
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
350
|
+
clearFlag = _useState16[0],
|
|
351
|
+
setClearFlag = _useState16[1];
|
|
385
352
|
var clearData = function clearData() {
|
|
386
353
|
setAttrExcelData([]);
|
|
387
354
|
setClearFlag(true);
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
|
|
355
|
+
};
|
|
356
|
+
// 添加&修改用户属性值别名
|
|
391
357
|
var attrAliasNameEdit = function attrAliasNameEdit() {
|
|
392
358
|
request(apis.addPropDict, {
|
|
393
359
|
method: 'post',
|
|
@@ -405,9 +371,8 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
405
371
|
setAttrAliasNameShow(false);
|
|
406
372
|
}
|
|
407
373
|
}).catch(function (err) {});
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
|
|
374
|
+
};
|
|
375
|
+
// 获取已设置的属性值别名列表
|
|
411
376
|
var getAttrAliasList = function getAttrAliasList() {
|
|
412
377
|
request(apis.queryPropDict, {
|
|
413
378
|
method: 'post',
|
|
@@ -422,7 +387,6 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
422
387
|
}
|
|
423
388
|
});
|
|
424
389
|
};
|
|
425
|
-
|
|
426
390
|
useEffect(function () {
|
|
427
391
|
if (attrId) {
|
|
428
392
|
getAttrAliasList();
|
|
@@ -480,5 +444,4 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
480
444
|
pagination: false
|
|
481
445
|
})));
|
|
482
446
|
};
|
|
483
|
-
|
|
484
447
|
export default CollectionAttributeList;
|