@zgfe/modules-dm 1.0.2-dm.1 → 1.0.2-dm.11
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/modules/dataCollection/collectionAttributeList.js +38 -43
- package/es/modules/dataCollection/collectionEventList.js +15 -4
- package/es/modules/dataCollection/index.d.ts +3 -1
- package/es/modules/dataCollection/index.js +2 -1
- package/es/modules/dataCollection/styles/index.less +26 -8
- package/es/modules/dataCollection/tablePlus.js +40 -19
- package/es/modules/dataManage/index.d.ts +4 -1
- package/es/modules/dataManage/index.js +28 -4
- package/es/modules/dataPlan/addEventOrUser.js +13 -11
- package/es/modules/dataPlan/addPlan.d.ts +1 -0
- package/es/modules/dataPlan/addPlan.js +174 -89
- package/es/modules/dataPlan/index.js +6 -1
- package/es/modules/dataPlan/styles/index.less +5 -0
- package/es/store/action.d.ts +7 -0
- package/es/store/action.js +5 -0
- package/es/store/index.d.ts +8 -0
- package/es/store/index.js +42 -0
- package/es/store/state.d.ts +4 -0
- package/es/store/state.js +6 -0
- package/package.json +2 -2
|
@@ -38,7 +38,7 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
38
38
|
var _useState = useState(true),
|
|
39
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
40
|
loading = _useState2[0],
|
|
41
|
-
setLoading = _useState2[1]; // 判断是否在方案中: 处理表格class添加异常样式 | 处理表格行异常信息展示,true异常
|
|
41
|
+
setLoading = _useState2[1]; // 判断是否在方案中: 处理表格class添加异常样式 | 处理表格行异常信息展示, true异常
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
var rowRenderHandle = function rowRenderHandle(name) {
|
|
@@ -47,13 +47,17 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
47
47
|
|
|
48
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
49
|
} else {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
if (isOpen != 1) {
|
|
51
|
+
return false;
|
|
52
|
+
} else {
|
|
53
|
+
var _temp2, _temp2$attrList;
|
|
54
|
+
|
|
55
|
+
var _temp = {};
|
|
56
|
+
queryPlanData.eventPlanAndRealDataDiff.map(function (item) {
|
|
57
|
+
if (item.eventName == (eventAttrsData === null || eventAttrsData === void 0 ? void 0 : eventAttrsData.event_name)) _temp = item;
|
|
58
|
+
});
|
|
59
|
+
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;
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
62
|
}; // 用户属性列表
|
|
59
63
|
|
|
@@ -97,17 +101,7 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
97
101
|
setUserAttrData(_temp);
|
|
98
102
|
setLoading(false);
|
|
99
103
|
}
|
|
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
|
-
|
|
104
|
+
}, [source]); // 复制属性名称
|
|
111
105
|
|
|
112
106
|
var copyAttrName = function copyAttrName(name) {
|
|
113
107
|
navigator.clipboard.writeText(name);
|
|
@@ -115,10 +109,10 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
115
109
|
}; // 别名foucs
|
|
116
110
|
|
|
117
111
|
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
aliasFocusData =
|
|
121
|
-
setAliasFocusData =
|
|
112
|
+
var _useState5 = useState(''),
|
|
113
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
114
|
+
aliasFocusData = _useState6[0],
|
|
115
|
+
setAliasFocusData = _useState6[1];
|
|
122
116
|
|
|
123
117
|
var aliasFocus = function aliasFocus(e) {
|
|
124
118
|
setAliasFocusData(e.currentTarget.value);
|
|
@@ -141,7 +135,7 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
141
135
|
message.success('修改成功');
|
|
142
136
|
}
|
|
143
137
|
}).catch(function (err) {
|
|
144
|
-
message.
|
|
138
|
+
message.error('修改失败');
|
|
145
139
|
}).finally(function () {});
|
|
146
140
|
}; // 表格列
|
|
147
141
|
|
|
@@ -292,25 +286,25 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
292
286
|
dataIndex: 'mapping_value'
|
|
293
287
|
}];
|
|
294
288
|
|
|
295
|
-
var
|
|
289
|
+
var _useState7 = useState([]),
|
|
290
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
291
|
+
attrExcelData = _useState8[0],
|
|
292
|
+
setAttrExcelData = _useState8[1];
|
|
293
|
+
|
|
294
|
+
var _useState9 = useState(false),
|
|
296
295
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
attrAliasNameShow = _useState10[0],
|
|
297
|
+
setAttrAliasNameShow = _useState10[1];
|
|
299
298
|
|
|
300
|
-
var _useState11 = useState(
|
|
299
|
+
var _useState11 = useState(0),
|
|
301
300
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
attrId = _useState12[0],
|
|
302
|
+
setattrId = _useState12[1];
|
|
304
303
|
|
|
305
304
|
var _useState13 = useState(0),
|
|
306
305
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
var _useState15 = useState(0),
|
|
311
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
312
|
-
batchId = _useState16[0],
|
|
313
|
-
setBatchId = _useState16[1];
|
|
306
|
+
batchId = _useState14[0],
|
|
307
|
+
setBatchId = _useState14[1];
|
|
314
308
|
|
|
315
309
|
var uploadProps = {
|
|
316
310
|
maxCount: 1,
|
|
@@ -333,15 +327,16 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
333
327
|
setAttrExcelData(res.values);
|
|
334
328
|
}
|
|
335
329
|
}).catch(function (err) {
|
|
336
|
-
message.
|
|
330
|
+
message.error('上传失败');
|
|
337
331
|
});
|
|
332
|
+
return false;
|
|
338
333
|
}
|
|
339
334
|
}; // 清空属性值别名excel数据
|
|
340
335
|
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
clearFlag =
|
|
344
|
-
setClearFlag =
|
|
336
|
+
var _useState15 = useState(false),
|
|
337
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
338
|
+
clearFlag = _useState16[0],
|
|
339
|
+
setClearFlag = _useState16[1];
|
|
345
340
|
|
|
346
341
|
var clearData = function clearData() {
|
|
347
342
|
setAttrExcelData([]);
|
|
@@ -366,7 +361,7 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
|
|
|
366
361
|
setAttrAliasNameShow(false);
|
|
367
362
|
}
|
|
368
363
|
}).catch(function (err) {
|
|
369
|
-
message.
|
|
364
|
+
message.error('操作失败');
|
|
370
365
|
});
|
|
371
366
|
}; // 获取已设置的属性值别名列表
|
|
372
367
|
|
|
@@ -24,7 +24,8 @@ var CollectionEventList = function CollectionEventList(props) {
|
|
|
24
24
|
|
|
25
25
|
var _useContext = useContext(BizGlobalDataContext),
|
|
26
26
|
currentApp = _useContext.currentApp,
|
|
27
|
-
isDemo = _useContext.isDemo;
|
|
27
|
+
isDemo = _useContext.isDemo; // const { updateEventMetas } = props;
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
var _useState = useState(0),
|
|
30
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -150,6 +151,11 @@ var CollectionEventList = function CollectionEventList(props) {
|
|
|
150
151
|
|
|
151
152
|
|
|
152
153
|
var createEventGroup = function createEventGroup() {
|
|
154
|
+
if (eventNameInput == '') {
|
|
155
|
+
message.error('请输入分组名称');
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
153
159
|
if (eventNameInput.length > 20) {
|
|
154
160
|
message.error('名称不可超过20字符');
|
|
155
161
|
return;
|
|
@@ -169,8 +175,10 @@ var CollectionEventList = function CollectionEventList(props) {
|
|
|
169
175
|
queryList();
|
|
170
176
|
}
|
|
171
177
|
}).catch(function (err) {
|
|
172
|
-
message.
|
|
173
|
-
}).finally(function () {
|
|
178
|
+
message.error('创建失败');
|
|
179
|
+
}).finally(function () {
|
|
180
|
+
setEventNameInput('');
|
|
181
|
+
});
|
|
174
182
|
}; // 筛选:显示状态 | 采集状态
|
|
175
183
|
|
|
176
184
|
|
|
@@ -306,13 +314,16 @@ var CollectionEventList = function CollectionEventList(props) {
|
|
|
306
314
|
setEventAttrListShow: setEventAttrListShow
|
|
307
315
|
}), /*#__PURE__*/React.createElement(Modal, {
|
|
308
316
|
title: "\u521B\u5EFA\u5206\u7EC4",
|
|
317
|
+
destroyOnClose: true,
|
|
309
318
|
visible: eventNameShow,
|
|
310
319
|
onOk: createEventGroup,
|
|
311
320
|
onCancel: function onCancel() {
|
|
312
|
-
|
|
321
|
+
setEventNameShow(false);
|
|
322
|
+
setEventNameInput('');
|
|
313
323
|
}
|
|
314
324
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
315
325
|
placeholder: "\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",
|
|
326
|
+
value: eventNameInput,
|
|
316
327
|
onChange: function onChange(e) {
|
|
317
328
|
return setEventNameInput(e.currentTarget.value);
|
|
318
329
|
}
|
|
@@ -23,7 +23,8 @@ var DataCollection = function DataCollection(props) {
|
|
|
23
23
|
|
|
24
24
|
var _useContext = useContext(BizGlobalDataContext),
|
|
25
25
|
currentApp = _useContext.currentApp,
|
|
26
|
-
isDemo = _useContext.isDemo;
|
|
26
|
+
isDemo = _useContext.isDemo; // const { updateEventMetas } = props;
|
|
27
|
+
|
|
27
28
|
|
|
28
29
|
var _useState = useState(1),
|
|
29
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -81,6 +81,11 @@
|
|
|
81
81
|
display: inline-block !important;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
.alias_name_popover {
|
|
85
|
+
width: 200px;
|
|
86
|
+
word-break: break-all;
|
|
87
|
+
background: red;
|
|
88
|
+
}
|
|
84
89
|
.alias_name {
|
|
85
90
|
background: #fff !important;
|
|
86
91
|
border: none;
|
|
@@ -94,6 +99,16 @@
|
|
|
94
99
|
}
|
|
95
100
|
.group-row {
|
|
96
101
|
border-top: 12px solid #f5f5f5;
|
|
102
|
+
.ant-table-cell-fix-left {
|
|
103
|
+
left: 0px;
|
|
104
|
+
display: block;
|
|
105
|
+
width: 500px;
|
|
106
|
+
background: #fff;
|
|
107
|
+
}
|
|
108
|
+
.ant-table-cell-fix-left-first::after,
|
|
109
|
+
.ant-table-cell-fix-left-last::after {
|
|
110
|
+
box-shadow: none;
|
|
111
|
+
}
|
|
97
112
|
td {
|
|
98
113
|
padding: 6px 16px;
|
|
99
114
|
}
|
|
@@ -106,7 +121,7 @@
|
|
|
106
121
|
}
|
|
107
122
|
.group-box {
|
|
108
123
|
display: flex;
|
|
109
|
-
width:
|
|
124
|
+
width: 800px;
|
|
110
125
|
line-height: 30px;
|
|
111
126
|
.ant-input {
|
|
112
127
|
width: 150px;
|
|
@@ -116,13 +131,13 @@
|
|
|
116
131
|
margin-right: 4px;
|
|
117
132
|
font-size: 18px !important;
|
|
118
133
|
}
|
|
119
|
-
.group-text {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
134
|
+
// .group-text {
|
|
135
|
+
// display: -webkit-box;
|
|
136
|
+
// width: 120px;
|
|
137
|
+
// overflow: hidden;
|
|
138
|
+
// -webkit-box-orient: vertical;
|
|
139
|
+
// -webkit-line-clamp: 1;
|
|
140
|
+
// }
|
|
126
141
|
.group-handle {
|
|
127
142
|
margin-left: 30px;
|
|
128
143
|
cursor: pointer;
|
|
@@ -204,6 +219,9 @@
|
|
|
204
219
|
cursor: pointer;
|
|
205
220
|
user-select: none;
|
|
206
221
|
}
|
|
222
|
+
.set-error {
|
|
223
|
+
color: #86909c;
|
|
224
|
+
}
|
|
207
225
|
}
|
|
208
226
|
}
|
|
209
227
|
}
|
|
@@ -24,6 +24,7 @@ var Option = Select.Option;
|
|
|
24
24
|
import React, { useState, useContext } from 'react';
|
|
25
25
|
import './styles/index.less';
|
|
26
26
|
import _ from 'lodash';
|
|
27
|
+
import { DmContext } from '../../store';
|
|
27
28
|
|
|
28
29
|
var TablePlus = function TablePlus(props) {
|
|
29
30
|
var classPrefix = 'table-plus';
|
|
@@ -33,7 +34,10 @@ var TablePlus = function TablePlus(props) {
|
|
|
33
34
|
|
|
34
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
35
36
|
currentApp = _useContext.currentApp,
|
|
36
|
-
isDemo = _useContext.isDemo;
|
|
37
|
+
isDemo = _useContext.isDemo;
|
|
38
|
+
|
|
39
|
+
var _useContext2 = useContext(DmContext),
|
|
40
|
+
state = _useContext2.state; // 别名foucs
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
var _useState = useState(''),
|
|
@@ -58,11 +62,16 @@ var TablePlus = function TablePlus(props) {
|
|
|
58
62
|
}
|
|
59
63
|
}).then(function (res) {
|
|
60
64
|
if (res) {
|
|
61
|
-
message.success('修改成功');
|
|
65
|
+
message.success('修改成功'); // props.Refresh();
|
|
66
|
+
|
|
67
|
+
console.log(state.updateEventMetas);
|
|
68
|
+
state.updateEventMetas ? state.updateEventMetas() : props.Refresh(); // 更新store
|
|
62
69
|
}
|
|
63
70
|
}).catch(function (err) {
|
|
64
|
-
message.
|
|
65
|
-
}).finally(function () {
|
|
71
|
+
message.error('修改失败');
|
|
72
|
+
}).finally(function () {
|
|
73
|
+
setAliasFocusData('');
|
|
74
|
+
});
|
|
66
75
|
}; // 表格class处理
|
|
67
76
|
|
|
68
77
|
|
|
@@ -110,7 +119,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
110
119
|
props.Refresh();
|
|
111
120
|
}
|
|
112
121
|
}).catch(function (err) {
|
|
113
|
-
message.
|
|
122
|
+
message.error('修改失败');
|
|
114
123
|
}).finally(function () {});
|
|
115
124
|
}; // 删除分组
|
|
116
125
|
|
|
@@ -140,7 +149,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
140
149
|
props.Refresh();
|
|
141
150
|
}
|
|
142
151
|
}).catch(function (err) {
|
|
143
|
-
message.
|
|
152
|
+
message.error('删除失败');
|
|
144
153
|
}).finally(function () {});
|
|
145
154
|
}
|
|
146
155
|
});
|
|
@@ -168,7 +177,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
168
177
|
props.Refresh();
|
|
169
178
|
}
|
|
170
179
|
}).catch(function (err) {
|
|
171
|
-
message.
|
|
180
|
+
message.error('删除失败');
|
|
172
181
|
}).finally(function () {});
|
|
173
182
|
}
|
|
174
183
|
});
|
|
@@ -205,12 +214,10 @@ var TablePlus = function TablePlus(props) {
|
|
|
205
214
|
event_id: event_id
|
|
206
215
|
}, _temp)
|
|
207
216
|
}).then(function (res) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
props.Refresh();
|
|
211
|
-
}
|
|
217
|
+
message.success('修改成功');
|
|
218
|
+
state.updateEventMetas ? state.updateEventMetas() : props.Refresh(); // 更新store
|
|
212
219
|
}).catch(function (err) {
|
|
213
|
-
message.
|
|
220
|
+
message.error('修改失败');
|
|
214
221
|
}).finally(function () {});
|
|
215
222
|
}; // 复制事件名称
|
|
216
223
|
|
|
@@ -269,14 +276,16 @@ var TablePlus = function TablePlus(props) {
|
|
|
269
276
|
if (eventGroupId != undefined) _temp = {
|
|
270
277
|
eventGroupId: eventGroupId
|
|
271
278
|
};
|
|
279
|
+
if (type != 'copy') _temp = _objectSpread(_objectSpread({}, _temp), {}, {
|
|
280
|
+
oldEventGroupId: data.groupId
|
|
281
|
+
});
|
|
272
282
|
request(apis.operateGroupRelations, {
|
|
273
283
|
method: 'post',
|
|
274
284
|
data: _objectSpread({
|
|
275
285
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
276
286
|
platform: 0,
|
|
277
287
|
hasPublicAttrView: true,
|
|
278
|
-
eventIds: groupCheckedData[data.groupId].join(',')
|
|
279
|
-
oldEventGroupId: data.groupId
|
|
288
|
+
eventIds: groupCheckedData[data.groupId].join(',')
|
|
280
289
|
}, _temp)
|
|
281
290
|
}).then(function (res) {
|
|
282
291
|
message.success('成功');
|
|
@@ -286,7 +295,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
286
295
|
delete _groupCheckedData[eventGroupId];
|
|
287
296
|
setGroupCheckedData({});
|
|
288
297
|
}).catch(function (err) {
|
|
289
|
-
message.
|
|
298
|
+
message.error('失败');
|
|
290
299
|
}).finally(function () {
|
|
291
300
|
props.Refresh();
|
|
292
301
|
});
|
|
@@ -401,7 +410,16 @@ var TablePlus = function TablePlus(props) {
|
|
|
401
410
|
key: 'alias_name',
|
|
402
411
|
width: 167,
|
|
403
412
|
render: function render(text, record, index) {
|
|
404
|
-
return /*#__PURE__*/React.createElement(
|
|
413
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
414
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
415
|
+
style: {
|
|
416
|
+
width: '200px',
|
|
417
|
+
wordBreak: 'break-all'
|
|
418
|
+
}
|
|
419
|
+
}, record.alias_name),
|
|
420
|
+
trigger: "hover",
|
|
421
|
+
placement: "top"
|
|
422
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
405
423
|
className: "alias_name",
|
|
406
424
|
placeholder: "\u7F16\u8F91\u522B\u540D",
|
|
407
425
|
defaultValue: record.alias_name,
|
|
@@ -409,7 +427,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
409
427
|
onBlur: function onBlur(e) {
|
|
410
428
|
aliasNameBlur(e, record);
|
|
411
429
|
}
|
|
412
|
-
});
|
|
430
|
+
}));
|
|
413
431
|
}
|
|
414
432
|
}, {
|
|
415
433
|
title: '首次上报时间',
|
|
@@ -553,6 +571,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
553
571
|
groupName: record.groupName,
|
|
554
572
|
groupId: record.groupId
|
|
555
573
|
});
|
|
574
|
+
setEventNameInput(record.groupName);
|
|
556
575
|
setEventNameShow(true);
|
|
557
576
|
},
|
|
558
577
|
type: "bianji"
|
|
@@ -564,9 +583,9 @@ var TablePlus = function TablePlus(props) {
|
|
|
564
583
|
}));
|
|
565
584
|
} else {
|
|
566
585
|
return /*#__PURE__*/React.createElement("div", {
|
|
567
|
-
className: "set",
|
|
586
|
+
className: "set ".concat(record.owner == 'zg_abp' ? 'set-error' : ''),
|
|
568
587
|
onClick: function onClick() {
|
|
569
|
-
|
|
588
|
+
record.owner != 'zg_abp' ? eventItemDel(record.event_id) : message.error('内置事件无法删除');
|
|
570
589
|
}
|
|
571
590
|
}, "\u5220\u9664");
|
|
572
591
|
}
|
|
@@ -590,6 +609,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
590
609
|
pagination: false
|
|
591
610
|
}), /*#__PURE__*/React.createElement(Modal, {
|
|
592
611
|
title: "\u4FEE\u6539\u5206\u7EC4\u540D",
|
|
612
|
+
destroyOnClose: true,
|
|
593
613
|
visible: eventNameShow,
|
|
594
614
|
onOk: eventNameEdit,
|
|
595
615
|
onCancel: function onCancel() {
|
|
@@ -597,6 +617,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
597
617
|
}
|
|
598
618
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
599
619
|
placeholder: "\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",
|
|
620
|
+
value: eventNameInput,
|
|
600
621
|
onChange: function onChange(e) {
|
|
601
622
|
return setEventNameInput(e.currentTarget.value);
|
|
602
623
|
}
|
|
@@ -12,15 +12,30 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
12
|
|
|
13
13
|
import { IconFont } from '@zgfe/business-lib';
|
|
14
14
|
import { Menu } from 'antd';
|
|
15
|
-
import React, { useState } from 'react';
|
|
15
|
+
import React, { useState, useEffect } from 'react';
|
|
16
16
|
import './styles/index.less'; // import EventList from './eventList';
|
|
17
17
|
// import UserAttributeList from './userAttributeList';
|
|
18
18
|
|
|
19
|
+
import { DmContext, upDatedDmFun } from '../../store';
|
|
20
|
+
import { ActionType } from '../../store/action';
|
|
19
21
|
import PlanList from '../dataPlan';
|
|
20
22
|
import DataCollection from '../dataCollection';
|
|
21
23
|
|
|
22
24
|
var DataManage = function DataManage(props) {
|
|
23
25
|
var classPrefix = 'data-manage';
|
|
26
|
+
var updateEventMetas = props.updateEventMetas; // const { state, dispatch } = useContext(DmContext);
|
|
27
|
+
|
|
28
|
+
var _upDatedDmFun = upDatedDmFun(),
|
|
29
|
+
_upDatedDmFun2 = _slicedToArray(_upDatedDmFun, 2),
|
|
30
|
+
state = _upDatedDmFun2[0],
|
|
31
|
+
dispatch = _upDatedDmFun2[1];
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
dispatch({
|
|
35
|
+
type: ActionType.SET_GLOBAL,
|
|
36
|
+
payload: updateEventMetas
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
24
39
|
|
|
25
40
|
var _useState = useState('0'),
|
|
26
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -44,7 +59,12 @@ var DataManage = function DataManage(props) {
|
|
|
44
59
|
type: "maidianfanganguanli"
|
|
45
60
|
})
|
|
46
61
|
}];
|
|
47
|
-
return /*#__PURE__*/React.createElement(
|
|
62
|
+
return /*#__PURE__*/React.createElement(DmContext.Provider, {
|
|
63
|
+
value: {
|
|
64
|
+
state: state,
|
|
65
|
+
dispatch: dispatch
|
|
66
|
+
}
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
68
|
className: classPrefix
|
|
49
69
|
}, /*#__PURE__*/React.createElement("div", {
|
|
50
70
|
className: "".concat(classPrefix, "-menu")
|
|
@@ -52,7 +72,11 @@ var DataManage = function DataManage(props) {
|
|
|
52
72
|
defaultSelectedKeys: ['0'],
|
|
53
73
|
onSelect: onSelect,
|
|
54
74
|
items: items
|
|
55
|
-
})), menuTab == '0' && /*#__PURE__*/React.createElement(DataCollection, null), menuTab == '1' && /*#__PURE__*/React.createElement(PlanList, null));
|
|
75
|
+
})), menuTab == '0' && /*#__PURE__*/React.createElement(DataCollection, null), menuTab == '1' && /*#__PURE__*/React.createElement(PlanList, null)));
|
|
56
76
|
};
|
|
57
77
|
|
|
58
|
-
export default DataManage;
|
|
78
|
+
export default DataManage; // export default forwardRef<{}, DataManageProps>((props, ref) => (
|
|
79
|
+
// <DmProvider>
|
|
80
|
+
// <DataManage {...props} />
|
|
81
|
+
// </DmProvider>
|
|
82
|
+
// ));
|
|
@@ -212,17 +212,19 @@ var addEventOrUser = function addEventOrUser(props) {
|
|
|
212
212
|
dataIndex: 'propName',
|
|
213
213
|
key: 'propName',
|
|
214
214
|
align: 'center'
|
|
215
|
-
}, {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
215
|
+
}, // {
|
|
216
|
+
// title: '值',
|
|
217
|
+
// dataIndex: 'value',
|
|
218
|
+
// key: 'value',
|
|
219
|
+
// align: 'center',
|
|
220
|
+
// },
|
|
221
|
+
// {
|
|
222
|
+
// title: '调用identify接口的时机',
|
|
223
|
+
// dataIndex: 'callTime',
|
|
224
|
+
// key: 'callTime',
|
|
225
|
+
// align: 'center',
|
|
226
|
+
// },
|
|
227
|
+
{
|
|
226
228
|
title: '操作',
|
|
227
229
|
dataIndex: 'set',
|
|
228
230
|
align: 'center'
|
|
@@ -17,7 +17,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
|
|
19
19
|
import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
|
|
20
|
-
import { Input, Button, Select, Tabs, Drawer, Upload, message, Checkbox, Empty } from 'antd';
|
|
20
|
+
import { Input, Button, Select, Tabs, Drawer, Upload, message, Checkbox, Empty, Spin } from 'antd';
|
|
21
21
|
var Option = Select.Option;
|
|
22
22
|
import React, { useEffect, useState, useContext } from 'react';
|
|
23
23
|
import './styles/index.less';
|
|
@@ -41,13 +41,20 @@ var AddPlan = function AddPlan(props) {
|
|
|
41
41
|
currentApp = _useContext.currentApp,
|
|
42
42
|
isDemo = _useContext.isDemo;
|
|
43
43
|
|
|
44
|
-
console.log('isDemo', isDemo);
|
|
44
|
+
console.log('isDemo', isDemo);
|
|
45
|
+
|
|
46
|
+
var _useState = useState(false),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
spinning = _useState2[0],
|
|
49
|
+
setSpinning = _useState2[1]; // console.log('detailId', props.detailId, props.detailName);
|
|
50
|
+
|
|
45
51
|
|
|
46
52
|
useEffect(function () {
|
|
47
53
|
setPlanName(props.detailName);
|
|
48
54
|
}, [props.detailName]);
|
|
49
55
|
useEffect(function () {
|
|
50
56
|
if (props.detailId != -1) {
|
|
57
|
+
setSpinning(true);
|
|
51
58
|
request(apis.queryPlanDetail, {
|
|
52
59
|
method: 'get',
|
|
53
60
|
params: {
|
|
@@ -58,22 +65,29 @@ var AddPlan = function AddPlan(props) {
|
|
|
58
65
|
// console.log('获取详情', res.data);
|
|
59
66
|
tableDataHandle(res.data, res.data.propPlanAndRealDataDiff, 'detail');
|
|
60
67
|
}).catch(function (err) {
|
|
61
|
-
message.
|
|
68
|
+
message.error('获取详情数据失败');
|
|
69
|
+
}).finally(function () {
|
|
70
|
+
setSpinning(false);
|
|
62
71
|
});
|
|
63
72
|
}
|
|
64
73
|
}, [props.detailId]); // 方案名称
|
|
65
74
|
|
|
66
|
-
var
|
|
67
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
-
detailNameShow = _useState2[0],
|
|
69
|
-
setDetailNameShow = _useState2[1];
|
|
70
|
-
|
|
71
|
-
var _useState3 = useState(''),
|
|
75
|
+
var _useState3 = useState('input'),
|
|
72
76
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
detailNameShow = _useState4[0],
|
|
78
|
+
setDetailNameShow = _useState4[1];
|
|
79
|
+
|
|
80
|
+
var _useState5 = useState(''),
|
|
81
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
82
|
+
planName = _useState6[0],
|
|
83
|
+
setPlanName = _useState6[1];
|
|
75
84
|
|
|
76
85
|
var PlanNameChange = function PlanNameChange(e) {
|
|
86
|
+
if (e.currentTarget.value.length > 20) {
|
|
87
|
+
message.error('最多可输入20个字符');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
77
91
|
setPlanName(e.currentTarget.value);
|
|
78
92
|
setEditOperate(true);
|
|
79
93
|
e.currentTarget.value != '' ? setplanNameInputStatus('') : null;
|
|
@@ -100,15 +114,15 @@ var AddPlan = function AddPlan(props) {
|
|
|
100
114
|
setExportValue('导出');
|
|
101
115
|
};
|
|
102
116
|
|
|
103
|
-
var
|
|
104
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
105
|
-
visible = _useState6[0],
|
|
106
|
-
setVisible = _useState6[1];
|
|
107
|
-
|
|
108
|
-
var _useState7 = useState('1'),
|
|
117
|
+
var _useState7 = useState(false),
|
|
109
118
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
visible = _useState8[0],
|
|
120
|
+
setVisible = _useState8[1];
|
|
121
|
+
|
|
122
|
+
var _useState9 = useState('1'),
|
|
123
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
124
|
+
listTab = _useState10[0],
|
|
125
|
+
setListTab = _useState10[1];
|
|
112
126
|
|
|
113
127
|
var tabsChange = function tabsChange(activeKey) {
|
|
114
128
|
setListTab(activeKey);
|
|
@@ -116,15 +130,15 @@ var AddPlan = function AddPlan(props) {
|
|
|
116
130
|
setSelectedRowKeys([]);
|
|
117
131
|
};
|
|
118
132
|
|
|
119
|
-
var
|
|
120
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
121
|
-
searchTotal = _useState10[0],
|
|
122
|
-
setSearchTotal = _useState10[1];
|
|
123
|
-
|
|
124
|
-
var _useState11 = useState(''),
|
|
133
|
+
var _useState11 = useState(0),
|
|
125
134
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
126
|
-
|
|
127
|
-
|
|
135
|
+
searchTotal = _useState12[0],
|
|
136
|
+
setSearchTotal = _useState12[1];
|
|
137
|
+
|
|
138
|
+
var _useState13 = useState(''),
|
|
139
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
140
|
+
searchData = _useState14[0],
|
|
141
|
+
setSearchData = _useState14[1]; // 关闭抽屉
|
|
128
142
|
|
|
129
143
|
|
|
130
144
|
var closeDrawer = function closeDrawer(type) {
|
|
@@ -146,15 +160,16 @@ var AddPlan = function AddPlan(props) {
|
|
|
146
160
|
showUploadList: false,
|
|
147
161
|
beforeUpload: function beforeUpload(file) {
|
|
148
162
|
console.log(file);
|
|
163
|
+
setSpinning(true);
|
|
149
164
|
var fileType = file.name.split('.');
|
|
150
165
|
|
|
151
166
|
if (fileType[fileType.length - 1] != 'xlsx' && fileType[fileType.length - 1] != 'xsl') {
|
|
152
|
-
message.error('
|
|
167
|
+
message.error('仅支持excel(xsl、xlsx)格式文件,请检查后重新上传');
|
|
153
168
|
return;
|
|
154
169
|
}
|
|
155
170
|
|
|
156
171
|
if (file.size > 5 * 1024 * 1024) {
|
|
157
|
-
message.error('
|
|
172
|
+
message.error('文件大小支持5M以内,请检查后重新上传');
|
|
158
173
|
return;
|
|
159
174
|
}
|
|
160
175
|
|
|
@@ -168,38 +183,55 @@ var AddPlan = function AddPlan(props) {
|
|
|
168
183
|
method: 'post',
|
|
169
184
|
data: data
|
|
170
185
|
}).then(function (res) {
|
|
186
|
+
console.log('111', res);
|
|
187
|
+
|
|
188
|
+
if (res == null) {
|
|
189
|
+
// 接口处理表格异常处理
|
|
190
|
+
message.error('上传失败');
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (Object.keys(res.data).length <= 0) {
|
|
195
|
+
// 破损表格,异常处理
|
|
196
|
+
message.error('上传失败');
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
171
200
|
message.success('上传成功');
|
|
172
201
|
tableDataHandle(res.data.eventPlanDataStatusList, res.data.userPropPlanList, 'add');
|
|
173
202
|
setEditOperate(true);
|
|
174
203
|
setListTab('1');
|
|
175
204
|
}).catch(function (err) {
|
|
176
|
-
message.
|
|
205
|
+
message.error('上传失败');
|
|
206
|
+
}).finally(function () {
|
|
207
|
+
setSpinning(false);
|
|
177
208
|
});
|
|
209
|
+
return false;
|
|
178
210
|
}
|
|
179
211
|
}; // 事件列表-渲染数据
|
|
180
212
|
|
|
181
|
-
var _useState13 = useState([]),
|
|
182
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
183
|
-
eventListData = _useState14[0],
|
|
184
|
-
setEventListData = _useState14[1]; // 事件列表-原数据
|
|
185
|
-
|
|
186
|
-
|
|
187
213
|
var _useState15 = useState([]),
|
|
188
214
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
189
|
-
|
|
190
|
-
|
|
215
|
+
eventListData = _useState16[0],
|
|
216
|
+
setEventListData = _useState16[1]; // 事件列表-原数据
|
|
191
217
|
|
|
192
218
|
|
|
193
219
|
var _useState17 = useState([]),
|
|
194
220
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
195
|
-
|
|
196
|
-
|
|
221
|
+
eventListDataCopy = _useState18[0],
|
|
222
|
+
setEventListDataCopy = _useState18[1]; // 用户属性列表-渲染数据
|
|
197
223
|
|
|
198
224
|
|
|
199
225
|
var _useState19 = useState([]),
|
|
200
226
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
201
|
-
|
|
202
|
-
|
|
227
|
+
userAttrData = _useState20[0],
|
|
228
|
+
setUserAttrData = _useState20[1]; // 用户属性列表-原数据
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
var _useState21 = useState([]),
|
|
232
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
233
|
+
userAttrDataCopy = _useState22[0],
|
|
234
|
+
setUserAttrDataCopy = _useState22[1]; // 手动添加事件或属性
|
|
203
235
|
|
|
204
236
|
|
|
205
237
|
var addEventOrUserFun = function addEventOrUserFun(data) {
|
|
@@ -357,8 +389,21 @@ var AddPlan = function AddPlan(props) {
|
|
|
357
389
|
});
|
|
358
390
|
|
|
359
391
|
setEventListData(_temp_tableHandleData);
|
|
360
|
-
}; //
|
|
392
|
+
}; // 保存方案按钮是否置灰
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
var _useState23 = useState(false),
|
|
396
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
397
|
+
saveDisabled = _useState24[0],
|
|
398
|
+
setSaveDisabled = _useState24[1];
|
|
361
399
|
|
|
400
|
+
useEffect(function () {
|
|
401
|
+
if (JSON.stringify(eventListData).indexOf('eventName') == -1) {
|
|
402
|
+
setSaveDisabled(true);
|
|
403
|
+
} else {
|
|
404
|
+
setSaveDisabled(false);
|
|
405
|
+
}
|
|
406
|
+
}, [eventListData]); // 保存方案
|
|
362
407
|
|
|
363
408
|
var savePlanData = function savePlanData() {
|
|
364
409
|
if (planName == '') {
|
|
@@ -366,15 +411,22 @@ var AddPlan = function AddPlan(props) {
|
|
|
366
411
|
return;
|
|
367
412
|
}
|
|
368
413
|
|
|
369
|
-
|
|
370
|
-
|
|
414
|
+
var planNameFlag = false;
|
|
415
|
+
props.listData.map(function (item) {
|
|
416
|
+
if (item.planName == planName && item.id != props.detailId) {
|
|
417
|
+
planNameFlag = true;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
if (planNameFlag) {
|
|
422
|
+
message.error('方案名称与现有方案重复');
|
|
371
423
|
return;
|
|
372
424
|
} // console.log('保存', planName, eventListData, userAttrData);
|
|
373
425
|
|
|
374
426
|
|
|
375
427
|
var eventPlanList = [];
|
|
376
428
|
var userPropPlanList = [];
|
|
377
|
-
|
|
429
|
+
eventListDataCopy.map(function (_item) {
|
|
378
430
|
var _loop2 = function _loop2(key) {
|
|
379
431
|
_item[key].map(function (item) {
|
|
380
432
|
item.attributeName.map(function (_item) {
|
|
@@ -391,7 +443,7 @@ var AddPlan = function AddPlan(props) {
|
|
|
391
443
|
_loop2(key);
|
|
392
444
|
}
|
|
393
445
|
});
|
|
394
|
-
|
|
446
|
+
userAttrDataCopy.map(function (item) {
|
|
395
447
|
userPropPlanList.push(item);
|
|
396
448
|
});
|
|
397
449
|
var ManagementPlan = {
|
|
@@ -401,6 +453,20 @@ var AddPlan = function AddPlan(props) {
|
|
|
401
453
|
eventPlanList: eventPlanList,
|
|
402
454
|
userPropPlanList: userPropPlanList
|
|
403
455
|
};
|
|
456
|
+
var eventCount = 0;
|
|
457
|
+
eventListDataCopy.map(function (_item, index) {
|
|
458
|
+
for (var key in _item) {
|
|
459
|
+
_item[key].map(function (item) {
|
|
460
|
+
eventCount++;
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
if (eventCount > 500) {
|
|
466
|
+
message.error('每个方案最多保存500条数据,请修改后重新保存');
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
|
|
404
470
|
request(apis.savePlan, {
|
|
405
471
|
method: 'post',
|
|
406
472
|
data: _objectSpread({}, ManagementPlan)
|
|
@@ -410,15 +476,15 @@ var AddPlan = function AddPlan(props) {
|
|
|
410
476
|
closeDrawer('save');
|
|
411
477
|
}
|
|
412
478
|
}).catch(function (err) {
|
|
413
|
-
message.
|
|
479
|
+
message.error('保存失败');
|
|
414
480
|
});
|
|
415
481
|
}; // 存储选中的keys
|
|
416
482
|
|
|
417
483
|
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
selectedRowKeys =
|
|
421
|
-
setSelectedRowKeys =
|
|
484
|
+
var _useState25 = useState([]),
|
|
485
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
486
|
+
selectedRowKeys = _useState26[0],
|
|
487
|
+
setSelectedRowKeys = _useState26[1];
|
|
422
488
|
|
|
423
489
|
var tableCheck = function tableCheck(e, record) {
|
|
424
490
|
// console.log(e.target.checked, record.key);
|
|
@@ -463,60 +529,74 @@ var AddPlan = function AddPlan(props) {
|
|
|
463
529
|
// 批量删除
|
|
464
530
|
|
|
465
531
|
|
|
466
|
-
var
|
|
467
|
-
|
|
468
|
-
|
|
532
|
+
var deteleDataHandle = function deteleDataHandle(data) {
|
|
533
|
+
var _tempData = [];
|
|
534
|
+
data.map(function (_item, index) {
|
|
535
|
+
var _jsop = {};
|
|
469
536
|
|
|
470
|
-
var
|
|
471
|
-
|
|
472
|
-
var _jsop = {};
|
|
537
|
+
var _loop3 = function _loop3(key) {
|
|
538
|
+
var _data = [];
|
|
473
539
|
|
|
474
|
-
|
|
475
|
-
|
|
540
|
+
_item[key].map(function (item) {
|
|
541
|
+
selectedRowKeys.indexOf(item.key) == -1 ? _data.push(item) : null;
|
|
542
|
+
});
|
|
476
543
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
544
|
+
if (_data.length > 0) {
|
|
545
|
+
_jsop[key] = _data;
|
|
546
|
+
}
|
|
547
|
+
};
|
|
480
548
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
};
|
|
549
|
+
for (var key in _item) {
|
|
550
|
+
_loop3(key);
|
|
551
|
+
}
|
|
485
552
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
553
|
+
_tempData.push(_jsop);
|
|
554
|
+
});
|
|
555
|
+
return _tempData;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
var batchDetele = function batchDetele() {
|
|
559
|
+
if (listTab == '1') {
|
|
560
|
+
var _tempData = deteleDataHandle(_.cloneDeep(eventListData));
|
|
561
|
+
|
|
562
|
+
var _tempDataCopy = deteleDataHandle(_.cloneDeep(eventListDataCopy));
|
|
489
563
|
|
|
490
|
-
_tempData.push(_jsop);
|
|
491
|
-
});
|
|
492
564
|
setEventListData(_tempData);
|
|
493
|
-
setEventListDataCopy(
|
|
565
|
+
setEventListDataCopy(_tempDataCopy); // 备份
|
|
494
566
|
} else {
|
|
495
|
-
var
|
|
567
|
+
var data = _.cloneDeep(userAttrData);
|
|
496
568
|
|
|
497
|
-
_.remove(
|
|
569
|
+
_.remove(data, function (x) {
|
|
498
570
|
return selectedRowKeys.indexOf(x.key) != -1;
|
|
499
571
|
});
|
|
500
572
|
|
|
501
|
-
setUserAttrData(
|
|
573
|
+
setUserAttrData(data);
|
|
574
|
+
|
|
575
|
+
var dataCopy = _.cloneDeep(userAttrDataCopy);
|
|
576
|
+
|
|
577
|
+
_.remove(dataCopy, function (x) {
|
|
578
|
+
return selectedRowKeys.indexOf(x.key) != -1;
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
setUserAttrDataCopy(dataCopy); // 备份
|
|
502
582
|
}
|
|
503
583
|
|
|
504
584
|
setEditOperate(true);
|
|
505
585
|
setSelectedRowKeys([]);
|
|
506
|
-
message.
|
|
586
|
+
message.error('删除成功');
|
|
507
587
|
}; // 是否有编辑操作
|
|
508
588
|
|
|
509
589
|
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
editOperate =
|
|
513
|
-
setEditOperate =
|
|
590
|
+
var _useState27 = useState(false),
|
|
591
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
592
|
+
editOperate = _useState28[0],
|
|
593
|
+
setEditOperate = _useState28[1]; // 保存时,方案名称若为空,Input显示校验提示
|
|
514
594
|
|
|
515
595
|
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
planNameInputStatus =
|
|
519
|
-
setplanNameInputStatus =
|
|
596
|
+
var _useState29 = useState(''),
|
|
597
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
598
|
+
planNameInputStatus = _useState30[0],
|
|
599
|
+
setplanNameInputStatus = _useState30[1]; // 检索条数
|
|
520
600
|
|
|
521
601
|
|
|
522
602
|
useEffect(function () {
|
|
@@ -535,10 +615,10 @@ var AddPlan = function AddPlan(props) {
|
|
|
535
615
|
}
|
|
536
616
|
}, [listTab, eventListData, userAttrData]);
|
|
537
617
|
|
|
538
|
-
var
|
|
539
|
-
|
|
540
|
-
exportValue =
|
|
541
|
-
setExportValue =
|
|
618
|
+
var _useState31 = useState('导出'),
|
|
619
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
620
|
+
exportValue = _useState32[0],
|
|
621
|
+
setExportValue = _useState32[1];
|
|
542
622
|
|
|
543
623
|
return /*#__PURE__*/React.createElement(Drawer, {
|
|
544
624
|
width: '70%',
|
|
@@ -574,6 +654,7 @@ var AddPlan = function AddPlan(props) {
|
|
|
574
654
|
return closeDrawer('close');
|
|
575
655
|
}
|
|
576
656
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
657
|
+
disabled: saveDisabled,
|
|
577
658
|
onClick: savePlanData,
|
|
578
659
|
type: "primary"
|
|
579
660
|
}, "\u4FDD\u5B58"))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -651,6 +732,10 @@ var AddPlan = function AddPlan(props) {
|
|
|
651
732
|
type: listTab == '1' ? 'event' : 'user',
|
|
652
733
|
visible: visible,
|
|
653
734
|
setVisible: setVisible
|
|
735
|
+
}), /*#__PURE__*/React.createElement(Spin, {
|
|
736
|
+
size: "large",
|
|
737
|
+
spinning: spinning,
|
|
738
|
+
className: "spin"
|
|
654
739
|
})));
|
|
655
740
|
};
|
|
656
741
|
|
|
@@ -52,7 +52,7 @@ var PlanList = function PlanList(props) {
|
|
|
52
52
|
message.success('删除成功');
|
|
53
53
|
queryList();
|
|
54
54
|
}).catch(function (err) {
|
|
55
|
-
message.
|
|
55
|
+
message.error('删除失败');
|
|
56
56
|
}).finally(function () {});
|
|
57
57
|
}
|
|
58
58
|
});
|
|
@@ -205,6 +205,10 @@ var PlanList = function PlanList(props) {
|
|
|
205
205
|
checked: isOpen
|
|
206
206
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
207
207
|
onClick: function onClick() {
|
|
208
|
+
if (listData.length >= 10) {
|
|
209
|
+
return message.error('最多创建10个埋点方案');
|
|
210
|
+
}
|
|
211
|
+
|
|
208
212
|
setDrawerShow(true);
|
|
209
213
|
},
|
|
210
214
|
type: "primary",
|
|
@@ -223,6 +227,7 @@ var PlanList = function PlanList(props) {
|
|
|
223
227
|
// onChange={onChange}
|
|
224
228
|
pagination: false
|
|
225
229
|
})), /*#__PURE__*/React.createElement(AddPlan, {
|
|
230
|
+
listData: listData,
|
|
226
231
|
detailName: detailName,
|
|
227
232
|
drawerShow: drawerShow,
|
|
228
233
|
drawerClose: drawerClose,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { State } from './state';
|
|
3
|
+
import { Action } from './action';
|
|
4
|
+
export declare const DmContext: import("react").Context<{
|
|
5
|
+
state: State;
|
|
6
|
+
dispatch: Dispatch<Action>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const upDatedDmFun: () => [state: State, dispatch: Dispatch<Action>];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { useReducer, createContext } from 'react';
|
|
14
|
+
import { initState } from './state';
|
|
15
|
+
import { ActionType } from './action';
|
|
16
|
+
|
|
17
|
+
var DmReducer = function DmReducer(prevState, action) {
|
|
18
|
+
console.log('DmReducer', prevState, action);
|
|
19
|
+
|
|
20
|
+
switch (action.type) {
|
|
21
|
+
case ActionType.SET_GLOBAL:
|
|
22
|
+
return {
|
|
23
|
+
updateEventMetas: action.payload
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
default:
|
|
27
|
+
return initState;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export var DmContext = /*#__PURE__*/createContext({
|
|
32
|
+
state: initState,
|
|
33
|
+
dispatch: function dispatch() {}
|
|
34
|
+
});
|
|
35
|
+
export var upDatedDmFun = function upDatedDmFun() {
|
|
36
|
+
var _useReducer = useReducer(DmReducer, initState),
|
|
37
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
38
|
+
state = _useReducer2[0],
|
|
39
|
+
dispatch = _useReducer2[1];
|
|
40
|
+
|
|
41
|
+
return [state, dispatch];
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.2-dm.
|
|
3
|
+
"version": "1.0.2-dm.11",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"license": "ISC",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"umi-request": "^1.4.0",
|
|
54
54
|
"yorkie": "^2.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "08d7837b3958c7d3406a407298bad9d326672ecf",
|
|
57
57
|
"gitHooks": {
|
|
58
58
|
"pre-commit": "lint-staged"
|
|
59
59
|
}
|