@zgfe/modules-dm 1.0.34-heyh.17 → 1.0.34-heyh.19
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 +1 -1
- package/es/modules/dataCollection/components/createVirtualDrawer.js +56 -28
- package/es/modules/dataCollection/components/tablePlus.js +1 -1
- package/es/modules/dataCollection/components/virtualTablePlus.js +1 -1
- package/es/modules/dataCollection/styles/index.less +32 -7
- package/es/modules/dataCollection/types.d.ts +1 -0
- package/es/modules/dataCollection/virtualEventList.js +3 -1
- package/es/utils/index.d.ts +5 -0
- package/es/utils/index.js +28 -0
- package/package.json +2 -2
package/es/components/demo.js
CHANGED
|
@@ -11,14 +11,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
|
|
14
|
-
import { Input, Button, Select, Drawer, Form, message } from 'antd';
|
|
14
|
+
import { Input, Button, Select, Drawer, Form, message, Modal } from 'antd';
|
|
15
15
|
import { Fragment } from 'react';
|
|
16
16
|
import moment from 'moment';
|
|
17
17
|
var TextArea = Input.TextArea;
|
|
18
18
|
import request from '../../../utils/ajax';
|
|
19
19
|
import apis from '../../../constants/api';
|
|
20
20
|
import React, { useContext, useState } from 'react';
|
|
21
|
-
import { eventJsonHandle, getDelectAttributesData, getSubmitHandleData, getAppID } from '../../../utils';
|
|
21
|
+
import { eventJsonHandle, getDelectAttributesData, getSubmitHandleData, getAppID, getVirtualContentChange } from '../../../utils';
|
|
22
22
|
import EventFilter from './eventFilter';
|
|
23
23
|
import SelectAttributes from './selectAttributes';
|
|
24
24
|
import _ from 'lodash';
|
|
@@ -34,31 +34,36 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
34
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
35
|
formSubmit = _useState2[0],
|
|
36
36
|
setFormSubmit = _useState2[1];
|
|
37
|
+
var _useState3 = useState(),
|
|
38
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
+
formSubmitData = _useState4[0],
|
|
40
|
+
setFormSubmitData = _useState4[1];
|
|
37
41
|
var _useContext = useContext(BizGlobalDataContext),
|
|
38
42
|
currentApp = _useContext.currentApp,
|
|
39
43
|
eventGroupList = _useContext.eventGroupList;
|
|
40
|
-
var
|
|
41
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
-
selectAttributesShow = _useState4[0],
|
|
43
|
-
setSelectAttributesShow = _useState4[1];
|
|
44
|
-
var _useState5 = useState({}),
|
|
44
|
+
var _useState5 = useState(false),
|
|
45
45
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
selectAttributesShow = _useState6[0],
|
|
47
|
+
setSelectAttributesShow = _useState6[1];
|
|
48
48
|
var _useState7 = useState({}),
|
|
49
49
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var _useState9 = useState(
|
|
50
|
+
selectAttributesData = _useState8[0],
|
|
51
|
+
setSelectAttributesData = _useState8[1];
|
|
52
|
+
var _useState9 = useState({}),
|
|
53
53
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var
|
|
54
|
+
submitData = _useState10[0],
|
|
55
|
+
setSubmitData = _useState10[1];
|
|
56
|
+
var _useState11 = useState([]),
|
|
57
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
58
|
+
selectList = _useState12[0],
|
|
59
|
+
setSelectList = _useState12[1];
|
|
60
|
+
var onValuesChange = function onValuesChange(_, allData) {
|
|
57
61
|
var _selectList = [];
|
|
58
62
|
allData.eventJson.map(function (item) {
|
|
59
63
|
if (item === null || item === void 0 ? void 0 : item.eventId) _selectList.push(item.eventId);
|
|
60
64
|
});
|
|
61
65
|
setSelectList(_selectList);
|
|
66
|
+
setFormSubmitData(allData);
|
|
62
67
|
setFormSubmit(eventJsonHandle(allData));
|
|
63
68
|
};
|
|
64
69
|
// 保存
|
|
@@ -87,6 +92,7 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
87
92
|
}, data)
|
|
88
93
|
}).then(function (res) {
|
|
89
94
|
if ((res === null || res === void 0 ? void 0 : res.code) === '100000' && res.data === 1) {
|
|
95
|
+
message.success('编辑成功');
|
|
90
96
|
refresh();
|
|
91
97
|
setCreateVirtualShow(false);
|
|
92
98
|
} else {
|
|
@@ -102,6 +108,7 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
102
108
|
}, data)
|
|
103
109
|
}).then(function (res) {
|
|
104
110
|
if ((res === null || res === void 0 ? void 0 : res.code) === '100000' && res.data === 1) {
|
|
111
|
+
message.success('创建成功');
|
|
105
112
|
refresh();
|
|
106
113
|
setCreateVirtualShow(false);
|
|
107
114
|
} else {
|
|
@@ -110,6 +117,29 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
110
117
|
});
|
|
111
118
|
}
|
|
112
119
|
};
|
|
120
|
+
var onClose = function onClose() {
|
|
121
|
+
if (virtualDrawerType === "edit") {
|
|
122
|
+
if (formSubmit && getVirtualContentChange(_.cloneDeep(editVirtualEventData), _.cloneDeep(formSubmitData))) {
|
|
123
|
+
Modal.confirm({
|
|
124
|
+
centered: true,
|
|
125
|
+
title: '内容发生了修改,请确认是否保存修改内容',
|
|
126
|
+
okText: '确认',
|
|
127
|
+
cancelText: '取消',
|
|
128
|
+
maskClosable: false,
|
|
129
|
+
onOk: function onOk() {
|
|
130
|
+
onFinish(formSubmitData);
|
|
131
|
+
},
|
|
132
|
+
onCancel: function onCancel() {
|
|
133
|
+
setCreateVirtualShow(false);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
} else {
|
|
137
|
+
setCreateVirtualShow(false);
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
setCreateVirtualShow(false);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
113
143
|
var editGroupOptions = function editGroupOptions(eventGroupId) {
|
|
114
144
|
var text = '';
|
|
115
145
|
groupOptions.map(function (item) {
|
|
@@ -125,19 +155,15 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
125
155
|
title: "".concat(virtualDrawerType === 'edit' ? '编辑' : virtualDrawerType === 'see' ? '查看' : '创建', "\u865A\u62DF\u4E8B\u4EF6"),
|
|
126
156
|
placement: "right",
|
|
127
157
|
destroyOnClose: true,
|
|
128
|
-
onClose:
|
|
129
|
-
return setCreateVirtualShow(false);
|
|
130
|
-
},
|
|
158
|
+
onClose: onClose,
|
|
131
159
|
open: createVirtualShow,
|
|
132
160
|
extra: /*#__PURE__*/React.createElement(IconFont, {
|
|
133
161
|
type: "qingchu",
|
|
134
|
-
onClick:
|
|
135
|
-
setCreateVirtualShow(false);
|
|
136
|
-
}
|
|
162
|
+
onClick: onClose
|
|
137
163
|
})
|
|
138
164
|
}, /*#__PURE__*/React.createElement(Fragment, null, virtualDrawerType === 'see' && /*#__PURE__*/React.createElement("div", {
|
|
139
165
|
className: "".concat(classPrefix, "-see-box")
|
|
140
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u540D\u79F0"), editVirtualEventData.eventName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u522B\u540D"), editVirtualEventData.aliasName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5206\u7EC4"), editGroupOptions(editVirtualEventData.
|
|
166
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u540D\u79F0"), editVirtualEventData.eventName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u522B\u540D"), editVirtualEventData.aliasName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5206\u7EC4"), editGroupOptions((editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId) === null ? -1 : editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5907\u6CE8"), editVirtualEventData.description), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u4EBA"), editVirtualEventData.createUser), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u65F6\u95F4"), moment(editVirtualEventData.insertTime).format('YYYY-MM-DD HH:mm:ss')), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u66F4\u65B0\u65F6\u95F4"), moment(editVirtualEventData.updateTime).format('YYYY-MM-DD HH:mm:ss'))), /*#__PURE__*/React.createElement(Form, {
|
|
141
167
|
name: "basic",
|
|
142
168
|
labelCol: {
|
|
143
169
|
span: 2
|
|
@@ -146,7 +172,8 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
146
172
|
span: 16
|
|
147
173
|
},
|
|
148
174
|
initialValues: _objectSpread(_objectSpread({}, editVirtualEventData), {}, {
|
|
149
|
-
desc: editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.description
|
|
175
|
+
desc: editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.description,
|
|
176
|
+
eventGroupId: (editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId) === null || (editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId) === undefined ? -1 : editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId
|
|
150
177
|
}),
|
|
151
178
|
onFinish: onFinish,
|
|
152
179
|
onValuesChange: onValuesChange,
|
|
@@ -178,10 +205,13 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
178
205
|
name: "eventGroupId"
|
|
179
206
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
180
207
|
defaultValue: -1,
|
|
181
|
-
options: groupOptions
|
|
208
|
+
options: groupOptions.filter(function (item) {
|
|
209
|
+
return item.value !== -999;
|
|
210
|
+
})
|
|
182
211
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
183
212
|
label: "\u5907\u6CE8",
|
|
184
|
-
name: "desc"
|
|
213
|
+
name: "desc",
|
|
214
|
+
className: "".concat(classPrefix, "-desc")
|
|
185
215
|
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
186
216
|
rows: 4,
|
|
187
217
|
placeholder: "\u8BF7\u8F93\u5165\u5907\u6CE8",
|
|
@@ -224,9 +254,7 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
|
|
|
224
254
|
className: "".concat(classPrefix, "-formSubmit")
|
|
225
255
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
226
256
|
type: "default",
|
|
227
|
-
onClick:
|
|
228
|
-
return setCreateVirtualShow(false);
|
|
229
|
-
}
|
|
257
|
+
onClick: onClose
|
|
230
258
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
231
259
|
type: "primary",
|
|
232
260
|
htmlType: "submit",
|
|
@@ -154,7 +154,7 @@ var TablePlus = function TablePlus(props) {
|
|
|
154
154
|
}).then(function (res) {
|
|
155
155
|
// 该事件在虚拟事件中有使用
|
|
156
156
|
if (res.data === 1) {
|
|
157
|
-
eventDelModal(record.event_id, '
|
|
157
|
+
eventDelModal(record.event_id, '检测到该事件在虚拟事件中使用, 删除后,将停止采集该事件数据,也将不在分析平台中显示!');
|
|
158
158
|
} else {
|
|
159
159
|
eventDelModal(record.event_id, '删除后,将停止采集该事件数据,也将不在分析平台中显示!');
|
|
160
160
|
}
|
|
@@ -213,7 +213,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
|
|
|
213
213
|
key: 'insertTime',
|
|
214
214
|
width: 187,
|
|
215
215
|
render: function render(text) {
|
|
216
|
-
return /*#__PURE__*/React.createElement("div", null, moment(text).format('YYYY-MM-DD HH:mm:ss'));
|
|
216
|
+
return /*#__PURE__*/React.createElement("div", null, text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '');
|
|
217
217
|
}
|
|
218
218
|
}, {
|
|
219
219
|
title: '末次上报时间',
|
|
@@ -391,6 +391,17 @@
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
.create-virtual-drawer {
|
|
394
|
+
#basic {
|
|
395
|
+
padding-bottom: 100px;
|
|
396
|
+
.ant-input {
|
|
397
|
+
border: none;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
&-desc {
|
|
401
|
+
.ant-form-item-control {
|
|
402
|
+
max-width: 100%;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
394
405
|
&-add {
|
|
395
406
|
color: #165dff;
|
|
396
407
|
&-icon {
|
|
@@ -427,6 +438,15 @@
|
|
|
427
438
|
> :nth-child(2) {
|
|
428
439
|
margin-top: 8px;
|
|
429
440
|
}
|
|
441
|
+
> :nth-child(1)::before {
|
|
442
|
+
display: inline-block;
|
|
443
|
+
margin-right: 4px;
|
|
444
|
+
color: #ff4d4f;
|
|
445
|
+
font-size: 14px;
|
|
446
|
+
font-family: SimSun, sans-serif;
|
|
447
|
+
line-height: 1;
|
|
448
|
+
content: '*';
|
|
449
|
+
}
|
|
430
450
|
}
|
|
431
451
|
&-eventDataBox.see {
|
|
432
452
|
> :nth-child(1) {
|
|
@@ -449,10 +469,15 @@
|
|
|
449
469
|
}
|
|
450
470
|
&-formSubmit {
|
|
451
471
|
position: absolute;
|
|
452
|
-
|
|
453
|
-
|
|
472
|
+
background: #fff;
|
|
473
|
+
width: 100%;
|
|
474
|
+
border-top: 1px solid #F2F3F4;
|
|
475
|
+
right: 0;
|
|
476
|
+
bottom: 0;
|
|
477
|
+
padding: 24px;
|
|
454
478
|
display: flex;
|
|
455
|
-
gap:
|
|
479
|
+
gap: 16px;
|
|
480
|
+
justify-content: end;
|
|
456
481
|
}
|
|
457
482
|
}
|
|
458
483
|
|
|
@@ -583,13 +608,13 @@
|
|
|
583
608
|
}
|
|
584
609
|
}
|
|
585
610
|
.ant-modal-confirm-title {
|
|
586
|
-
display: inline!important;
|
|
587
|
-
color: #021429!important;
|
|
611
|
+
display: inline !important;
|
|
612
|
+
color: #021429 !important;
|
|
588
613
|
font-weight: 500;
|
|
589
|
-
font-size: 24px!important;
|
|
614
|
+
font-size: 24px !important;
|
|
590
615
|
}
|
|
591
616
|
.ant-modal-confirm-content {
|
|
592
|
-
margin-top: 20px!important;
|
|
617
|
+
margin-top: 20px !important;
|
|
593
618
|
}
|
|
594
619
|
}
|
|
595
620
|
|
|
@@ -51,7 +51,7 @@ var VirtualEventList = function VirtualEventList() {
|
|
|
51
51
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
52
52
|
pageNumber = _useState10[0],
|
|
53
53
|
setPageNumber = _useState10[1];
|
|
54
|
-
var _useState11 = useState(
|
|
54
|
+
var _useState11 = useState(10),
|
|
55
55
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
56
56
|
pageSize = _useState12[0],
|
|
57
57
|
setPageSize = _useState12[1];
|
|
@@ -120,10 +120,12 @@ var VirtualEventList = function VirtualEventList() {
|
|
|
120
120
|
};
|
|
121
121
|
// 筛选事件
|
|
122
122
|
var eventNameChange = function eventNameChange(e) {
|
|
123
|
+
setPageNumber(1);
|
|
123
124
|
setEventNameChangeData(e.currentTarget.value);
|
|
124
125
|
};
|
|
125
126
|
// 筛选收藏
|
|
126
127
|
var markTypeFilter = function markTypeFilter(markActive) {
|
|
128
|
+
setPageNumber(1);
|
|
127
129
|
setMarkTypeData(markActive ? 1 : 0);
|
|
128
130
|
};
|
|
129
131
|
// 获取虚拟事件列表
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 虚拟事件编辑 判断内容是否有改动;有改动返回true
|
|
3
|
+
*/
|
|
4
|
+
export declare const getVirtualContentChange: (oldData: any, newData: any) => boolean;
|
|
1
5
|
/**
|
|
2
6
|
* 虚拟事件属性超过100个,选择属性后的回调,处理提交数据
|
|
3
7
|
*/
|
|
@@ -43,6 +47,7 @@ export declare const groupListSort: (result: any, groupingData: any, setGrouping
|
|
|
43
47
|
*/
|
|
44
48
|
export declare const eventListHandle: (data: any) => void;
|
|
45
49
|
export declare const getAppID: (currentApp: any) => any;
|
|
50
|
+
export declare const nullToEmptyString: (data: any) => any;
|
|
46
51
|
/**
|
|
47
52
|
* 获取第一个表格的可视化高度
|
|
48
53
|
* @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74)
|
package/es/utils/index.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 虚拟事件编辑 判断内容是否有改动;有改动返回true
|
|
3
|
+
*/
|
|
4
|
+
export var getVirtualContentChange = function getVirtualContentChange(oldData, newData) {
|
|
5
|
+
if (oldData.aliasName != newData.aliasName) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (oldData.eventName != newData.eventName) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (oldData.groupId != newData.eventGroupId) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (nullToEmptyString(oldData.description) != nullToEmptyString(newData.desc)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (JSON.stringify(oldData.eventJson) !== JSON.stringify(newData.eventJson)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
};
|
|
1
22
|
/**
|
|
2
23
|
* 虚拟事件属性超过100个,选择属性后的回调,处理提交数据
|
|
3
24
|
*/
|
|
@@ -248,6 +269,13 @@ export var getAppID = function getAppID(currentApp) {
|
|
|
248
269
|
return currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId;
|
|
249
270
|
}
|
|
250
271
|
};
|
|
272
|
+
// null 或 undefined 转为 空字符串
|
|
273
|
+
export var nullToEmptyString = function nullToEmptyString(data) {
|
|
274
|
+
if (data === null || data === undefined) {
|
|
275
|
+
return '';
|
|
276
|
+
}
|
|
277
|
+
return data;
|
|
278
|
+
};
|
|
251
279
|
/**
|
|
252
280
|
* 获取第一个表格的可视化高度
|
|
253
281
|
* @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.34-heyh.
|
|
3
|
+
"version": "1.0.34-heyh.19",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "es/index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"umi-request": "^1.4.0",
|
|
53
53
|
"yorkie": "^2.0.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6e8dcc1a37d012fcaba2f39f2a0918669b6b9682",
|
|
56
56
|
"gitHooks": {
|
|
57
57
|
"pre-commit": "lint-staged"
|
|
58
58
|
}
|