@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/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # modules-cdp
2
+
3
+ ## Getting Started
4
+
5
+ Install dependencies,
6
+
7
+ ```bash
8
+ $ npm i
9
+ ```
10
+
11
+ Start the dev server,
12
+
13
+ ```bash
14
+ $ npm start
15
+ ```
16
+
17
+ Build documentation,
18
+
19
+ ```bash
20
+ $ npm run docs:build
21
+ ```
22
+
23
+ Run test,
24
+
25
+ ```bash
26
+ $ npm test
27
+ ```
28
+
29
+ Build library via `father-build`,
30
+
31
+ ```bash
32
+ $ npm run build
33
+ ```
34
+
35
+ =====
36
+
37
+ =====
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import 'antd/dist/antd.less';
3
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
4
+ import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
5
+ declare const DemoWrapper2: React.FC<{
6
+ children?: any;
7
+ }>;
8
+ export default DemoWrapper2;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import 'antd/dist/antd.less';
3
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
4
+ import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
5
+ import { DemoWrapper } from '@zgfe/business-lib';
6
+ import { ConfigProvider } from 'antd';
7
+ import zhCN from 'antd/es/locale/zh_CN';
8
+
9
+ var DemoWrapper2 = function DemoWrapper2(props) {
10
+ return /*#__PURE__*/React.createElement(ConfigProvider, {
11
+ locale: zhCN
12
+ }, /*#__PURE__*/React.createElement("div", {
13
+ style: {
14
+ background: '#F5F5F5',
15
+ padding: '24px',
16
+ height: 800
17
+ }
18
+ }, /*#__PURE__*/React.createElement(DemoWrapper, {
19
+ needMeta: true
20
+ }, props.children)));
21
+ };
22
+
23
+ export default DemoWrapper2;
@@ -0,0 +1,27 @@
1
+ declare let apis: {
2
+ queryCollectionEventList: string;
3
+ updateEventInfo: string;
4
+ upsertEventGroup: string;
5
+ deleteEventGroup: string;
6
+ deleteEventMeta: string;
7
+ updateEventAttr: string;
8
+ operateGroupRelations: string;
9
+ getUserPropMeta: string;
10
+ updateUserAttr: string;
11
+ propUpload: string;
12
+ queryPlan: string;
13
+ addPropDict: string;
14
+ queryPropDict: string;
15
+ getAllPlan: string;
16
+ queryPlanDetail: string;
17
+ savePlan: string;
18
+ deletePlan: string;
19
+ deletePlanEvent: string;
20
+ deletePlanProp: string;
21
+ uploadPlan: string;
22
+ downloadPlanEvent: string;
23
+ downloadPlanProp: string;
24
+ queryControlSwitch: string;
25
+ updateControlSwitch: string;
26
+ };
27
+ export default apis;
@@ -0,0 +1,58 @@
1
+ var apis = {
2
+ // 埋点管理 - 事件列表
3
+ queryCollectionEventList: '/analysis/api/common/proxy/data/queryEventMetasOfGroup.jsp',
4
+ // 埋点管理 - 事件列表 - 修改别名 | 修改显示状态 | 修改采集状态
5
+ updateEventInfo: '/analysis/api/common/proxy/data/updateEventInfo.jsp',
6
+ // 埋点管理 - 事件列表 - 创建分组 | 修改分组
7
+ upsertEventGroup: '/zg/web/v2/event/eventGroup/upsertEventGroup',
8
+ // 埋点管理 - 事件列表 - 删除分组
9
+ deleteEventGroup: '/zg/web/v2/event/eventGroup/deleteEventGroup',
10
+ // 埋点管理 - 事件列表 - 删除事件
11
+ deleteEventMeta: '/analysis/api/common/proxy/data/deleteEventMeta.jsp',
12
+ // 埋点管理 - 修改事件属性值状态
13
+ updateEventAttr: '/analysis/api/common/proxy/data/updateEventAttr.jsp',
14
+ // 埋点管理 - 移入到组、移出分组、复制到组
15
+ operateGroupRelations: '/zg/web/v2/event/eventGroup/operateGroupRelations',
16
+ // 用户属性列表 - 获取用户信息
17
+ getUserPropMeta: '/analysis/api/common/proxy/appusergroup/getUserPropMeta.jsp',
18
+ // 用户属性列表 - 修改:属性名别 | 数值类型 | 显示状态 | 加密类型
19
+ updateUserAttr: '/analysis/api/common/proxy/data/updateUserAttr.jsp',
20
+ // 用户属性文件上传
21
+ propUpload: '/user/propUpload.jsp',
22
+ // 埋点管理&埋点方案管理 基础数据
23
+ queryPlan: '/analysis/api/managementPlan/queryPlan',
24
+ // 添加&修改用户属性值别名
25
+ addPropDict: '/analysis/api/common/proxy/user/addPropDict.jsp',
26
+ // 获取已设置的属性值别名列表
27
+ queryPropDict: '/analysis/api/common/proxy/user/queryPropDict.jsp',
28
+ // 埋点方案管理-查询所有埋点方案
29
+ getAllPlan: '/zg/web/v2/managementPlan/getAllPlan',
30
+ // 埋点方案管理-查询埋点方案详情
31
+ queryPlanDetail: '/zg/web/v2/managementPlan/queryPlan',
32
+ // 埋点方案管理-保存
33
+ savePlan: '/zg/web/v2/managementPlan/savePlan',
34
+ // 埋点方案管理-删除埋点方案
35
+ deletePlan: '/zg/web/v2/managementPlan/deletePlan',
36
+ // 埋点方案管理-删除埋点事件
37
+ deletePlanEvent: '/zg/web/v2/managementPlan/deletePlanEvent',
38
+ // 埋点方案管理-删除埋点用户属性
39
+ deletePlanProp: '/zg/web/v2/managementPlan/deletePlanProp',
40
+ // 埋点方案管理-上传接口
41
+ uploadPlan: '/zg/web/v2/managementPlan/upload',
42
+ // 埋点方案管理-导出事件
43
+ downloadPlanEvent: '/zg/web/v2/managementPlan/downloadPlanEvent',
44
+ // 埋点方案管理-导出用户属性
45
+ downloadPlanProp: '/zg/web/v2/managementPlan/downloadPlanProp',
46
+ // 获取 埋点方案控制开关状态
47
+ queryControlSwitch: '/zg/web/v2/managementPlan/queryControlSwitch',
48
+ // 更新 埋点方案控制开关状态
49
+ updateControlSwitch: '/zg/web/v2/managementPlan/updateControlSwitch'
50
+ }; // for (const api in apis) {
51
+ // if (api != 'propUpload') {
52
+ // (apis as { [prop: string]: string })[api] = `/analysis/api/${
53
+ // (apis as { [prop: string]: string })[api]
54
+ // }`;
55
+ // }
56
+ // }
57
+
58
+ export default apis;
package/es/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import DataCollection from './modules/dataCollection';
3
+ import PlanList from './modules/dataPlan';
4
+ import DataManage from './modules/dataManage';
5
+ export { PlanList, DataCollection, DataManage };
package/es/index.js ADDED
@@ -0,0 +1,5 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import DataCollection from './modules/dataCollection';
3
+ import PlanList from './modules/dataPlan';
4
+ import DataManage from './modules/dataManage';
5
+ export { PlanList, DataCollection, DataManage };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './styles/index.less';
3
+ interface queryPlanType {
4
+ unexpectedPropList: string[];
5
+ unexpectedEventList: string[];
6
+ eventPlanAndRealDataDiff: string[];
7
+ }
8
+ interface PropsType {
9
+ source: 'event' | 'user';
10
+ eventAttrsData?: {
11
+ event_attrs: [];
12
+ event_id: number;
13
+ event_name: string;
14
+ };
15
+ isOpen: number;
16
+ queryPlanData: queryPlanType;
17
+ setEventAttrListShow?: Function;
18
+ }
19
+ declare const CollectionAttributeList: React.FC<PropsType>;
20
+ export default CollectionAttributeList;
@@ -0,0 +1,458 @@
1
+ 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
+ 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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ 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
+ 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 _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; }
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
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
20
+ import { Input, Button, Select, Table, message, Modal, Upload, Popover } from 'antd';
21
+ import React, { useEffect, useState, useContext } from 'react';
22
+ import './styles/index.less';
23
+ import request from '../../utils/ajax';
24
+ import apis from '../../constants/api';
25
+
26
+ var CollectionAttributeList = function CollectionAttributeList(props) {
27
+ var classPrefix = 'attr-list';
28
+
29
+ var _useContext = useContext(BizGlobalDataContext),
30
+ currentApp = _useContext.currentApp,
31
+ isDemo = _useContext.isDemo;
32
+
33
+ var isOpen = props.isOpen,
34
+ queryPlanData = props.queryPlanData,
35
+ source = props.source,
36
+ eventAttrsData = props.eventAttrsData; // 加载中
37
+
38
+ var _useState = useState(true),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ loading = _useState2[0],
41
+ setLoading = _useState2[1]; // 判断是否在方案中: 处理表格class添加异常样式 | 处理表格行异常信息展示,true异常
42
+
43
+
44
+ var rowRenderHandle = function rowRenderHandle(name) {
45
+ if (source == 'user') {
46
+ var _queryPlanData$unexpe;
47
+
48
+ 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;
49
+ } else {
50
+ var _temp2, _temp2$attrList;
51
+
52
+ var _temp = {};
53
+ queryPlanData.eventPlanAndRealDataDiff.map(function (item) {
54
+ if (item.eventName == (eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_name)) _temp = item;
55
+ });
56
+ 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 && isOpen == 1 ? true : false;
57
+ }
58
+ }; // 用户属性列表
59
+
60
+
61
+ var _useState3 = useState([]),
62
+ _useState4 = _slicedToArray(_useState3, 2),
63
+ userAttrData = _useState4[0],
64
+ setUserAttrData = _useState4[1];
65
+
66
+ var queryUserPropMeta = function queryUserPropMeta() {
67
+ request(apis.getUserPropMeta, {
68
+ method: 'post',
69
+ params: {
70
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
71
+ platform: 0
72
+ }
73
+ }).then(function (res) {
74
+ if (!res) throw new Error();
75
+ var afterData = res.user_data.filter(function (item) {
76
+ if (item.dimension_sub == 'user_attr') {
77
+ return item;
78
+ }
79
+ });
80
+ setUserAttrData(afterData);
81
+ setLoading(false);
82
+ }).catch(function (err) {
83
+ console.error('查询列表失败', err);
84
+ }).finally(function () {});
85
+ };
86
+
87
+ useEffect(function () {
88
+ if (source == 'user') {
89
+ queryUserPropMeta();
90
+ } else {
91
+ var _temp = eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_attrs.map(function (item) {
92
+ item.name = item.attr_name;
93
+ item.type = item.prop_type;
94
+ return item;
95
+ });
96
+
97
+ setUserAttrData(_temp);
98
+ setLoading(false);
99
+ }
100
+ }, [source]); // 方案名称
101
+
102
+ var _useState5 = useState(''),
103
+ _useState6 = _slicedToArray(_useState5, 2),
104
+ planName = _useState6[0],
105
+ setPlanName = _useState6[1];
106
+
107
+ var PlanNameChange = function PlanNameChange(e) {
108
+ setPlanName(e.currentTarget.value);
109
+ }; // 复制属性名称
110
+
111
+
112
+ var copyAttrName = function copyAttrName(name) {
113
+ navigator.clipboard.writeText(name);
114
+ message.success('复制成功');
115
+ }; // 别名foucs
116
+
117
+
118
+ var _useState7 = useState(''),
119
+ _useState8 = _slicedToArray(_useState7, 2),
120
+ aliasFocusData = _useState8[0],
121
+ setAliasFocusData = _useState8[1];
122
+
123
+ var aliasFocus = function aliasFocus(e) {
124
+ setAliasFocusData(e.currentTarget.value);
125
+ }; // 修改属性
126
+
127
+
128
+ var attrChangeHandle = function attrChangeHandle(value, record, type) {
129
+ var _params;
130
+
131
+ if (aliasFocusData == value && type == 'alias_name') return; // 失焦判断,内容无修改不请求接口
132
+
133
+ request(source == 'event' ? apis.updateEventAttr : apis.updateUserAttr, {
134
+ method: 'post',
135
+ params: (_params = {
136
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
137
+ attr_id: source == 'event' ? record.attr_id : record.id
138
+ }, _defineProperty(_params, type, value), _defineProperty(_params, "event_id", source == 'event' ? eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_id : null), _params)
139
+ }).then(function (res) {
140
+ if (res) {
141
+ message.success('修改成功');
142
+ }
143
+ }).catch(function (err) {
144
+ message.success('修改失败');
145
+ }).finally(function () {});
146
+ }; // 表格列
147
+
148
+
149
+ var columns = [{
150
+ title: '属性名称',
151
+ dataIndex: 'name',
152
+ width: 200,
153
+ render: function render(text, record, index) {
154
+ return /*#__PURE__*/React.createElement("div", {
155
+ className: "attr-name"
156
+ }, rowRenderHandle(record.name) && /*#__PURE__*/React.createElement(Popover, {
157
+ content: /*#__PURE__*/React.createElement("div", {
158
+ style: {
159
+ color: 'red'
160
+ }
161
+ }, "\u4E0D\u5728\u65B9\u6848\u4E2D")
162
+ }, /*#__PURE__*/React.createElement(IconFont, {
163
+ type: "tishiicon"
164
+ })), /*#__PURE__*/React.createElement(Popover, {
165
+ content: text
166
+ }, /*#__PURE__*/React.createElement("span", {
167
+ className: "attr-name-text"
168
+ }, text)), /*#__PURE__*/React.createElement(IconFont, {
169
+ onClick: function onClick() {
170
+ return copyAttrName(record.name);
171
+ },
172
+ type: "fuzhi"
173
+ }));
174
+ }
175
+ }, {
176
+ title: '别名',
177
+ dataIndex: 'alias_name',
178
+ width: 180,
179
+ render: function render(text, record, index) {
180
+ return /*#__PURE__*/React.createElement(Input, {
181
+ className: "alias_name",
182
+ placeholder: "\u7F16\u8F91\u522B\u540D",
183
+ defaultValue: record.alias_name,
184
+ onFocus: aliasFocus,
185
+ onBlur: function onBlur(e) {
186
+ attrChangeHandle(e.currentTarget.value, record, 'alias_name');
187
+ }
188
+ });
189
+ }
190
+ }, {
191
+ title: '属性值别名',
192
+ dataIndex: 'attr_alias_name',
193
+ width: 120,
194
+ render: function render(text, record, index) {
195
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !rowRenderHandle(record.name) && /*#__PURE__*/React.createElement("span", {
196
+ className: "attr_alias_name",
197
+ onClick: function onClick() {
198
+ setattrId(source == 'event' ? record.attr_id : record.id);
199
+ setAttrAliasNameShow(true);
200
+ }
201
+ }, "\u7F16\u8F91"));
202
+ }
203
+ }, {
204
+ title: '属性类型',
205
+ dataIndex: 'type',
206
+ width: 120,
207
+ render: function render(text, record, index) {
208
+ var json = {
209
+ 1: '字符串',
210
+ 2: '数值',
211
+ 3: '日期'
212
+ };
213
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !rowRenderHandle(record.name) && /*#__PURE__*/React.createElement(Select, {
214
+ defaultValue: record.type,
215
+ style: {
216
+ width: '100%'
217
+ },
218
+ onChange: function onChange(e) {
219
+ return attrChangeHandle(e, record, 'type');
220
+ },
221
+ options: [{
222
+ value: 1,
223
+ label: '字符串'
224
+ }, {
225
+ value: 2,
226
+ label: '数值'
227
+ }, {
228
+ value: 3,
229
+ label: '日期'
230
+ }]
231
+ }), rowRenderHandle(record.name) && /*#__PURE__*/React.createElement("div", null, json[record.type]));
232
+ }
233
+ }, {
234
+ title: '显示状态',
235
+ dataIndex: 'hidden',
236
+ width: 120,
237
+ render: function render(text, record, index) {
238
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !rowRenderHandle(record.name) && /*#__PURE__*/React.createElement(Select, {
239
+ defaultValue: record.hidden,
240
+ style: {
241
+ width: '100%'
242
+ },
243
+ onChange: function onChange(e) {
244
+ return attrChangeHandle(e, record, 'hidden');
245
+ },
246
+ options: [{
247
+ value: 1,
248
+ label: '隐藏'
249
+ }, {
250
+ value: 0,
251
+ label: '显示'
252
+ }]
253
+ }), rowRenderHandle(record.name) && /*#__PURE__*/React.createElement("div", null, record.hidden == 1 ? '隐藏' : '显示'));
254
+ }
255
+ }, {
256
+ title: '加密',
257
+ dataIndex: 'encryption_type',
258
+ width: 120,
259
+ render: function render(text, record, index) {
260
+ var json = {
261
+ 0: '不加密',
262
+ 1: '半加密',
263
+ 2: '全加密'
264
+ };
265
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !rowRenderHandle(record.name) && /*#__PURE__*/React.createElement(Select, {
266
+ defaultValue: record.encryption_type,
267
+ style: {
268
+ width: '100%'
269
+ },
270
+ onChange: function onChange(e) {
271
+ return attrChangeHandle(e, record, 'encryption_type');
272
+ },
273
+ options: [{
274
+ value: 0,
275
+ label: '不加密'
276
+ }, {
277
+ value: 1,
278
+ label: '半加密'
279
+ }, {
280
+ value: 2,
281
+ label: '全加密'
282
+ }]
283
+ }), rowRenderHandle(record.name) && /*#__PURE__*/React.createElement("div", null, json[record.encryption_type]));
284
+ }
285
+ }]; // 属性值别名 - 表格列
286
+
287
+ var attrColumns = [{
288
+ title: '属性值',
289
+ dataIndex: 'original_value'
290
+ }, {
291
+ title: '属性值别名',
292
+ dataIndex: 'mapping_value'
293
+ }];
294
+
295
+ var _useState9 = useState([]),
296
+ _useState10 = _slicedToArray(_useState9, 2),
297
+ attrExcelData = _useState10[0],
298
+ setAttrExcelData = _useState10[1];
299
+
300
+ var _useState11 = useState(false),
301
+ _useState12 = _slicedToArray(_useState11, 2),
302
+ attrAliasNameShow = _useState12[0],
303
+ setAttrAliasNameShow = _useState12[1];
304
+
305
+ var _useState13 = useState(0),
306
+ _useState14 = _slicedToArray(_useState13, 2),
307
+ attrId = _useState14[0],
308
+ setattrId = _useState14[1];
309
+
310
+ var _useState15 = useState(0),
311
+ _useState16 = _slicedToArray(_useState15, 2),
312
+ batchId = _useState16[0],
313
+ setBatchId = _useState16[1];
314
+
315
+ var uploadProps = {
316
+ maxCount: 1,
317
+ showUploadList: false,
318
+ beforeUpload: function beforeUpload(file) {
319
+ var formData = new FormData();
320
+ formData.append('file', file, file.name);
321
+ var data = new FormData();
322
+ data.append('upload', file);
323
+ data.append('attr_id', attrId);
324
+ data.append('app_id', currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId);
325
+ source == 'event' ? data.append('event_id', eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_id) : null;
326
+ request(apis.propUpload, {
327
+ method: 'post',
328
+ data: data
329
+ }).then(function (res) {
330
+ if (res) {
331
+ message.success('上传成功');
332
+ setBatchId(res.batch_id);
333
+ setAttrExcelData(res.values);
334
+ }
335
+ }).catch(function (err) {
336
+ message.success('上传失败');
337
+ });
338
+ }
339
+ }; // 清空属性值别名excel数据
340
+
341
+ var _useState17 = useState(false),
342
+ _useState18 = _slicedToArray(_useState17, 2),
343
+ clearFlag = _useState18[0],
344
+ setClearFlag = _useState18[1];
345
+
346
+ var clearData = function clearData() {
347
+ setAttrExcelData([]);
348
+ setClearFlag(true);
349
+ }; // 添加&修改用户属性值别名
350
+
351
+
352
+ var attrAliasNameEdit = function attrAliasNameEdit() {
353
+ request(apis.addPropDict, {
354
+ method: 'post',
355
+ params: {
356
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
357
+ attr_id: attrId,
358
+ batch_id: batchId,
359
+ event_id: source == 'event' ? eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_id : null,
360
+ status: 'ok',
361
+ clear: clearFlag
362
+ }
363
+ }).then(function (res) {
364
+ if (res) {
365
+ message.success('操作成功');
366
+ setAttrAliasNameShow(false);
367
+ }
368
+ }).catch(function (err) {
369
+ message.success('操作失败');
370
+ });
371
+ }; // 获取已设置的属性值别名列表
372
+
373
+
374
+ var getAttrAliasList = function getAttrAliasList() {
375
+ request(apis.queryPropDict, {
376
+ method: 'post',
377
+ params: {
378
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
379
+ attr_id: attrId,
380
+ event_id: source == 'event' ? eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_id : null
381
+ }
382
+ }).then(function (res) {
383
+ if (res) {
384
+ setAttrExcelData(res.values);
385
+ }
386
+ });
387
+ };
388
+
389
+ useEffect(function () {
390
+ if (attrId) {
391
+ getAttrAliasList();
392
+ }
393
+ }, [attrId]);
394
+ return /*#__PURE__*/React.createElement("div", {
395
+ className: classPrefix
396
+ }, source == 'event' && /*#__PURE__*/React.createElement("div", {
397
+ className: "".concat(classPrefix, "-back"),
398
+ onClick: function onClick() {
399
+ return props.setEventAttrListShow(false);
400
+ }
401
+ }, /*#__PURE__*/React.createElement(IconFont, {
402
+ type: "fanhuiicon"
403
+ }), "\u8FD4\u56DE"), /*#__PURE__*/React.createElement(Table, {
404
+ className: "".concat(classPrefix, "-table"),
405
+ columns: columns,
406
+ rowKey: "name",
407
+ loading: loading,
408
+ scroll: {
409
+ y: 550
410
+ },
411
+ rowClassName: function rowClassName(record, index) {
412
+ return rowRenderHandle(record.name) ? 'error-row' : '';
413
+ },
414
+ dataSource: userAttrData,
415
+ bordered: true,
416
+ pagination: false
417
+ }), /*#__PURE__*/React.createElement(Modal, {
418
+ title: "\u5C5E\u6027\u503C\u522B\u540D",
419
+ getContainer: false,
420
+ visible: attrAliasNameShow,
421
+ onOk: attrAliasNameEdit,
422
+ onCancel: function onCancel() {
423
+ return setAttrAliasNameShow(false);
424
+ }
425
+ }, /*#__PURE__*/React.createElement("div", {
426
+ className: "button-box"
427
+ }, /*#__PURE__*/React.createElement(Upload, _objectSpread({}, uploadProps), /*#__PURE__*/React.createElement(Button, {
428
+ type: "primary",
429
+ size: "small",
430
+ icon: /*#__PURE__*/React.createElement(IconFont, {
431
+ type: "daochu1"
432
+ })
433
+ }, "\u4E0A\u4F20 excel \u6587\u4EF6")), /*#__PURE__*/React.createElement(Button, {
434
+ icon: /*#__PURE__*/React.createElement(IconFont, {
435
+ type: "xiazai1"
436
+ }),
437
+ type: "primary",
438
+ size: "small",
439
+ onClick: function onClick() {
440
+ return window.location.href = "/analysis/api/utm/template?fileName=".concat(source == 'user' ? '用户' : '事件', "\u5C5E\u6027\u503C\u6A21\u677F.xlsx");
441
+ }
442
+ }, "\u6A21\u677F\u4E0B\u8F7D")), attrExcelData.length > 0 && /*#__PURE__*/React.createElement("div", {
443
+ className: "clearData",
444
+ onClick: clearData
445
+ }, /*#__PURE__*/React.createElement(IconFont, {
446
+ type: "qingchu"
447
+ }), "\u6E05\u7A7A\u6570\u636E"), /*#__PURE__*/React.createElement(Table, {
448
+ scroll: {
449
+ y: 200
450
+ },
451
+ columns: attrColumns,
452
+ dataSource: attrExcelData,
453
+ bordered: true,
454
+ pagination: false
455
+ })));
456
+ };
457
+
458
+ export default CollectionAttributeList;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './styles/index.less';
3
+ interface queryPlanType {
4
+ unexpectedPropList: string[];
5
+ unexpectedEventList: string[];
6
+ eventPlanAndRealDataDiff: string[];
7
+ }
8
+ interface PropsType {
9
+ isOpen: number;
10
+ queryPlanData: queryPlanType;
11
+ }
12
+ declare const CollectionEventList: React.FC<PropsType>;
13
+ export default CollectionEventList;