@zgfe/modules-dm 1.0.56-zhongyuan.10 → 1.0.56-zhongyuan.12
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/CutsModal.d.ts +0 -34
- package/es/modules/dataMap/component/leftTree.d.ts +0 -1
- package/es/modules/dataMap/component/leftTree.js +14 -37
- package/es/modules/dataMap/component/rightDetail.d.ts +1 -2
- package/es/modules/dataMap/component/rightDetail.js +141 -115
- package/es/modules/dataMap/component/selectAttr.d.ts +7 -0
- package/es/modules/dataMap/component/selectAttr.js +92 -0
- package/es/modules/dataMap/css/index.css +163 -193
- package/es/modules/dataMap/css/index.less +177 -210
- package/es/modules/dataMap/mapDetail.js +2 -11
- package/es/modules/dataMap/mapSetting.js +3 -15
- package/es/modules/dataReal/index1.js +47 -17
- package/package.json +64 -64
- package/es/modules/dataMap/component/rightDetail1.d.ts +0 -7
- package/es/modules/dataMap/component/rightDetail1.js +0 -643
- package/es/modules/dataMap/component/viewMapSetting.d.ts +0 -24
- package/es/modules/dataMap/component/viewMapSetting.js +0 -161
|
@@ -1,210 +1,177 @@
|
|
|
1
|
-
.maidianMapIndex {
|
|
2
|
-
height: 100%;
|
|
3
|
-
.info-upload-tip {
|
|
4
|
-
color: var(--io-N4-, #9aa1a9);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
.mapSetting {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
color:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
&
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
&
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.mapSetting_addMap_form {
|
|
182
|
-
.biz-attr-condition-group-handle {
|
|
183
|
-
display: none;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
.ziBackground {
|
|
187
|
-
.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
|
|
188
|
-
padding: 2px 3px;
|
|
189
|
-
background-color: #bad8ff7d;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.mapSetting {
|
|
194
|
-
.ant-dropdown-trigger.biz-select-handle.biz-condition-item-single-select {
|
|
195
|
-
position: relative;
|
|
196
|
-
background-color: transparent;
|
|
197
|
-
&::after {
|
|
198
|
-
position: absolute;
|
|
199
|
-
top: 0px;
|
|
200
|
-
left: 0;
|
|
201
|
-
display: inline-block;
|
|
202
|
-
width: 100%;
|
|
203
|
-
padding-top: 8px;
|
|
204
|
-
text-align: center;
|
|
205
|
-
vertical-align: middle;
|
|
206
|
-
background-color: white;
|
|
207
|
-
content: '是';
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
1
|
+
.maidianMapIndex {
|
|
2
|
+
height: 100%;
|
|
3
|
+
.info-upload-tip {
|
|
4
|
+
color: var(--io-N4-, #9aa1a9);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
.mapSetting {
|
|
8
|
+
&_search {
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: 1fr 100px;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
margin-bottom: 16px;
|
|
13
|
+
&_input {
|
|
14
|
+
width: 320px;
|
|
15
|
+
margin: 0px 10px 0px 0px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.ant-page-header {
|
|
19
|
+
padding-top: 0px;
|
|
20
|
+
padding-left: 0px;
|
|
21
|
+
}
|
|
22
|
+
&_addMap {
|
|
23
|
+
&_tip {
|
|
24
|
+
padding: 0px 0px 0px 16px;
|
|
25
|
+
color: #67727f;
|
|
26
|
+
line-height: 44px;
|
|
27
|
+
background: #f2f3f4;
|
|
28
|
+
}
|
|
29
|
+
&_propTitle {
|
|
30
|
+
padding: 0px 0px 0px 16px;
|
|
31
|
+
color: #67727f;
|
|
32
|
+
color: #354354;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
line-height: 32px;
|
|
35
|
+
background: #f2f3f4;
|
|
36
|
+
}
|
|
37
|
+
&_propTitleLeft {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
width: 58%;
|
|
40
|
+
text-align: left;
|
|
41
|
+
}
|
|
42
|
+
&_propTitleRight {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
width: 42%;
|
|
45
|
+
text-align: left;
|
|
46
|
+
}
|
|
47
|
+
&_propValueList {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
width: 100%;
|
|
51
|
+
margin-top: 8px;
|
|
52
|
+
.ant-form-item {
|
|
53
|
+
margin: 0px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
&_propValueflag {
|
|
57
|
+
display: inline-block;
|
|
58
|
+
margin: 0px 8px;
|
|
59
|
+
}
|
|
60
|
+
&_content {
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-template-columns: 1fr 30px 1fr;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
&_footer {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: flex-end;
|
|
69
|
+
}
|
|
70
|
+
&_closeIco {
|
|
71
|
+
margin: '0px 8px ';
|
|
72
|
+
color: '#9aa1a9';
|
|
73
|
+
vertical-align: 'middle';
|
|
74
|
+
&:hover {
|
|
75
|
+
color: red;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.leftTreePage {
|
|
81
|
+
background-color: white;
|
|
82
|
+
&_selectMap {
|
|
83
|
+
display: grid;
|
|
84
|
+
grid-gap: 10px;
|
|
85
|
+
grid-template-columns: 75px 1fr 60px;
|
|
86
|
+
align-items: center;
|
|
87
|
+
margin: 0px 0px 24px;
|
|
88
|
+
}
|
|
89
|
+
&_selectMap_setting {
|
|
90
|
+
margin-left: 10px;
|
|
91
|
+
color: #165dff;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
&_searchBtn {
|
|
95
|
+
width: 100%;
|
|
96
|
+
padding: 6px 0px;
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
border: 1px solid #ddd;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
}
|
|
101
|
+
&_searchBtn:hover {
|
|
102
|
+
color: #165dff;
|
|
103
|
+
border: 1px solid #165dff;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.dataMapDetail_echartDiv {
|
|
108
|
+
display: grid;
|
|
109
|
+
flex-wrap: wrap;
|
|
110
|
+
grid-gap: 20px;
|
|
111
|
+
grid-template-columns: repeat(2, 1fr);
|
|
112
|
+
align-items: center;
|
|
113
|
+
margin-top: 24px;
|
|
114
|
+
&_item {
|
|
115
|
+
display: grid;
|
|
116
|
+
grid-template-columns: 1fr 60px;
|
|
117
|
+
align-items: center;
|
|
118
|
+
padding: 16px;
|
|
119
|
+
background-color: #fafafb;
|
|
120
|
+
border: 1px solid #eee;
|
|
121
|
+
}
|
|
122
|
+
&_leftText {
|
|
123
|
+
display: inline-block;
|
|
124
|
+
margin-left: 8px;
|
|
125
|
+
color: #354354;
|
|
126
|
+
}
|
|
127
|
+
&_view {
|
|
128
|
+
color: #165dff;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.biz-attr-select-handle {
|
|
132
|
+
width: 100%;
|
|
133
|
+
max-width: 100%;
|
|
134
|
+
margin-bottom: 2px;
|
|
135
|
+
padding: 0;
|
|
136
|
+
}
|
|
137
|
+
.empty {
|
|
138
|
+
height: 100%;
|
|
139
|
+
color: #67727f;
|
|
140
|
+
text-align: center;
|
|
141
|
+
.empty-img {
|
|
142
|
+
display: block;
|
|
143
|
+
width: 200px;
|
|
144
|
+
margin: 0px auto;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.mapSetting_addMap_form {
|
|
149
|
+
.biz-attr-condition-group-handle {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
.ziBackground {
|
|
154
|
+
.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
|
|
155
|
+
padding: 2px 3px;
|
|
156
|
+
background-color: #bad8ff7d;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.mapSetting {
|
|
161
|
+
.ant-dropdown-trigger.biz-select-handle.biz-condition-item-single-select {
|
|
162
|
+
position: relative;
|
|
163
|
+
background-color: transparent;
|
|
164
|
+
&::after {
|
|
165
|
+
position: absolute;
|
|
166
|
+
top: 0px;
|
|
167
|
+
left: 0;
|
|
168
|
+
display: inline-block;
|
|
169
|
+
width: 100%;
|
|
170
|
+
padding-top: 8px;
|
|
171
|
+
text-align: center;
|
|
172
|
+
vertical-align: middle;
|
|
173
|
+
background-color: white;
|
|
174
|
+
content: '是';
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -23,13 +23,6 @@ var MapDetail = function MapDetail() {
|
|
|
23
23
|
var onCurrentMap = function onCurrentMap(value) {
|
|
24
24
|
setCurrentMap(value);
|
|
25
25
|
};
|
|
26
|
-
var _useState5 = useState(),
|
|
27
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
28
|
-
filterValue = _useState6[0],
|
|
29
|
-
setFilterValue = _useState6[1];
|
|
30
|
-
var onFilterValue = function onFilterValue(searchValue) {
|
|
31
|
-
setFilterValue(searchValue);
|
|
32
|
-
};
|
|
33
26
|
return /*#__PURE__*/React.createElement(Row, {
|
|
34
27
|
gutter: 24
|
|
35
28
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
@@ -40,14 +33,12 @@ var MapDetail = function MapDetail() {
|
|
|
40
33
|
}
|
|
41
34
|
}, /*#__PURE__*/React.createElement(LeftTree, {
|
|
42
35
|
onChangeTree: onChangeTree,
|
|
43
|
-
onCurrentMap: onCurrentMap
|
|
44
|
-
onFilterValue: onFilterValue
|
|
36
|
+
onCurrentMap: onCurrentMap
|
|
45
37
|
})), /*#__PURE__*/React.createElement(Col, {
|
|
46
38
|
span: 16
|
|
47
39
|
}, /*#__PURE__*/React.createElement(RightDetail, {
|
|
48
40
|
currentTreeData: currentTreeData && JSON.stringify(currentTreeData) != '{}' && currentTreeData,
|
|
49
|
-
currentMap: currentMap
|
|
50
|
-
filterValue: filterValue
|
|
41
|
+
currentMap: currentMap
|
|
51
42
|
})));
|
|
52
43
|
};
|
|
53
44
|
export default MapDetail;
|
|
@@ -9,7 +9,6 @@ import { LeftOutlined, SearchOutlined } from '@ant-design/icons';
|
|
|
9
9
|
import React, { useEffect, useState, useRef, useContext } from 'react';
|
|
10
10
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
11
11
|
import DrawerAdd from './component/drawerAdd';
|
|
12
|
-
import ViewMapSetting from './component/viewMapSetting';
|
|
13
12
|
import './css/index.less';
|
|
14
13
|
import apis from '../../constants/api';
|
|
15
14
|
import request from '../../utils/ajax';
|
|
@@ -30,7 +29,9 @@ var MapSetting = function MapSetting(props) {
|
|
|
30
29
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
30
|
openMapAdd = _useState4[0],
|
|
32
31
|
setOpenMapAdd = _useState4[1];
|
|
33
|
-
var currentMap = useRef(
|
|
32
|
+
var currentMap = useRef({
|
|
33
|
+
id: 0
|
|
34
|
+
});
|
|
34
35
|
var onChange = function onChange(e) {
|
|
35
36
|
setSearchName(e.currentTarget.value);
|
|
36
37
|
};
|
|
@@ -89,7 +90,6 @@ var MapSetting = function MapSetting(props) {
|
|
|
89
90
|
}, [searchName]);
|
|
90
91
|
var handleClose = function handleClose() {
|
|
91
92
|
setOpenMapAdd(false);
|
|
92
|
-
currentMap.current = undefined;
|
|
93
93
|
props.getList(searchName);
|
|
94
94
|
};
|
|
95
95
|
// 删除
|
|
@@ -110,14 +110,6 @@ var MapSetting = function MapSetting(props) {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
|
-
var _useState5 = useState(false),
|
|
114
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
115
|
-
openMapView = _useState6[0],
|
|
116
|
-
setOpenMapView = _useState6[1];
|
|
117
|
-
var handleViewClose = function handleViewClose() {
|
|
118
|
-
setOpenMapView(false);
|
|
119
|
-
currentMap.current = undefined;
|
|
120
|
-
};
|
|
121
113
|
return /*#__PURE__*/React.createElement("div", {
|
|
122
114
|
className: pageClassName
|
|
123
115
|
}, /*#__PURE__*/React.createElement(PageHeader, {
|
|
@@ -159,10 +151,6 @@ var MapSetting = function MapSetting(props) {
|
|
|
159
151
|
}), /*#__PURE__*/React.createElement(DrawerAdd, {
|
|
160
152
|
open: openMapAdd,
|
|
161
153
|
handleClose: handleClose
|
|
162
|
-
}), /*#__PURE__*/React.createElement(ViewMapSetting, {
|
|
163
|
-
open: openMapView,
|
|
164
|
-
handleClose: handleViewClose,
|
|
165
|
-
currentMap: currentMap.current
|
|
166
154
|
}));
|
|
167
155
|
};
|
|
168
156
|
export default MapSetting;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
4
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
5
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
6
2
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
7
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
4
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
9
5
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
7
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
8
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
9
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
10
10
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
11
|
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."); }
|
|
12
12
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -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, useState } from 'react';
|
|
18
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
19
19
|
import moment from 'moment';
|
|
20
20
|
import { getAppID } from '../../utils';
|
|
21
21
|
import './css/index.less';
|
|
@@ -25,6 +25,9 @@ var classNameBase = 'dataReal';
|
|
|
25
25
|
var webSocketUrl = "".concat(location.protocol == 'http:' ? 'ws' : 'wss', "://").concat(location.host, "/eventtracking/ws?type=realTime");
|
|
26
26
|
// const webSocketUrl = 'ws://172.31.31.50:19898/eventtracking/ws?type=realTime';
|
|
27
27
|
// 点击单元格 添加悬浮框 2。看宽度是否可自适应,可能需要适应大屏
|
|
28
|
+
function matchesFilterData(o, filterData) {
|
|
29
|
+
return new RegExp(_.escapeRegExp(filterData), 'i').test(JSON.stringify(o === null || o === void 0 ? void 0 : o.data));
|
|
30
|
+
}
|
|
28
31
|
var DataRealView = function DataRealView() {
|
|
29
32
|
var _useContext = useContext(BizGlobalDataContext),
|
|
30
33
|
currentApp = _useContext.currentApp,
|
|
@@ -52,6 +55,10 @@ var DataRealView = function DataRealView() {
|
|
|
52
55
|
var eventName = Form.useWatch('eventName', form);
|
|
53
56
|
var searchUserId = Form.useWatch('searchUserId', form);
|
|
54
57
|
var filterData = Form.useWatch('filterData', form);
|
|
58
|
+
var _useState9 = useState(),
|
|
59
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
60
|
+
currentMessageObj = _useState10[0],
|
|
61
|
+
setCurrentMessageObj = _useState10[1];
|
|
55
62
|
var initWebsocket = function initWebsocket(params) {
|
|
56
63
|
// 创建 WebSocket 连接
|
|
57
64
|
var socket = new WebSocket(webSocketUrl);
|
|
@@ -78,14 +85,23 @@ var DataRealView = function DataRealView() {
|
|
|
78
85
|
userId: (message === null || message === void 0 ? void 0 : (_message$detail3 = message.detail) === null || _message$detail3 === void 0 ? void 0 : (_message$detail3$ = _message$detail3[0]) === null || _message$detail3$ === void 0 ? void 0 : (_message$detail3$$pr = _message$detail3$.pr) === null || _message$detail3$$pr === void 0 ? void 0 : _message$detail3$$pr.$cuid) || filterPro('$cuid', event),
|
|
79
86
|
data: "".concat(JSON.stringify(message))
|
|
80
87
|
};
|
|
88
|
+
setCurrentMessageObj(obj);
|
|
89
|
+
// 最多为500条 超出去掉第一条
|
|
90
|
+
// setOldList((prev: any) => {
|
|
91
|
+
// if (prev.length <= 49) {
|
|
92
|
+
// return [obj, ...prev];
|
|
93
|
+
// }
|
|
94
|
+
// prev.pop();
|
|
95
|
+
// return [obj, ...prev];
|
|
96
|
+
// });
|
|
81
97
|
// 最多1000条数据
|
|
82
|
-
setOldList(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
98
|
+
// setOldList((prev: any) => {
|
|
99
|
+
// if (prev.length <= 200) {
|
|
100
|
+
// return [obj, ...prev];
|
|
101
|
+
// }
|
|
102
|
+
// prev.pop();
|
|
103
|
+
// return [obj, ...prev];
|
|
104
|
+
// });
|
|
89
105
|
};
|
|
90
106
|
// 监听错误事件
|
|
91
107
|
socket.onerror = function (error) {
|
|
@@ -163,11 +179,25 @@ var DataRealView = function DataRealView() {
|
|
|
163
179
|
return _ref.apply(this, arguments);
|
|
164
180
|
};
|
|
165
181
|
}();
|
|
182
|
+
useMemo(function () {
|
|
183
|
+
if (currentMessageObj) {
|
|
184
|
+
var _currentMessageObj$ev, _currentMessageObj$us, _currentMessageObj$us2;
|
|
185
|
+
var hasEventName = !eventName || (currentMessageObj === null || currentMessageObj === void 0 ? void 0 : (_currentMessageObj$ev = currentMessageObj.eventName) === null || _currentMessageObj$ev === void 0 ? void 0 : _currentMessageObj$ev.includes(eventName));
|
|
186
|
+
var hasUserId = !searchUserId || (currentMessageObj === null || currentMessageObj === void 0 ? void 0 : (_currentMessageObj$us = currentMessageObj.userId) === null || _currentMessageObj$us === void 0 ? void 0 : (_currentMessageObj$us2 = _currentMessageObj$us.toString()) === null || _currentMessageObj$us2 === void 0 ? void 0 : _currentMessageObj$us2.includes(searchUserId));
|
|
187
|
+
var hasFilterData = !filterData || matchesFilterData(currentMessageObj, filterData);
|
|
188
|
+
if (hasEventName && hasUserId && hasFilterData) {
|
|
189
|
+
setOldList(function (prev) {
|
|
190
|
+
if (prev.length < 51) {
|
|
191
|
+
return [currentMessageObj].concat(_toConsumableArray(prev));
|
|
192
|
+
}
|
|
193
|
+
prev.pop();
|
|
194
|
+
return [currentMessageObj].concat(_toConsumableArray(prev));
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}, [currentMessageObj]);
|
|
166
199
|
// 只取前50条
|
|
167
200
|
useEffect(function () {
|
|
168
|
-
function matchesFilterData(o, filterData) {
|
|
169
|
-
return new RegExp(_.escapeRegExp(filterData), 'i').test(JSON.stringify(o === null || o === void 0 ? void 0 : o.data));
|
|
170
|
-
}
|
|
171
201
|
function matchesSearchCriteria(oldList, eventName, searchUserId, filterData) {
|
|
172
202
|
return oldList.filter(function (o) {
|
|
173
203
|
var _o$eventName, _o$userId, _o$userId$toString;
|
|
@@ -178,8 +208,8 @@ var DataRealView = function DataRealView() {
|
|
|
178
208
|
});
|
|
179
209
|
}
|
|
180
210
|
var newList = matchesSearchCriteria(oldList, eventName, searchUserId, filterData);
|
|
181
|
-
|
|
182
|
-
setList(
|
|
211
|
+
// const aa = newList?.slice(0, 50);
|
|
212
|
+
setList(newList);
|
|
183
213
|
}, [eventName, searchUserId, oldList, filterData]);
|
|
184
214
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
185
215
|
className: classNameBase
|