@zgfe/modules-event 0.0.2-event.9 → 0.1.0
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/eventFilter/index.js +49 -20
- package/es/components/eventFilter/styles/index.less +6 -3
- package/es/components/eventFilter/types.d.ts +4 -0
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/renderContent/index.d.ts +1 -1
- package/es/components/renderContent/index.js +19 -18
- package/es/components/renderContent/styles/index.less +3 -8
- package/es/components/renderContent/types.d.ts +0 -1
- package/es/components/searchPanel/index.js +24 -6
- package/es/components/searchPanel/types.d.ts +2 -0
- package/es/components/table/index.js +16 -20
- package/es/components/table/styles/index.less +67 -6
- package/es/components/table/types.d.ts +1 -0
- package/es/components/topBar/index.js +42 -27
- package/es/components/topBar/styles/index.less +14 -0
- package/es/components/topBar/types.d.ts +4 -1
- package/es/constants/fields.js +4 -4
- package/es/modules/chart/index.d.ts +1 -1
- package/es/modules/chart/index.js +53 -41
- package/es/modules/chart/types.d.ts +1 -0
- package/es/modules/content/index.js +72 -57
- package/es/modules/content/types.d.ts +1 -2
- package/es/modules/content/utils.d.ts +6 -1
- package/es/modules/content/utils.js +30 -3
- package/es/modules/home/demo/create.js +10 -2
- package/es/modules/home/demo/edit.js +56 -32
- package/es/modules/home/demo/index.js +4 -0
- package/es/modules/home/demo/scene.js +4 -0
- package/es/modules/home/index.js +67 -34
- package/es/modules/home/styles/index.less +7 -2
- package/es/modules/home/types.d.ts +5 -0
- package/es/modules/topPanel/index.js +39 -31
- package/es/modules/topPanel/styles/index.less +11 -1
- package/es/modules/topPanel/types.d.ts +7 -4
- package/es/style/index.less +6 -3
- package/es/types.d.ts +2 -0
- package/es/utils/formData.d.ts +8 -1
- package/es/utils/formData.js +146 -27
- package/package.json +3 -3
- package/es/components/common/index.d.ts +0 -6
- package/es/components/common/index.js +0 -17
- package/es/components/common/styles/index.less +0 -27
- package/es/components/table/images/empty.png +0 -0
- package/es/style/image/noData.png +0 -0
package/es/utils/formData.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { util, IconFont } from '@zgfe/business-lib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { message } from 'antd';
|
|
4
|
+
import _ from 'lodash';
|
|
4
5
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
5
6
|
import { chartColors } from '../constants/color';
|
|
6
7
|
import { PropCategory } from '@zgfe/business-lib/es/attributeSelector/types';
|
|
@@ -8,7 +9,7 @@ import { Tooltip } from 'antd';
|
|
|
8
9
|
import '../style/index.less';
|
|
9
10
|
import { getValue } from '../modules/content/utils';
|
|
10
11
|
var classPrefix = 'event-form-data';
|
|
11
|
-
export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, userGroup, searchData, showList, onShowCallback, onClickToDetailCallback) {
|
|
12
|
+
export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, userGroup, searchData, showList, onShowCallback, onClickToDetailCallback, onSelectEvent) {
|
|
12
13
|
var marketEventNameList = marketEventGroupList(eventGroupList);
|
|
13
14
|
var data = [{
|
|
14
15
|
title: '显示',
|
|
@@ -58,46 +59,71 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
58
59
|
ellipsis: true,
|
|
59
60
|
fixed: true,
|
|
60
61
|
render: function render(val) {
|
|
61
|
-
return /*#__PURE__*/React.createElement(
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "tooltip-name-box"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
62
65
|
title: val
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "tooltip-name-box-market"
|
|
63
68
|
}, util.strMiddleSplit(val, {
|
|
64
|
-
maxLength:
|
|
65
|
-
beginLength:
|
|
66
|
-
endLength:
|
|
69
|
+
maxLength: 9,
|
|
70
|
+
beginLength: 9,
|
|
71
|
+
endLength: 0,
|
|
67
72
|
replaceStr: '...'
|
|
68
|
-
}))
|
|
73
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
74
|
+
title: "\u590D\u5236"
|
|
75
|
+
}, /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
76
|
+
text: val,
|
|
77
|
+
onCopy: function onCopy() {
|
|
78
|
+
return message.success('复制成功!');
|
|
79
|
+
}
|
|
80
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
81
|
+
type: "fuzhi1"
|
|
82
|
+
}))));
|
|
69
83
|
}
|
|
70
84
|
});
|
|
71
85
|
}
|
|
72
86
|
if (searchData.id && !searchData.dimension || !searchData.id) {
|
|
73
87
|
data.push({
|
|
74
|
-
title:
|
|
88
|
+
title: /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
style: {
|
|
90
|
+
paddingLeft: '16px'
|
|
91
|
+
}
|
|
92
|
+
}, "\u4E8B\u4EF6"),
|
|
75
93
|
width: 150,
|
|
76
94
|
dataIndex: 'eventName',
|
|
77
95
|
key: 'eventName',
|
|
78
96
|
ellipsis: true,
|
|
79
97
|
fixed: true,
|
|
80
98
|
render: function render(val) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
99
|
+
var _val = val;
|
|
100
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: "tooltip-name-box"
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
103
|
+
title: _val
|
|
84
104
|
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
-
className: "
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
105
|
+
className: "tooltip-name-box-market",
|
|
106
|
+
onClick: function onClick() {
|
|
107
|
+
onSelectEvent && onSelectEvent(getEventAliasId(val, eventGroupList), val);
|
|
108
|
+
}
|
|
109
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
110
|
+
type: "shoucang",
|
|
111
|
+
className: "".concat(marketEventNameList.indexOf(_val) === -1 ? 'notshoucang' : '')
|
|
112
|
+
}), util.strMiddleSplit(_val, {
|
|
113
|
+
maxLength: 9,
|
|
114
|
+
beginLength: 9,
|
|
115
|
+
endLength: 0,
|
|
92
116
|
replaceStr: '...'
|
|
93
|
-
})), /*#__PURE__*/React.createElement(
|
|
94
|
-
|
|
117
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
118
|
+
title: "\u590D\u5236"
|
|
119
|
+
}, /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
120
|
+
text: _val,
|
|
95
121
|
onCopy: function onCopy() {
|
|
96
122
|
return message.success('复制成功!');
|
|
97
123
|
}
|
|
98
124
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
99
125
|
type: "fuzhi1"
|
|
100
|
-
})));
|
|
126
|
+
}))));
|
|
101
127
|
}
|
|
102
128
|
});
|
|
103
129
|
}
|
|
@@ -127,12 +153,13 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
127
153
|
return a["field".concat(i)] - b["field".concat(i)];
|
|
128
154
|
},
|
|
129
155
|
render: function render(text, record) {
|
|
156
|
+
var click = text > 0 && (searchData.analysisIndex === 'number' ? true : false);
|
|
130
157
|
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
-
className: "".concat(classPrefix, "-table-td-link"),
|
|
158
|
+
className: "".concat(classPrefix, "-table-td-link ").concat(click ? '' : 'not-to-detail'),
|
|
132
159
|
onClick: function onClick() {
|
|
133
|
-
|
|
160
|
+
click ? onClickToDetailCallback(record, columnData[i], text) : null;
|
|
134
161
|
}
|
|
135
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
162
|
+
}, click && /*#__PURE__*/React.createElement(IconFont, {
|
|
136
163
|
type: "a-yanjingkai"
|
|
137
164
|
}), text);
|
|
138
165
|
}
|
|
@@ -143,6 +170,75 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
143
170
|
}
|
|
144
171
|
return data;
|
|
145
172
|
}
|
|
173
|
+
export function getChartDataEventAliasName(dataSource, eventGroupList) {
|
|
174
|
+
var data = _.cloneDeep(dataSource);
|
|
175
|
+
var series = [];
|
|
176
|
+
data.series.map(function (item) {
|
|
177
|
+
item.originalNames = item.names;
|
|
178
|
+
item.names = item.names.length > 1 ? [item.names[0], getEventAliasName(item.names[1], eventGroupList)] : [getEventAliasName(item.names[0], eventGroupList)];
|
|
179
|
+
series.push(item);
|
|
180
|
+
});
|
|
181
|
+
data.series = series;
|
|
182
|
+
return data;
|
|
183
|
+
}
|
|
184
|
+
export function getEventAliasName(name, eventGroupList) {
|
|
185
|
+
var aliasName = '';
|
|
186
|
+
eventGroupList && eventGroupList.map(function (item) {
|
|
187
|
+
item.eventList.map(function (_item) {
|
|
188
|
+
if (_item.name === name) {
|
|
189
|
+
aliasName = _item.alias ? _item.alias : name;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
return aliasName;
|
|
194
|
+
}
|
|
195
|
+
export function getEventAliasId(name, eventGroupList) {
|
|
196
|
+
var eventId = -1;
|
|
197
|
+
eventGroupList && eventGroupList.map(function (item) {
|
|
198
|
+
item.eventList.map(function (_item) {
|
|
199
|
+
if (_item.name === name) {
|
|
200
|
+
eventId = _item.id;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
return eventId;
|
|
205
|
+
}
|
|
206
|
+
export function getSortData(data) {
|
|
207
|
+
var series = data.series;
|
|
208
|
+
var sort = function sort(obj1, obj2) {
|
|
209
|
+
var val1 = obj1.values[0];
|
|
210
|
+
var val2 = obj2.values[0];
|
|
211
|
+
if (val1 < val2) {
|
|
212
|
+
return 1;
|
|
213
|
+
} else if (val1 > val2) {
|
|
214
|
+
return -1;
|
|
215
|
+
} else {
|
|
216
|
+
return 0;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
series.sort(sort);
|
|
220
|
+
return data;
|
|
221
|
+
}
|
|
222
|
+
export function getUserGroupsCompareData(data) {
|
|
223
|
+
if (data.series.length <= 0) {
|
|
224
|
+
return data;
|
|
225
|
+
} else {
|
|
226
|
+
var _data = _.cloneDeep(data);
|
|
227
|
+
var _series = [];
|
|
228
|
+
_data.series.map(function (item, index) {
|
|
229
|
+
_series.push(item);
|
|
230
|
+
_data.series.map(function (_item, _index) {
|
|
231
|
+
if (item.names[1] === _item.names[1] && index !== _index) {
|
|
232
|
+
_series.push(_item);
|
|
233
|
+
delete _data.series[_index];
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
delete _data.series[index];
|
|
237
|
+
});
|
|
238
|
+
_data.series = _series;
|
|
239
|
+
return _data;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
146
242
|
export function marketEventGroupList(eventGroupList) {
|
|
147
243
|
var _marketName = [];
|
|
148
244
|
eventGroupList && eventGroupList.map(function (item) {
|
|
@@ -150,9 +246,28 @@ export function marketEventGroupList(eventGroupList) {
|
|
|
150
246
|
if (_item.marked) _marketName.push(_item.name);
|
|
151
247
|
});
|
|
152
248
|
});
|
|
153
|
-
console.log(666, _marketName);
|
|
154
249
|
return _marketName;
|
|
155
250
|
}
|
|
251
|
+
export function getWarningId(searchData, eventData, eventGroupList) {
|
|
252
|
+
var id = -1;
|
|
253
|
+
if (eventData && eventData.series.length > 0) {
|
|
254
|
+
if (searchData === null || searchData === void 0 ? void 0 : searchData.id) {
|
|
255
|
+
id = searchData === null || searchData === void 0 ? void 0 : searchData.id;
|
|
256
|
+
} else {
|
|
257
|
+
if (eventGroupList && eventGroupList.length > 0 && eventData) {
|
|
258
|
+
eventGroupList.map(function (item) {
|
|
259
|
+
item.eventList.map(function (_item) {
|
|
260
|
+
var _name = eventData.series[0].names[searchData.userGroup.length > 1 ? 1 : 0];
|
|
261
|
+
if (_item.name === _name || _item.alias === _name) {
|
|
262
|
+
id = _item.id;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return id;
|
|
270
|
+
}
|
|
156
271
|
export function getAttrLabel(attrData, eventGroupList, userPropList, eventEnvList) {
|
|
157
272
|
if (!attrData) return;
|
|
158
273
|
var type = attrData.propCategory;
|
|
@@ -185,7 +300,9 @@ export function formTableData(originalData, userGroups, attrNum, showList) {
|
|
|
185
300
|
series.forEach(function (item, index) {
|
|
186
301
|
var _item$names = item.names,
|
|
187
302
|
names = _item$names === void 0 ? [] : _item$names,
|
|
188
|
-
values = item.values
|
|
303
|
+
values = item.values,
|
|
304
|
+
_item$originalNames = item.originalNames,
|
|
305
|
+
originalNames = _item$originalNames === void 0 ? [] : _item$originalNames;
|
|
189
306
|
var nameStr = names.join(',');
|
|
190
307
|
if (showList) {
|
|
191
308
|
if (!showList.includes(nameStr)) {
|
|
@@ -195,6 +312,7 @@ export function formTableData(originalData, userGroups, attrNum, showList) {
|
|
|
195
312
|
var len = names.length;
|
|
196
313
|
var haveUserGroup = userGroups.length > 1 || userGroups[0] !== 0;
|
|
197
314
|
var name = names[len - 1];
|
|
315
|
+
var originalName = originalNames[len - 1];
|
|
198
316
|
var userGroup = haveUserGroup ? names[len - 2] : '所有用户';
|
|
199
317
|
var nameGroup = names.join(',');
|
|
200
318
|
var color = chartColors[index % 20];
|
|
@@ -206,9 +324,10 @@ export function formTableData(originalData, userGroups, attrNum, showList) {
|
|
|
206
324
|
color: color
|
|
207
325
|
};
|
|
208
326
|
if (attrNum) {
|
|
209
|
-
data["dimension"] =
|
|
327
|
+
data["dimension"] = name;
|
|
210
328
|
} else {
|
|
211
|
-
data["eventName"] =
|
|
329
|
+
data["eventName"] = name;
|
|
330
|
+
data["originalName"] = originalName;
|
|
212
331
|
}
|
|
213
332
|
values.forEach(function (item, index) {
|
|
214
333
|
data["field".concat(index)] = item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-event",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/lodash": "^4.14.191",
|
|
37
37
|
"@umijs/fabric": "^2.8.1",
|
|
38
38
|
"@umijs/test": "^3.0.5",
|
|
39
|
-
"@zgfe/business-lib": "1.1.
|
|
39
|
+
"@zgfe/business-lib": "1.1.84-panel.18",
|
|
40
40
|
"antd": "^4.22.6",
|
|
41
41
|
"dumi": "^1.1.0",
|
|
42
42
|
"echarts": "^5.3.2",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react": "^16.12.0 || ^17.0.0",
|
|
50
50
|
"yorkie": "^2.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "24eca66c4f0a78342871fa4b6e4aba238d7d5034",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"react-copy-to-clipboard": "^5.1.0",
|
|
55
55
|
"react-highlight": "^0.15.0"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './styles/index.less';
|
|
3
|
-
var classPrefix = 'mi-common';
|
|
4
|
-
export var MiSpin = function MiSpin() {
|
|
5
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
-
className: "".concat(classPrefix, "-loading-icon")
|
|
7
|
-
});
|
|
8
|
-
};
|
|
9
|
-
export var MiNone = function MiNone(props) {
|
|
10
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
-
className: "".concat(classPrefix, "-none-container")
|
|
12
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
-
className: "".concat(classPrefix, "-none")
|
|
14
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
15
|
-
className: "".concat(classPrefix, "-none-text")
|
|
16
|
-
}, " ", props.label));
|
|
17
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
|
-
|
|
3
|
-
.mi-common {
|
|
4
|
-
&-loading-icon {
|
|
5
|
-
z-index: 1000;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
width: 40px;
|
|
8
|
-
height: 40px;
|
|
9
|
-
background: url('../../../style/image/ring.svg') no-repeat;
|
|
10
|
-
background-size: contain;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&-none-text {
|
|
14
|
-
color: @text-color;
|
|
15
|
-
font-size: 16px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&-none {
|
|
19
|
-
width: 348px;
|
|
20
|
-
height: 132px;
|
|
21
|
-
background: url('../../../style/image/noData.png') no-repeat;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&-none-container {
|
|
25
|
-
text-align: center;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
Binary file
|
|
Binary file
|