@zgfe/modules-dm 1.0.56-zhongyuan.15 → 1.0.56-zhongyuan.16
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/dataMap/component/drawerAdd.js +2 -0
- package/es/modules/dataMap/component/rightDetail.js +8 -56
- package/es/modules/dataMap/mapSetting.js +1 -1
- package/es/modules/dataReal/css/index.css +2 -0
- package/es/modules/dataReal/css/index.less +2 -0
- package/es/modules/dataReal/index1.js +47 -33
- package/es/modules/dataReal/table.js +40 -7
- package/package.json +2 -2
|
@@ -40,6 +40,7 @@ var DrawerAdd = function DrawerAdd(props) {
|
|
|
40
40
|
}, [props.open]);
|
|
41
41
|
var closeDrawer = function closeDrawer() {
|
|
42
42
|
setIsOpen(false);
|
|
43
|
+
setEvent({});
|
|
43
44
|
form.resetFields(); // 表单重置
|
|
44
45
|
conditionRef.current.deleteAll(); // 重置固定筛选数组
|
|
45
46
|
props.handleClose();
|
|
@@ -183,6 +184,7 @@ var DrawerAdd = function DrawerAdd(props) {
|
|
|
183
184
|
placement: "right",
|
|
184
185
|
onClose: onClose,
|
|
185
186
|
open: isOpen,
|
|
187
|
+
destroyOnClose: true,
|
|
186
188
|
width: "800px",
|
|
187
189
|
footer: /*#__PURE__*/React.createElement("div", {
|
|
188
190
|
className: "".concat(pageClassName, "_footer")
|
|
@@ -194,7 +194,7 @@ var RightDetail = function RightDetail(props) {
|
|
|
194
194
|
pageName: currentTreeData === null || currentTreeData === void 0 ? void 0 : currentTreeData.pageAttrName
|
|
195
195
|
}
|
|
196
196
|
}).then(function (res) {
|
|
197
|
-
var _res$data, _res$data2, _res$data3, _res$data4, _res$data5;
|
|
197
|
+
var _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6;
|
|
198
198
|
setLoadingDetail(false);
|
|
199
199
|
if (!res) return;
|
|
200
200
|
setCurrentTreeDetail(res === null || res === void 0 ? void 0 : res.data);
|
|
@@ -204,11 +204,11 @@ var RightDetail = function RightDetail(props) {
|
|
|
204
204
|
description: (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.pageDescribe) || ''
|
|
205
205
|
});
|
|
206
206
|
setImagePath(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.pagePath);
|
|
207
|
-
setImageUrl([{
|
|
207
|
+
(res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.pageUrl) && setImageUrl([{
|
|
208
208
|
status: 'done',
|
|
209
209
|
name: '',
|
|
210
|
-
url: (res === null || res === void 0 ? void 0 : (_res$
|
|
211
|
-
uid: res === null || res === void 0 ? void 0 : (_res$
|
|
210
|
+
url: (res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.pageUrl) && getImgUrl(res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.pageUrl, '-99'),
|
|
211
|
+
uid: res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.pagePath
|
|
212
212
|
}]);
|
|
213
213
|
});
|
|
214
214
|
}
|
|
@@ -493,59 +493,11 @@ var RightDetail = function RightDetail(props) {
|
|
|
493
493
|
userGroup: [0]
|
|
494
494
|
}
|
|
495
495
|
}).then(function (res) {
|
|
496
|
-
var _res$
|
|
497
|
-
resolve((res === null || res === void 0 ? void 0 : (_res$
|
|
496
|
+
var _res$data7, _res$data7$series, _res$data7$series$, _res$data7$series$$va;
|
|
497
|
+
resolve((res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : (_res$data7$series = _res$data7.series) === null || _res$data7$series === void 0 ? void 0 : (_res$data7$series$ = _res$data7$series[0]) === null || _res$data7$series$ === void 0 ? void 0 : (_res$data7$series$$va = _res$data7$series$.values) === null || _res$data7$series$$va === void 0 ? void 0 : _res$data7$series$$va[0]) || 0);
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
500
|
};
|
|
501
|
-
var getPageView = function getPageView(params) {
|
|
502
|
-
return new Promise(function (resolve, reject) {
|
|
503
|
-
// console.log(eventNameMap);
|
|
504
|
-
var haveEventName = eventNameMap === null || eventNameMap === void 0 ? void 0 : eventNameMap[params.name];
|
|
505
|
-
if (haveEventName) {
|
|
506
|
-
var haveFilter = haveEventName.attrList.filter(function (m) {
|
|
507
|
-
var _params$attrs$filters;
|
|
508
|
-
return (_params$attrs$filters = params.attrs.filters) === null || _params$attrs$filters === void 0 ? void 0 : _params$attrs$filters.includes(m.label);
|
|
509
|
-
});
|
|
510
|
-
var pinParams = [];
|
|
511
|
-
haveFilter.forEach(function (o) {
|
|
512
|
-
pinParams.push({
|
|
513
|
-
propCategory: 'eventProp',
|
|
514
|
-
type: 1,
|
|
515
|
-
attrId: o.id,
|
|
516
|
-
attrName: o.label
|
|
517
|
-
});
|
|
518
|
-
});
|
|
519
|
-
// console.log(pinParams, 'pinParams');
|
|
520
|
-
var pageId = haveEventName.attrList.filter(function (m) {
|
|
521
|
-
return (m === null || m === void 0 ? void 0 : m.key) == params.attrs.page;
|
|
522
|
-
});
|
|
523
|
-
var resultParams = {
|
|
524
|
-
data: {
|
|
525
|
-
chartType: 'line',
|
|
526
|
-
module: 'insight',
|
|
527
|
-
userGroup: [0],
|
|
528
|
-
globalDimensions: pinParams,
|
|
529
|
-
targets: [{
|
|
530
|
-
alias: haveEventName.name,
|
|
531
|
-
filters: (currentMap === null || currentMap === void 0 ? void 0 : currentMap.filterJson) && JSON.parse(currentMap === null || currentMap === void 0 ? void 0 : currentMap.filterJson),
|
|
532
|
-
analysisDimension: {
|
|
533
|
-
analysisIndex: 'number'
|
|
534
|
-
},
|
|
535
|
-
eventGroupId: 0,
|
|
536
|
-
eventId: haveEventName.id,
|
|
537
|
-
eventName: haveEventName.name,
|
|
538
|
-
type: 'event'
|
|
539
|
-
}]
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
resolve(resultParams);
|
|
543
|
-
throw Error('用来终止循环的');
|
|
544
|
-
} else {
|
|
545
|
-
resolve(false);
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
};
|
|
549
501
|
return /*#__PURE__*/React.createElement(React.Fragment, null, loadingDetail ? (/*#__PURE__*/React.createElement(Spin, {
|
|
550
502
|
tip: "\u52A0\u8F7D\u4E2D"
|
|
551
503
|
})) : (currentTreeData === null || currentTreeData === void 0 ? void 0 : currentTreeData.pageAttrName) ? (/*#__PURE__*/React.createElement(Card, {
|
|
@@ -558,13 +510,13 @@ var RightDetail = function RightDetail(props) {
|
|
|
558
510
|
bordered: false,
|
|
559
511
|
extra: isEdit ? (/*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
560
512
|
onClick: function onClick() {
|
|
561
|
-
(currentTreeDetail === null || currentTreeDetail === void 0 ? void 0 : currentTreeDetail.pageUrl)
|
|
513
|
+
(currentTreeDetail === null || currentTreeDetail === void 0 ? void 0 : currentTreeDetail.pageUrl) ? setImageUrl([{
|
|
562
514
|
status: 'done',
|
|
563
515
|
// name: currentTreeDetail?.pageUrl,
|
|
564
516
|
name: '',
|
|
565
517
|
url: (currentTreeDetail === null || currentTreeDetail === void 0 ? void 0 : currentTreeDetail.pageUrl) && getImgUrl(currentTreeDetail === null || currentTreeDetail === void 0 ? void 0 : currentTreeDetail.pageUrl, '-99'),
|
|
566
518
|
uid: currentTreeDetail === null || currentTreeDetail === void 0 ? void 0 : currentTreeDetail.pagePath
|
|
567
|
-
}]);
|
|
519
|
+
}]) : setImageUrl([]);
|
|
568
520
|
setIsEdit(false);
|
|
569
521
|
}
|
|
570
522
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -152,7 +152,7 @@ var MapSetting = function MapSetting(props) {
|
|
|
152
152
|
value: searchName,
|
|
153
153
|
allowClear: true,
|
|
154
154
|
onChange: onChange
|
|
155
|
-
}), "\
|
|
155
|
+
}), "\u5171 ", mapData === null || mapData === void 0 ? void 0 : mapData.length, " \u6761"), /*#__PURE__*/React.createElement(Button, {
|
|
156
156
|
type: "primary",
|
|
157
157
|
onClick: function onClick() {
|
|
158
158
|
return setOpenMapAdd(true);
|
|
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
15
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
16
|
import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
|
|
17
17
|
import { Button, Form, Input } from 'antd';
|
|
18
|
-
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
18
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
19
|
import moment from 'moment';
|
|
20
20
|
import { getAppID } from '../../utils';
|
|
21
21
|
import './css/index.less';
|
|
@@ -32,22 +32,16 @@ var DataRealView = function DataRealView() {
|
|
|
32
32
|
var _useContext = useContext(BizGlobalDataContext),
|
|
33
33
|
currentApp = _useContext.currentApp,
|
|
34
34
|
currentUser = _useContext.currentUser;
|
|
35
|
-
var
|
|
35
|
+
var textStatus = useRef(false);
|
|
36
|
+
var _useState = useState([]),
|
|
36
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
oldList = _useState2[0],
|
|
39
|
+
setOldList = _useState2[1]; // 未筛选的数据
|
|
39
40
|
var _useState3 = useState([]),
|
|
40
41
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
-
list = _useState6[0],
|
|
46
|
-
setList = _useState6[1]; // 表格筛选完成的数据
|
|
47
|
-
var _useState7 = useState(null),
|
|
48
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
|
-
ws = _useState8[0],
|
|
50
|
-
setWs = _useState8[1];
|
|
42
|
+
list = _useState4[0],
|
|
43
|
+
setList = _useState4[1]; // 表格筛选完成的数据
|
|
44
|
+
var ws = useRef(null);
|
|
51
45
|
var _Form$useForm = Form.useForm(),
|
|
52
46
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
53
47
|
form = _Form$useForm2[0];
|
|
@@ -55,10 +49,10 @@ var DataRealView = function DataRealView() {
|
|
|
55
49
|
var eventName = Form.useWatch('eventName', form);
|
|
56
50
|
var searchUserId = Form.useWatch('searchUserId', form);
|
|
57
51
|
var filterData = Form.useWatch('filterData', form);
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
currentMessageObj =
|
|
61
|
-
setCurrentMessageObj =
|
|
52
|
+
var _useState5 = useState(),
|
|
53
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
54
|
+
currentMessageObj = _useState6[0],
|
|
55
|
+
setCurrentMessageObj = _useState6[1];
|
|
62
56
|
var initWebsocket = function initWebsocket(params) {
|
|
63
57
|
// 创建 WebSocket 连接
|
|
64
58
|
var socket = new WebSocket(webSocketUrl);
|
|
@@ -112,7 +106,7 @@ var DataRealView = function DataRealView() {
|
|
|
112
106
|
console.log('WebSocket disconnected:', event.reason);
|
|
113
107
|
};
|
|
114
108
|
// 设置 WebSocket
|
|
115
|
-
|
|
109
|
+
ws.current = socket;
|
|
116
110
|
};
|
|
117
111
|
var filterPro = function filterPro(str, event) {
|
|
118
112
|
// 定义正则表达式,匹配"$eid":"具体值"这种格式中的具体值部分
|
|
@@ -148,17 +142,17 @@ var DataRealView = function DataRealView() {
|
|
|
148
142
|
};
|
|
149
143
|
var handleRefresh = /*#__PURE__*/function () {
|
|
150
144
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
151
|
-
var params;
|
|
145
|
+
var _ws$current, params;
|
|
152
146
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
153
147
|
while (1) switch (_context.prev = _context.next) {
|
|
154
148
|
case 0:
|
|
155
|
-
|
|
156
|
-
if (
|
|
149
|
+
textStatus.current = !textStatus.current;
|
|
150
|
+
if (textStatus.current) {
|
|
157
151
|
_context.next = 5;
|
|
158
152
|
break;
|
|
159
153
|
}
|
|
160
|
-
ws === null ||
|
|
161
|
-
|
|
154
|
+
(_ws$current = ws.current) === null || _ws$current === void 0 ? void 0 : _ws$current.close(); // 停止刷新 关闭链接
|
|
155
|
+
ws.current = null;
|
|
162
156
|
return _context.abrupt("return");
|
|
163
157
|
case 5:
|
|
164
158
|
// const data = form.getFieldsValue(true); // 表单数据
|
|
@@ -181,15 +175,35 @@ var DataRealView = function DataRealView() {
|
|
|
181
175
|
}();
|
|
182
176
|
useEffect(function () {
|
|
183
177
|
// 组件挂载时执行的操作
|
|
184
|
-
console.log('组件挂载');
|
|
185
178
|
// 返回一个清理函数,在组件卸载时执行
|
|
186
179
|
return function () {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
180
|
+
// 模拟异步保存数据到本地存储
|
|
181
|
+
var unloadWs = /*#__PURE__*/function () {
|
|
182
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
183
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
184
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
185
|
+
case 0:
|
|
186
|
+
_context2.prev = 0;
|
|
187
|
+
_context2.next = 3;
|
|
188
|
+
return handleRefresh();
|
|
189
|
+
case 3:
|
|
190
|
+
_context2.next = 8;
|
|
191
|
+
break;
|
|
192
|
+
case 5:
|
|
193
|
+
_context2.prev = 5;
|
|
194
|
+
_context2.t0 = _context2["catch"](0);
|
|
195
|
+
console.error('websocket:', _context2.t0);
|
|
196
|
+
case 8:
|
|
197
|
+
case "end":
|
|
198
|
+
return _context2.stop();
|
|
199
|
+
}
|
|
200
|
+
}, _callee2, null, [[0, 5]]);
|
|
201
|
+
}));
|
|
202
|
+
return function unloadWs() {
|
|
203
|
+
return _ref2.apply(this, arguments);
|
|
204
|
+
};
|
|
205
|
+
}();
|
|
206
|
+
unloadWs();
|
|
193
207
|
};
|
|
194
208
|
}, []);
|
|
195
209
|
useMemo(function () {
|
|
@@ -273,12 +287,12 @@ var DataRealView = function DataRealView() {
|
|
|
273
287
|
}))), /*#__PURE__*/React.createElement(Button, {
|
|
274
288
|
type: "primary",
|
|
275
289
|
onClick: handleRefresh,
|
|
276
|
-
icon: textStatus ? /*#__PURE__*/React.createElement(IconFont, {
|
|
290
|
+
icon: textStatus.current ? /*#__PURE__*/React.createElement(IconFont, {
|
|
277
291
|
type: "zanting"
|
|
278
292
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
279
293
|
type: "bofang"
|
|
280
294
|
})
|
|
281
|
-
}, textStatus ? '停止刷新' : '开始刷新')), /*#__PURE__*/React.createElement("div", {
|
|
295
|
+
}, textStatus.current ? '停止刷新' : '开始刷新')), /*#__PURE__*/React.createElement("div", {
|
|
282
296
|
className: "".concat(classNameBase, "_table")
|
|
283
297
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
284
298
|
className: "".concat(classNameBase, "_table_tip")
|
|
@@ -13,15 +13,30 @@ var DataRealViewTable = function DataRealViewTable(_ref) {
|
|
|
13
13
|
title: '触发时间',
|
|
14
14
|
field: 'time',
|
|
15
15
|
width: 160,
|
|
16
|
-
sort: true
|
|
16
|
+
sort: true,
|
|
17
|
+
headerStyle: {
|
|
18
|
+
fontSize: 14,
|
|
19
|
+
color: '#021429',
|
|
20
|
+
fontWeight: 400
|
|
21
|
+
}
|
|
17
22
|
}, {
|
|
18
23
|
title: '事件名',
|
|
19
24
|
field: 'eventName',
|
|
20
|
-
width: 160
|
|
25
|
+
width: 160,
|
|
26
|
+
headerStyle: {
|
|
27
|
+
fontSize: 14,
|
|
28
|
+
color: '#021429',
|
|
29
|
+
fontWeight: 400
|
|
30
|
+
}
|
|
21
31
|
}, {
|
|
22
32
|
title: '用户ID',
|
|
23
33
|
field: 'userId',
|
|
24
|
-
width: 160
|
|
34
|
+
width: 160,
|
|
35
|
+
headerStyle: {
|
|
36
|
+
fontSize: 14,
|
|
37
|
+
color: '#021429',
|
|
38
|
+
fontWeight: 400
|
|
39
|
+
}
|
|
25
40
|
}, {
|
|
26
41
|
title: '数据',
|
|
27
42
|
field: 'data',
|
|
@@ -29,6 +44,11 @@ var DataRealViewTable = function DataRealViewTable(_ref) {
|
|
|
29
44
|
style: {
|
|
30
45
|
autoWrapText: true,
|
|
31
46
|
lineHeight: 30
|
|
47
|
+
},
|
|
48
|
+
headerStyle: {
|
|
49
|
+
fontSize: 14,
|
|
50
|
+
color: '#021429',
|
|
51
|
+
fontWeight: 400
|
|
32
52
|
}
|
|
33
53
|
// customRender(args: any) {
|
|
34
54
|
// const { dataValue } = args;
|
|
@@ -139,11 +159,16 @@ var DataRealViewTable = function DataRealViewTable(_ref) {
|
|
|
139
159
|
maxCharactersNumber: 1000000,
|
|
140
160
|
autoWrapText: true,
|
|
141
161
|
defaultHeaderRowHeight: 70,
|
|
142
|
-
|
|
143
|
-
defaultRowHeight: 470,
|
|
162
|
+
defaultRowHeight: 'auto',
|
|
163
|
+
// defaultRowHeight: 470,
|
|
144
164
|
enableLineBreak: true,
|
|
145
165
|
rowSeriesNumber: {
|
|
146
|
-
title: '序号'
|
|
166
|
+
title: '序号',
|
|
167
|
+
headerStyle: {
|
|
168
|
+
fontSize: 14,
|
|
169
|
+
color: '#021429',
|
|
170
|
+
fontWeight: 400
|
|
171
|
+
}
|
|
147
172
|
},
|
|
148
173
|
keyboardOptions: {
|
|
149
174
|
// 快捷键配置
|
|
@@ -151,7 +176,15 @@ var DataRealViewTable = function DataRealViewTable(_ref) {
|
|
|
151
176
|
copySelected: true,
|
|
152
177
|
pasteValueToCell: true
|
|
153
178
|
},
|
|
154
|
-
editor:
|
|
179
|
+
editor: function editor(args) {
|
|
180
|
+
var tempInput = document.createElement('input');
|
|
181
|
+
tempInput.value = args.value;
|
|
182
|
+
document.body.appendChild(tempInput);
|
|
183
|
+
tempInput.select();
|
|
184
|
+
document.execCommand('copy');
|
|
185
|
+
document.body.removeChild(tempInput);
|
|
186
|
+
return args.value;
|
|
187
|
+
},
|
|
155
188
|
autoFillWidth: true,
|
|
156
189
|
emptyTip: {
|
|
157
190
|
// 空数据提示
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.56-zhongyuan.
|
|
3
|
+
"version": "1.0.56-zhongyuan.16",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "es/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"umi-request": "^1.4.0",
|
|
58
58
|
"yorkie": "^2.0.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "cf1ddfc62eca28fb1a72b46209bb5778aede1b1c",
|
|
61
61
|
"gitHooks": {
|
|
62
62
|
"pre-commit": "lint-staged"
|
|
63
63
|
}
|