@zgfe/modules-event 1.0.7 → 1.0.29-zhongyuan.10
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/README.md +35 -35
- package/es/components/eventFilter/index.js +68 -20
- package/es/components/eventFilter/setCascade.d.ts +3 -0
- package/es/components/eventFilter/setCascade.js +286 -0
- package/es/components/eventFilter/styles/index.less +148 -36
- package/es/components/renderContent/index.js +14 -25
- package/es/components/renderContent/styles/index.less +19 -19
- package/es/components/renderContent/types.d.ts +0 -1
- package/es/components/searchPanel/index.js +19 -6
- package/es/components/searchPanel/styles/index.less +22 -18
- package/es/components/searchPanel/types.d.ts +2 -2
- package/es/components/table/index.js +60 -9
- package/es/components/table/styles/index.less +241 -193
- package/es/components/table/types.d.ts +0 -1
- package/es/components/topBar/index.d.ts +6 -1
- package/es/components/topBar/index.js +39 -22
- package/es/components/topBar/styles/index.less +58 -63
- package/es/components/topBar/types.d.ts +0 -1
- package/es/constants/apis.d.ts +3 -1
- package/es/constants/apis.js +4 -2
- package/es/constants/fields.d.ts +0 -14
- package/es/constants/fields.js +1 -45
- package/es/modules/chart/demo/panel.js +7 -2
- package/es/modules/chart/index.js +105 -36
- package/es/modules/chart/types.d.ts +3 -0
- package/es/modules/content/index.d.ts +1 -1
- package/es/modules/content/index.js +94 -55
- package/es/modules/content/styles/index.less +19 -7
- package/es/modules/content/utils.d.ts +1 -1
- package/es/modules/content/utils.js +21 -19
- package/es/modules/home/demo/edit.js +6 -7
- package/es/modules/home/demo/index.js +1 -1
- package/es/modules/home/demo/styles/index.less +33 -33
- package/es/modules/home/index.js +53 -35
- package/es/modules/home/styles/index.less +49 -49
- package/es/modules/topPanel/index.js +36 -8
- package/es/modules/topPanel/styles/index.less +50 -49
- package/es/style/image/ring.svg +8 -8
- package/es/style/index.less +62 -62
- package/es/types.d.ts +6 -0
- package/es/utils/formData.d.ts +2 -1
- package/es/utils/formData.js +63 -16
- package/package.json +24 -20
|
@@ -1,63 +1,58 @@
|
|
|
1
|
-
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
|
-
|
|
3
|
-
.modules-event-topbar {
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content:
|
|
6
|
-
margin: 8px 0;
|
|
7
|
-
padding
|
|
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
|
-
border:
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
margin-left: -1px;
|
|
60
|
-
border-radius: 0 4px 4px 0;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
|
+
|
|
3
|
+
.modules-event-topbar {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
margin: 8px 0;
|
|
7
|
+
padding: 0 16px;
|
|
8
|
+
&-title {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
.fanhuiicon {
|
|
12
|
+
margin-right: 8px;
|
|
13
|
+
color: #5f6085;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
> span {
|
|
17
|
+
color: var(--io-N-, #021429);
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-family: 'PingFang SC';
|
|
21
|
+
font-style: normal;
|
|
22
|
+
line-height: 20px; /* 125% */
|
|
23
|
+
letter-spacing: 0.016px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
&-right {
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: flex-end;
|
|
29
|
+
}
|
|
30
|
+
&-panel {
|
|
31
|
+
margin-right: 16px;
|
|
32
|
+
.ant-btn {
|
|
33
|
+
background: #fff;
|
|
34
|
+
border-color: #f2f3f4;
|
|
35
|
+
}
|
|
36
|
+
.ant-btn:hover {
|
|
37
|
+
border-color: #165dff;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
&-scene {
|
|
41
|
+
margin-right: 16px;
|
|
42
|
+
.ant-btn {
|
|
43
|
+
background: #fff;
|
|
44
|
+
border-color: #f2f3f4;
|
|
45
|
+
}
|
|
46
|
+
.ant-btn:hover {
|
|
47
|
+
border-color: #165dff;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
&-earlywarning {
|
|
51
|
+
margin-right: 16px;
|
|
52
|
+
}
|
|
53
|
+
&-platform {
|
|
54
|
+
display: flex;
|
|
55
|
+
height: 32px;
|
|
56
|
+
line-height: 32px;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/es/constants/apis.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ declare const Apis: {
|
|
|
2
2
|
dataList: string;
|
|
3
3
|
getEventDataSql: string;
|
|
4
4
|
eventDownloadReport: string;
|
|
5
|
-
queryAllSubjectApi: string;
|
|
6
5
|
querySubDisplayApi: string;
|
|
6
|
+
relationSaveConfig: string;
|
|
7
|
+
queryRelationConfig: string;
|
|
8
|
+
getEventSwitch: string;
|
|
7
9
|
};
|
|
8
10
|
export default Apis;
|
package/es/constants/apis.js
CHANGED
|
@@ -2,7 +2,9 @@ var Apis = {
|
|
|
2
2
|
dataList: '/zg/web/v2/data/eventDataList',
|
|
3
3
|
getEventDataSql: '/zg/web/v2/dataSql/getEventDataSql',
|
|
4
4
|
eventDownloadReport: '/zg/web/v2/data/eventDownloadReport',
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
querySubDisplayApi: '/zg/web/v2/analysisSubject/querySubDisplay',
|
|
6
|
+
relationSaveConfig: '/zg/web/v2/event/relation/saveConfig',
|
|
7
|
+
queryRelationConfig: '/zg/web/v2/event/queryRelationConfig',
|
|
8
|
+
getEventSwitch: '/zg/web/v2/event/getEventSwitch'
|
|
7
9
|
};
|
|
8
10
|
export default Apis;
|
package/es/constants/fields.d.ts
CHANGED
|
@@ -249,17 +249,3 @@ export declare const addSceneFields: ({
|
|
|
249
249
|
options?: undefined;
|
|
250
250
|
fieldNames?: undefined;
|
|
251
251
|
})[];
|
|
252
|
-
export declare const indexObject: {
|
|
253
|
-
[key: string]: string;
|
|
254
|
-
};
|
|
255
|
-
export declare const BuiltinIndicators: {
|
|
256
|
-
id: number;
|
|
257
|
-
name: string;
|
|
258
|
-
eventList: {
|
|
259
|
-
name: string;
|
|
260
|
-
id: number;
|
|
261
|
-
type: string;
|
|
262
|
-
isBuiltIn: boolean;
|
|
263
|
-
attrList: never[];
|
|
264
|
-
}[];
|
|
265
|
-
};
|
package/es/constants/fields.js
CHANGED
|
@@ -174,48 +174,4 @@ export var addSceneFields = [{
|
|
|
174
174
|
required: true,
|
|
175
175
|
message: '请输入场景名称'
|
|
176
176
|
}]
|
|
177
|
-
}];
|
|
178
|
-
export var indexObject = {
|
|
179
|
-
number: '人数',
|
|
180
|
-
times: '次数',
|
|
181
|
-
per: '人均次数',
|
|
182
|
-
sum: '总和',
|
|
183
|
-
avg: '均值',
|
|
184
|
-
duration_times: '分布',
|
|
185
|
-
median: '中位数'
|
|
186
|
-
};
|
|
187
|
-
export var BuiltinIndicators = {
|
|
188
|
-
id: -2,
|
|
189
|
-
name: '整体',
|
|
190
|
-
eventList: [{
|
|
191
|
-
name: '新增用户',
|
|
192
|
-
id: -201,
|
|
193
|
-
type: 'add',
|
|
194
|
-
isBuiltIn: true,
|
|
195
|
-
attrList: []
|
|
196
|
-
}, {
|
|
197
|
-
name: '活跃用户',
|
|
198
|
-
id: -202,
|
|
199
|
-
type: 'active',
|
|
200
|
-
isBuiltIn: true,
|
|
201
|
-
attrList: []
|
|
202
|
-
}, {
|
|
203
|
-
name: '访问次数',
|
|
204
|
-
id: -203,
|
|
205
|
-
type: 'times',
|
|
206
|
-
isBuiltIn: true,
|
|
207
|
-
attrList: []
|
|
208
|
-
}, {
|
|
209
|
-
name: '平均使用时长',
|
|
210
|
-
id: -204,
|
|
211
|
-
type: 'duration_avg',
|
|
212
|
-
isBuiltIn: true,
|
|
213
|
-
attrList: []
|
|
214
|
-
}, {
|
|
215
|
-
name: '使用时长分布',
|
|
216
|
-
id: -205,
|
|
217
|
-
type: 'duration',
|
|
218
|
-
isBuiltIn: true,
|
|
219
|
-
attrList: []
|
|
220
|
-
}]
|
|
221
|
-
};
|
|
177
|
+
}];
|
|
@@ -4,8 +4,13 @@ import { searchData, totalResult, totalSearchData } from './data';
|
|
|
4
4
|
export default (function () {
|
|
5
5
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "\u8D8B\u52BF\u56FE\u8868\u683C"), /*#__PURE__*/React.createElement(EventChart, {
|
|
6
6
|
params: searchData
|
|
7
|
-
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("h2", null, "\u6C47\u603B\u56FE\u8868\u683C"), /*#__PURE__*/React.createElement(
|
|
7
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("h2", null, "\u6C47\u603B\u56FE\u8868\u683C"), /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
style: {
|
|
9
|
+
width: 500,
|
|
10
|
+
height: 500
|
|
11
|
+
}
|
|
12
|
+
}, /*#__PURE__*/React.createElement(EventChart, {
|
|
8
13
|
dataSource: totalResult,
|
|
9
14
|
params: totalSearchData
|
|
10
|
-
}));
|
|
15
|
+
})));
|
|
11
16
|
});
|
|
@@ -12,42 +12,46 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
14
14
|
import { Tooltip, Empty } from 'antd';
|
|
15
|
-
import { BizChart, BizGlobalDataContext, ajax, BizLoading } from '@zgfe/business-lib';
|
|
15
|
+
import { BizChart, BizGlobalDataContext, ajax, BizLoading, BizEmpty } from '@zgfe/business-lib';
|
|
16
16
|
import { EventTable } from '../../components';
|
|
17
17
|
import { judgeIsCity } from '../content/utils';
|
|
18
18
|
import { getValue, getMapChartData } from '../../modules/content/utils';
|
|
19
|
-
import {
|
|
19
|
+
import { getShowColor, getUserGroupsCompareData, getSortData, getChartDataEventAliasName, formTableData, sortOriginalData } from '../../utils/formData';
|
|
20
20
|
import _ from 'lodash';
|
|
21
21
|
import moment from 'moment';
|
|
22
22
|
import { Apis, chartColors } from '../../constants';
|
|
23
23
|
var classPrefix = 'event-mi-table';
|
|
24
24
|
var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
25
25
|
var params = props.params;
|
|
26
|
-
var _useState = useState(
|
|
26
|
+
var _useState = useState(props === null || props === void 0 ? void 0 : props.completedSearchData),
|
|
27
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var _useState3 = useState(
|
|
28
|
+
completedSearchData = _useState2[0],
|
|
29
|
+
setCompletedSearchData = _useState2[1];
|
|
30
|
+
var _useState3 = useState(false),
|
|
31
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _useState5 = useState(props.
|
|
32
|
+
isCity = _useState4[0],
|
|
33
|
+
setIsCity = _useState4[1];
|
|
34
|
+
var _useState5 = useState(props.type || 'line'),
|
|
35
35
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var _useState7 = useState(props.
|
|
36
|
+
chartType = _useState6[0],
|
|
37
|
+
setChartType = _useState6[1];
|
|
38
|
+
var _useState7 = useState(props.showList || []),
|
|
39
39
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
showList = _useState8[0],
|
|
41
|
+
setShowList = _useState8[1];
|
|
42
|
+
var _useState9 = useState(props.dataSource),
|
|
43
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
44
|
+
dataSource = _useState10[0],
|
|
45
|
+
setDataSource = _useState10[1];
|
|
42
46
|
var _useContext = useContext(BizGlobalDataContext),
|
|
43
|
-
currentApp = _useContext.currentApp,
|
|
44
47
|
eventGroupList = _useContext.eventGroupList,
|
|
45
48
|
eventEnvList = _useContext.eventEnvList,
|
|
46
|
-
userPropList = _useContext.userPropList
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
userPropList = _useContext.userPropList,
|
|
50
|
+
currentApp = _useContext.currentApp;
|
|
51
|
+
var _useState11 = useState(false),
|
|
52
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
53
|
+
loading = _useState12[0],
|
|
54
|
+
setLoading = _useState12[1];
|
|
51
55
|
var showColors = useMemo(function () {
|
|
52
56
|
if (!dataSource) return chartColors;
|
|
53
57
|
return getShowColor(dataSource, showList);
|
|
@@ -58,31 +62,46 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
58
62
|
}
|
|
59
63
|
}, [params]);
|
|
60
64
|
useEffect(function () {
|
|
65
|
+
if (!dataSource || !dataSource.series.length) return;
|
|
61
66
|
if (!props.showList || !props.showList.length) {
|
|
62
|
-
|
|
67
|
+
var _dataSource$series$;
|
|
68
|
+
var gLen = (params === null || params === void 0 ? void 0 : params.dimension) ? 1 : 0;
|
|
69
|
+
var _data = formTableData(dataSource, (params === null || params === void 0 ? void 0 : params.userGroup) || [0], gLen);
|
|
70
|
+
var _sortData = sortOriginalData(_data, {
|
|
71
|
+
columnKey: "field".concat(((_dataSource$series$ = dataSource.series[0]) === null || _dataSource$series$ === void 0 ? void 0 : _dataSource$series$.values.length) - 1),
|
|
72
|
+
order: 'descend'
|
|
73
|
+
});
|
|
74
|
+
var _showlist = [];
|
|
75
|
+
_sortData.forEach(function (item, index) {
|
|
76
|
+
if (index < 10) {
|
|
77
|
+
_showlist.push(item.nameGroup);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
setShowList(_showlist);
|
|
81
|
+
props.onChangeShow && props.onChangeShow(_showlist);
|
|
63
82
|
} else {
|
|
64
83
|
setShowList(props.showList);
|
|
65
84
|
}
|
|
66
|
-
}, [
|
|
85
|
+
}, [dataSource, props.showList]);
|
|
67
86
|
useEffect(function () {
|
|
68
|
-
var
|
|
69
|
-
if (!
|
|
70
|
-
var chartData = ((
|
|
87
|
+
var _completedSearchData$;
|
|
88
|
+
if (!completedSearchData) return;
|
|
89
|
+
var chartData = ((_completedSearchData$ = completedSearchData.chartType) === null || _completedSearchData$ === void 0 ? void 0 : _completedSearchData$.split(',')) || ['line'];
|
|
71
90
|
var type = chartData[0];
|
|
72
91
|
if (!props.dataSource) {
|
|
73
92
|
type = (chartData === null || chartData === void 0 ? void 0 : chartData.length) > 1 ? chartData[chartData.length - 1] : chartData[0];
|
|
74
93
|
}
|
|
75
94
|
setChartType(props.type || type);
|
|
76
|
-
if (
|
|
77
|
-
var dimensions =
|
|
95
|
+
if (completedSearchData.id) {
|
|
96
|
+
var dimensions = completedSearchData.dimension;
|
|
78
97
|
if (type === 'map' && dimensions) {
|
|
79
98
|
var _getValue;
|
|
80
99
|
setIsCity(judgeIsCity((_getValue = getValue(dimensions, eventGroupList, eventEnvList, userPropList)) === null || _getValue === void 0 ? void 0 : _getValue.name));
|
|
81
100
|
}
|
|
82
101
|
}
|
|
83
|
-
}, [
|
|
102
|
+
}, [completedSearchData, props.type]);
|
|
84
103
|
var fetchResult = function fetchResult() {
|
|
85
|
-
var _params$
|
|
104
|
+
var _params$chartType;
|
|
86
105
|
setLoading(true);
|
|
87
106
|
ajax(Apis.dataList, {
|
|
88
107
|
method: 'post',
|
|
@@ -90,9 +109,11 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
90
109
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
91
110
|
platform: (params === null || params === void 0 ? void 0 : params.platform) || 0
|
|
92
111
|
}, params), {}, {
|
|
93
|
-
chartType: (params === null || params === void 0 ? void 0 : (_params$
|
|
112
|
+
chartType: (params === null || params === void 0 ? void 0 : (_params$chartType = params.chartType) === null || _params$chartType === void 0 ? void 0 : _params$chartType.indexOf(',')) === -1 ? params === null || params === void 0 ? void 0 : params.chartType : 'grid'
|
|
94
113
|
})
|
|
95
114
|
}).then(function (res) {
|
|
115
|
+
var _params$userGroup;
|
|
116
|
+
setCompletedSearchData(params);
|
|
96
117
|
if (!res) {
|
|
97
118
|
setLoading(false);
|
|
98
119
|
return;
|
|
@@ -101,7 +122,7 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
101
122
|
if (['bar', 'pie', 'map'].indexOf(params.chartType) !== -1) {
|
|
102
123
|
_data = getSortData(_data);
|
|
103
124
|
}
|
|
104
|
-
if (params.userGroup.length > 1) {
|
|
125
|
+
if ((params === null || params === void 0 ? void 0 : params.userGroup) && (params === null || params === void 0 ? void 0 : (_params$userGroup = params.userGroup) === null || _params$userGroup === void 0 ? void 0 : _params$userGroup.length) > 1) {
|
|
105
126
|
setDataSource(getUserGroupsCompareData(_data));
|
|
106
127
|
} else {
|
|
107
128
|
setDataSource(_data);
|
|
@@ -117,16 +138,37 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
117
138
|
} else {
|
|
118
139
|
list.splice(index, 1);
|
|
119
140
|
}
|
|
141
|
+
setShowList(list);
|
|
120
142
|
if (props.onChangeShow) props.onChangeShow(list);
|
|
121
143
|
};
|
|
122
|
-
var onChangeShow = function onChangeShow(names) {
|
|
123
|
-
if (props.onChangeShow) props.onChangeShow(names);
|
|
124
|
-
};
|
|
125
144
|
if (loading) {
|
|
126
145
|
return /*#__PURE__*/React.createElement(BizLoading, {
|
|
127
146
|
className: "".concat(classPrefix, "-loading")
|
|
128
147
|
});
|
|
129
148
|
}
|
|
149
|
+
if (dataSource && dataSource.delEvent) {
|
|
150
|
+
if (!props.isHideDel) {
|
|
151
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
style: {
|
|
153
|
+
display: 'flex',
|
|
154
|
+
minHeight: 345,
|
|
155
|
+
justifyContent: 'center',
|
|
156
|
+
alignItems: 'center'
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/React.createElement(BizEmpty, {
|
|
159
|
+
imageStyle: {
|
|
160
|
+
height: 58
|
|
161
|
+
},
|
|
162
|
+
description: /*#__PURE__*/React.createElement("span", {
|
|
163
|
+
style: {
|
|
164
|
+
color: '#9AA1A9'
|
|
165
|
+
}
|
|
166
|
+
}, "\u4E8B\u4EF6\u5DF2\u88AB\u5220\u9664\u65E0\u6CD5\u67E5\u770B\uFF0C\u8BF7\u91CD\u65B0\u8BBE\u7F6E")
|
|
167
|
+
}));
|
|
168
|
+
} else {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
130
172
|
if (!dataSource || !dataSource.xAxis.length || !dataSource.series.length) {
|
|
131
173
|
return /*#__PURE__*/React.createElement(Empty, {
|
|
132
174
|
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
@@ -139,6 +181,33 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
139
181
|
title: '当前图表数据实时更新,约每分钟更新一次'
|
|
140
182
|
}, /*#__PURE__*/React.createElement("div", null, "\u6570\u636E\u66F4\u65B0\u65F6\u95F4\uFF1A", moment().format('YYYY-MM-DD HH:mm')));
|
|
141
183
|
};
|
|
184
|
+
var tooltipFormatter = function tooltipFormatter(params) {
|
|
185
|
+
var xLabel = '';
|
|
186
|
+
var array = params[0].name.split('|');
|
|
187
|
+
if (array.length > 1) {
|
|
188
|
+
xLabel = moment(array[0]).format('MM-DD') + '~' + moment(array[1]).format('MM-DD');
|
|
189
|
+
} else {
|
|
190
|
+
xLabel = moment(array[0]).isValid() ? moment(array[0]).format('MM-DD') : array[0];
|
|
191
|
+
}
|
|
192
|
+
var series = [];
|
|
193
|
+
var seriesMap = {};
|
|
194
|
+
params.forEach(function (item) {
|
|
195
|
+
if (item.value === null || item.value === undefined || seriesMap[item.seriesName] !== null && seriesMap[item.seriesName] !== undefined) return;
|
|
196
|
+
seriesMap[item.seriesName] = item.value;
|
|
197
|
+
var value = item.value;
|
|
198
|
+
var seriesName = item.seriesName || item.axisValueLabel;
|
|
199
|
+
seriesName = [seriesName].join('<br/>');
|
|
200
|
+
series.push({
|
|
201
|
+
text: "<div class='biz-chart-tooltip-item'>\n <div class='biz-chart-tooltip-content'>\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(item.color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(seriesName, "</div>\n </div> \n <div class='biz-chart-tooltip-value'>\n ").concat(value, "\n </div>\n </div>"),
|
|
202
|
+
value: value
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
return "<div class='biz-chart-tooltip-title'>".concat(xLabel, "</div>").concat(series.sort(function (a, b) {
|
|
206
|
+
return parseInt(b.value) - parseInt(a.value);
|
|
207
|
+
}).map(function (item) {
|
|
208
|
+
return item.text;
|
|
209
|
+
}).join(''));
|
|
210
|
+
};
|
|
142
211
|
switch (chartType) {
|
|
143
212
|
case 'line':
|
|
144
213
|
case 'bar':
|
|
@@ -156,7 +225,8 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
156
225
|
colors: showColors,
|
|
157
226
|
xRotate: chartType === 'bar' && dataSource.series.length > 5 ? 40 : 0,
|
|
158
227
|
reverseXAxis: chartType === 'bar',
|
|
159
|
-
isCity: isCity
|
|
228
|
+
isCity: isCity,
|
|
229
|
+
tooltipFormatter: tooltipFormatter
|
|
160
230
|
}));
|
|
161
231
|
case 'grid':
|
|
162
232
|
return /*#__PURE__*/React.createElement(EventTable, {
|
|
@@ -164,7 +234,6 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
164
234
|
sourcePanel: !props.dataSource,
|
|
165
235
|
searchData: params,
|
|
166
236
|
showList: showList,
|
|
167
|
-
changeShow: onChangeShow,
|
|
168
237
|
changeShowByName: onChangeShowByName,
|
|
169
238
|
onSelectEvent: props === null || props === void 0 ? void 0 : props.onSelectEvent
|
|
170
239
|
});
|
|
@@ -3,14 +3,17 @@ import { SearchValue } from '../../types';
|
|
|
3
3
|
export declare namespace eventChartProps {
|
|
4
4
|
interface ChartTypesProps extends ChartTypes.Value {
|
|
5
5
|
xAxis: [];
|
|
6
|
+
delEvent?: number;
|
|
6
7
|
}
|
|
7
8
|
interface Props {
|
|
8
9
|
dataSource?: ChartTypesProps;
|
|
9
10
|
params?: SearchValue;
|
|
11
|
+
completedSearchData?: SearchValue;
|
|
10
12
|
type?: string;
|
|
11
13
|
showList?: string[];
|
|
12
14
|
showColors?: string[];
|
|
13
15
|
onChangeShow?: (data: string[]) => void;
|
|
14
16
|
onSelectEvent?: (id: number, name: string) => void;
|
|
17
|
+
isHideDel?: boolean;
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EventContentProps } from './types';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
-
declare const EventContent: React.
|
|
4
|
+
declare const EventContent: React.ForwardRefExoticComponent<EventContentProps.Props & React.RefAttributes<any>>;
|
|
5
5
|
export default EventContent;
|