@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.
Files changed (43) hide show
  1. package/README.md +35 -35
  2. package/es/components/eventFilter/index.js +68 -20
  3. package/es/components/eventFilter/setCascade.d.ts +3 -0
  4. package/es/components/eventFilter/setCascade.js +286 -0
  5. package/es/components/eventFilter/styles/index.less +148 -36
  6. package/es/components/renderContent/index.js +14 -25
  7. package/es/components/renderContent/styles/index.less +19 -19
  8. package/es/components/renderContent/types.d.ts +0 -1
  9. package/es/components/searchPanel/index.js +19 -6
  10. package/es/components/searchPanel/styles/index.less +22 -18
  11. package/es/components/searchPanel/types.d.ts +2 -2
  12. package/es/components/table/index.js +60 -9
  13. package/es/components/table/styles/index.less +241 -193
  14. package/es/components/table/types.d.ts +0 -1
  15. package/es/components/topBar/index.d.ts +6 -1
  16. package/es/components/topBar/index.js +39 -22
  17. package/es/components/topBar/styles/index.less +58 -63
  18. package/es/components/topBar/types.d.ts +0 -1
  19. package/es/constants/apis.d.ts +3 -1
  20. package/es/constants/apis.js +4 -2
  21. package/es/constants/fields.d.ts +0 -14
  22. package/es/constants/fields.js +1 -45
  23. package/es/modules/chart/demo/panel.js +7 -2
  24. package/es/modules/chart/index.js +105 -36
  25. package/es/modules/chart/types.d.ts +3 -0
  26. package/es/modules/content/index.d.ts +1 -1
  27. package/es/modules/content/index.js +94 -55
  28. package/es/modules/content/styles/index.less +19 -7
  29. package/es/modules/content/utils.d.ts +1 -1
  30. package/es/modules/content/utils.js +21 -19
  31. package/es/modules/home/demo/edit.js +6 -7
  32. package/es/modules/home/demo/index.js +1 -1
  33. package/es/modules/home/demo/styles/index.less +33 -33
  34. package/es/modules/home/index.js +53 -35
  35. package/es/modules/home/styles/index.less +49 -49
  36. package/es/modules/topPanel/index.js +36 -8
  37. package/es/modules/topPanel/styles/index.less +50 -49
  38. package/es/style/image/ring.svg +8 -8
  39. package/es/style/index.less +62 -62
  40. package/es/types.d.ts +6 -0
  41. package/es/utils/formData.d.ts +2 -1
  42. package/es/utils/formData.js +63 -16
  43. package/package.json +24 -20
@@ -12,56 +12,69 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { ajax, BizGlobalDataContext, BizLayout, BizTargetFromPanelContext } from '@zgfe/business-lib';
14
14
  import { message } from 'antd';
15
- import React, { useContext, useEffect, useRef, useState } from 'react';
15
+ import React, { useContext, useEffect, useRef, useState, useImperativeHandle } from 'react';
16
16
  import Request from 'umi-request';
17
17
  import TopBar from '../../components/topBar';
18
18
  import { EventContext } from '../../types';
19
19
  import './styles/index.less';
20
20
  import { Apis } from '../../constants';
21
21
  import { ContentPanel, SearchPanel } from '../../components';
22
- import { getDefaultShow, getUserGroupsCompareData, getSortData, getChartDataEventAliasName } from '../../utils/formData';
22
+ import { getUserGroupsCompareData, getSortData, getChartDataEventAliasName, sortOriginalData, formTableData } from '../../utils/formData';
23
23
  import TopPanel from '../topPanel';
24
24
  var timer = 0;
25
25
  var ajaxFlag = true;
26
+ var refresh = false;
26
27
  var CancelToken = Request.CancelToken;
27
28
  var cancel;
28
29
  var classPrefix = 'event-content';
29
- var EventContent = function EventContent(props) {
30
- var _props$value, _props$value2;
30
+ var EventContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
31
+ var _props$value, _props$value2, _topPanelRef$current4;
31
32
  var _useContext = useContext(BizGlobalDataContext),
32
- currentApp = _useContext.currentApp,
33
33
  authority = _useContext.authority;
34
34
  var _useContext2 = useContext(EventContext),
35
+ currentApp = _useContext2.currentApp,
35
36
  searchData = _useContext2.searchData,
36
37
  setSearchData = _useContext2.setSearchData,
37
38
  eventGroupList = _useContext2.eventGroupList,
38
39
  loading = _useContext2.loading,
39
40
  setLoading = _useContext2.setLoading,
40
41
  afterEditTarget = _useContext2.afterEditTarget,
41
- onChangeUrlParam = _useContext2.onChangeUrlParam;
42
+ onChangeUrlParam = _useContext2.onChangeUrlParam,
43
+ panelId = _useContext2.panelId,
44
+ setShowListHome = _useContext2.setShowListHome,
45
+ setRefreshLoading = _useContext2.setRefreshLoading,
46
+ setCompletedSearchData = _useContext2.setCompletedSearchData;
42
47
  var _useState = useState(),
43
48
  _useState2 = _slicedToArray(_useState, 2),
44
49
  eventData = _useState2[0],
45
50
  setEventData = _useState2[1];
46
- var _useState3 = useState(props.show || []),
51
+ var _useState3 = useState(false),
47
52
  _useState4 = _slicedToArray(_useState3, 2),
48
- showList = _useState4[0],
49
- setShowList = _useState4[1];
53
+ enableSelectChart = _useState4[0],
54
+ setEnableSelectChart = _useState4[1];
50
55
  var _useState5 = useState(false),
51
56
  _useState6 = _slicedToArray(_useState5, 2),
52
- enableSelectChart = _useState6[0],
53
- setEnableSelectChart = _useState6[1];
54
- var _useState7 = useState(false),
57
+ isCity = _useState6[0],
58
+ setIsCity = _useState6[1];
59
+ var _useState7 = useState(props.value.id),
55
60
  _useState8 = _slicedToArray(_useState7, 2),
56
- isCity = _useState8[0],
57
- setIsCity = _useState8[1];
58
- var _useState9 = useState(props.value.id),
61
+ eventId = _useState8[0],
62
+ setEventId = _useState8[1];
63
+ var _useState9 = useState(true),
59
64
  _useState10 = _slicedToArray(_useState9, 2),
60
- eventId = _useState10[0],
61
- setEventId = _useState10[1];
65
+ first = _useState10[0],
66
+ setFirst = _useState10[1];
62
67
  var _useContext3 = useContext(BizTargetFromPanelContext),
63
68
  handleSearch = _useContext3.handleSearch;
64
- var collapseRef = useRef();
69
+ var topPanelRef = useRef();
70
+ useImperativeHandle(ref, function () {
71
+ return {
72
+ onFormSetFieldsValue: function onFormSetFieldsValue(data) {
73
+ var _topPanelRef$current;
74
+ topPanelRef === null || topPanelRef === void 0 ? void 0 : (_topPanelRef$current = topPanelRef.current) === null || _topPanelRef$current === void 0 ? void 0 : _topPanelRef$current.onFormSetFieldsValue(data);
75
+ }
76
+ };
77
+ });
65
78
  var chartRef = useRef();
66
79
  var _useState11 = useState('user'),
67
80
  _useState12 = _slicedToArray(_useState11, 2),
@@ -71,17 +84,13 @@ var EventContent = function EventContent(props) {
71
84
  _useState14 = _slicedToArray(_useState13, 2),
72
85
  subDisplay = _useState14[0],
73
86
  setSubDisplay = _useState14[1];
74
- var _useState15 = useState(true),
75
- _useState16 = _slicedToArray(_useState15, 2),
76
- isFirst = _useState16[0],
77
- setIsFirst = _useState16[1];
78
- var _useState17 = useState({
87
+ var _useState15 = useState({
79
88
  analysisIndex: ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.analysisIndex) || 'number',
80
89
  analysisAttr: (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.analysisAttr
81
90
  }),
82
- _useState18 = _slicedToArray(_useState17, 2),
83
- dimension = _useState18[0],
84
- setDimension = _useState18[1];
91
+ _useState16 = _slicedToArray(_useState15, 2),
92
+ dimension = _useState16[0],
93
+ setDimension = _useState16[1];
85
94
  useEffect(function () {
86
95
  if (timer) clearTimeout(timer);
87
96
  var flag = true;
@@ -120,48 +129,81 @@ var EventContent = function EventContent(props) {
120
129
  if (flag !== undefined) ajaxFlag = flag;
121
130
  if (analysisSubjectType === 'eventProp' && !searchData.analysisSubject) return;
122
131
  if (!ajaxFlag) return;
123
- setLoading(true);
132
+ if (!refresh) setLoading(true);
124
133
  setEventData(undefined);
125
134
  if (typeof cancel === 'function') {
126
135
  cancel();
127
136
  }
128
137
  ajax(Apis.dataList, {
129
138
  method: 'post',
130
- data: _objectSpread({
139
+ data: _objectSpread(_objectSpread({
131
140
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
132
141
  platform: (searchData === null || searchData === void 0 ? void 0 : searchData.platform) || 0
133
- }, searchData),
142
+ }, searchData), {}, {
143
+ refresh: refresh
144
+ }),
134
145
  cancelToken: new CancelToken(function executor(c) {
135
146
  cancel = c;
136
147
  })
137
148
  }).then(function (res) {
138
- var _searchData$userGroup, _props$show;
149
+ var _searchData$userGroup;
150
+ setCompletedSearchData && setCompletedSearchData(searchData);
151
+ setRefreshLoading(false);
139
152
  if (!res) {
140
153
  setLoading(false);
141
154
  return;
142
155
  }
143
156
  var result = res.data;
157
+ if (!(result === null || result === void 0 ? void 0 : result.series.length)) {
158
+ setLoading(false);
159
+ return;
160
+ }
144
161
  var _data = searchData.dimension ? result : getChartDataEventAliasName(result, eventGroupList);
162
+ var gLen = (searchData === null || searchData === void 0 ? void 0 : searchData.dimension) ? 1 : 0;
163
+ var dataTemp = formTableData(_data, (searchData === null || searchData === void 0 ? void 0 : searchData.userGroup) || [0], gLen);
164
+ var _sortData = [];
145
165
  if (['bar', 'pie', 'map'].indexOf(searchData.chartType) !== -1) {
146
166
  _data = getSortData(_data);
167
+ } else {
168
+ var _data2, _data2$series$;
169
+ _sortData = sortOriginalData(dataTemp, {
170
+ columnKey: "field".concat(((_data2 = _data) === null || _data2 === void 0 ? void 0 : (_data2$series$ = _data2.series[0]) === null || _data2$series$ === void 0 ? void 0 : _data2$series$.values.length) - 1),
171
+ order: 'descend'
172
+ });
147
173
  }
148
174
  if (searchData && (searchData === null || searchData === void 0 ? void 0 : searchData.userGroup) && (searchData === null || searchData === void 0 ? void 0 : (_searchData$userGroup = searchData.userGroup) === null || _searchData$userGroup === void 0 ? void 0 : _searchData$userGroup.length) > 1) {
149
175
  _data = getUserGroupsCompareData(_data);
150
176
  }
151
- if (isFirst && ((_props$show = props.show) === null || _props$show === void 0 ? void 0 : _props$show.length)) {
152
- setIsFirst(false);
177
+ if (first) {
178
+ setFirst(false);
153
179
  } else {
154
- var list = _data ? getDefaultShow(_data) : [];
155
- setShowList(list);
156
- props.onChangeShow && props.onChangeShow(list);
180
+ var _showlist = [];
181
+ _sortData.forEach(function (item, index) {
182
+ if (index < 10) {
183
+ _showlist.push(item.nameGroup);
184
+ }
185
+ });
186
+ setShowListHome(_showlist);
157
187
  }
158
188
  setEventData(_data);
159
189
  onChangeUrlParam(searchData);
160
190
  setLoading(false);
161
191
  });
162
192
  };
193
+ var refreshHandle = function refreshHandle() {
194
+ refresh = true;
195
+ setRefreshLoading(true);
196
+ if (timer) clearTimeout(timer);
197
+ timer = setTimeout(function () {
198
+ fetchRequest();
199
+ refresh = false;
200
+ clearTimeout(timer);
201
+ }, 500);
202
+ };
163
203
  var onChangeContent = function onChangeContent(data) {
204
+ var _topPanelRef$current2;
164
205
  ajaxFlag = true;
206
+ (_topPanelRef$current2 = topPanelRef.current) === null || _topPanelRef$current2 === void 0 ? void 0 : _topPanelRef$current2.submit();
165
207
  setSearchData(function (value) {
166
208
  return _objectSpread(_objectSpread(_objectSpread({}, value), data), {}, {
167
209
  analysisAttr: data.analysisAttr,
@@ -169,12 +211,10 @@ var EventContent = function EventContent(props) {
169
211
  });
170
212
  });
171
213
  };
172
- var onChangeShow = function onChangeShow(data) {
173
- setShowList(data);
174
- props.onChangeShow && props.onChangeShow(data);
175
- };
176
214
  var platformChange = function platformChange(data) {
215
+ var _topPanelRef$current3;
177
216
  ajaxFlag = true;
217
+ (_topPanelRef$current3 = topPanelRef.current) === null || _topPanelRef$current3 === void 0 ? void 0 : _topPanelRef$current3.submit();
178
218
  setSearchData(function (_searchData) {
179
219
  return _objectSpread(_objectSpread({}, _searchData), {}, {
180
220
  platform: data
@@ -215,19 +255,12 @@ var EventContent = function EventContent(props) {
215
255
  };
216
256
  if (afterEditTarget) afterEditTarget('report', params);
217
257
  };
218
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TopBar, {
219
- eventData: eventData,
220
- searchData: searchData,
221
- platformChange: platformChange,
222
- enableSelectChart: enableSelectChart,
223
- showList: showList,
224
- onClickGenerateReport: onClickGenerateReport
225
- }), /*#__PURE__*/React.createElement(BizLayout, {
226
- showTitle: false,
258
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BizLayout, {
259
+ showTitle: !panelId,
227
260
  hasCollapse: true,
228
- collapseRef: collapseRef,
261
+ collapseRef: topPanelRef === null || topPanelRef === void 0 ? void 0 : (_topPanelRef$current4 = topPanelRef.current) === null || _topPanelRef$current4 === void 0 ? void 0 : _topPanelRef$current4.getCollapseRef(),
229
262
  topPanel: /*#__PURE__*/React.createElement(TopPanel, {
230
- ref: collapseRef,
263
+ ref: topPanelRef,
231
264
  onChange: onChangeSearch,
232
265
  loading: loading,
233
266
  value: searchData,
@@ -235,6 +268,13 @@ var EventContent = function EventContent(props) {
235
268
  setIsCity: setIsCity,
236
269
  setEnableSelectChart: setEnableSelectChart,
237
270
  onChangeSubjectType: onChangeSubjectType
271
+ }),
272
+ toolbar: /*#__PURE__*/React.createElement(TopBar, {
273
+ eventData: eventData,
274
+ searchData: searchData,
275
+ platformChange: platformChange,
276
+ enableSelectChart: enableSelectChart,
277
+ onClickGenerateReport: onClickGenerateReport
238
278
  })
239
279
  }, /*#__PURE__*/React.createElement("div", {
240
280
  className: classPrefix
@@ -248,14 +288,13 @@ var EventContent = function EventContent(props) {
248
288
  onChange: onChangeContent,
249
289
  dimension: dimension,
250
290
  setDimension: setDimension,
251
- analysisSubjectType: analysisSubjectType
291
+ analysisSubjectType: analysisSubjectType,
292
+ refreshHandle: refreshHandle
252
293
  }), /*#__PURE__*/React.createElement(ContentPanel, {
253
294
  ref: chartRef,
254
295
  isCity: isCity,
255
296
  eventData: eventData,
256
- searchData: searchData,
257
- showList: showList,
258
- onChangeShow: onChangeShow
297
+ searchData: searchData
259
298
  }))));
260
- };
299
+ });
261
300
  export default EventContent;
@@ -1,7 +1,19 @@
1
- .event-content {
2
- &-options {
3
- display: flex;
4
- justify-content: flex-end;
5
- margin-bottom: 16px;
6
- }
7
- }
1
+ .event-content-topBar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ > span {
6
+ color: #021429;
7
+ font-size: 16px;
8
+ }
9
+ .modules-event-topbar {
10
+ padding-right: 0;
11
+ }
12
+ }
13
+ .event-content {
14
+ &-options {
15
+ display: flex;
16
+ justify-content: flex-end;
17
+ margin-bottom: 16px;
18
+ }
19
+ }
@@ -7,7 +7,7 @@ export declare const judgeIsCity: (name: string | undefined) => boolean;
7
7
  export declare const judgeIsArea: (name: string | undefined) => boolean;
8
8
  export declare const getValue: (param: bizAttributeSelectorValueProp, eventGroupList: EventGroup[] | undefined, eventEnvList: EnvProp[] | undefined, userPropList: UserProp[] | undefined) => AttributeSelect.Value | undefined;
9
9
  export declare const getNumberPanelData: (data: any) => Promise<unknown>;
10
- export declare const normalOptions: {
10
+ export declare const normalOptions: (type: any) => {
11
11
  label: string;
12
12
  value: string;
13
13
  }[];
@@ -8,8 +8,9 @@ import { ajax } from '@zgfe/business-lib';
8
8
  import { Apis } from '../../constants';
9
9
  import _ from 'lodash';
10
10
  export var getMapChartData = function getMapChartData(data) {
11
+ var _data$series;
11
12
  var _data = _.cloneDeep(data);
12
- _data.series.map(function (item) {
13
+ _data === null || _data === void 0 ? void 0 : (_data$series = _data.series) === null || _data$series === void 0 ? void 0 : _data$series.map(function (item) {
13
14
  if (item.names.length > 1) {
14
15
  if (item.names[1] === '新疆维吾尔自治区') {
15
16
  item.names = [item.names[0], '新疆'];
@@ -48,22 +49,21 @@ export var judgeIsArea = function judgeIsArea(name) {
48
49
  };
49
50
  export var getValue = function getValue(param, eventGroupList, eventEnvList, userPropList) {
50
51
  var res = undefined;
51
- var key = "".concat(param.propCategory, "-").concat(param.value);
52
52
  if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
53
53
  eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
54
- if (attr.key === key) res = attr;
54
+ if (attr.id === param.id && attr.name === param.value) res = attr;
55
55
  });
56
56
  } else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'eventProp') {
57
57
  eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
58
58
  group.eventList.forEach(function (event) {
59
59
  event.attrList.forEach(function (attr) {
60
- if (attr.key === key) res = attr;
60
+ if (attr.id === param.id) res = attr;
61
61
  });
62
62
  });
63
63
  });
64
64
  } else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'userProp') {
65
65
  userPropList === null || userPropList === void 0 ? void 0 : userPropList.forEach(function (attr) {
66
- if (attr.key === key) res = attr;
66
+ if (attr.id === param.id && attr.category === param.category && attr.name === param.value) res = attr;
67
67
  });
68
68
  }
69
69
  return res;
@@ -80,21 +80,23 @@ export var getNumberPanelData = function getNumberPanelData(data) {
80
80
  });
81
81
  });
82
82
  };
83
- export var normalOptions = [{
84
- label: '人数',
85
- value: 'number'
86
- }, {
87
- label: '次数',
88
- value: 'times'
89
- }, {
90
- label: '活跃比',
91
- value: 'active_ratio'
92
- }, {
93
- label: '人均次数',
94
- value: 'per'
95
- }];
83
+ export var normalOptions = function normalOptions(type) {
84
+ return [{
85
+ label: "".concat(type != 'user' ? '主体数' : '人数'),
86
+ value: 'number'
87
+ }, {
88
+ label: '次数',
89
+ value: 'times'
90
+ }, {
91
+ label: '活跃比',
92
+ value: 'active_ratio'
93
+ }, {
94
+ label: "".concat(type != 'user' ? '主体平均次数' : '人均次数'),
95
+ value: 'per'
96
+ }];
97
+ };
96
98
  export var normalEventOptions = [{
97
- label: '主体数',
99
+ label: '口径数',
98
100
  value: 'number'
99
101
  }, {
100
102
  label: '次数',
@@ -14,21 +14,20 @@ var defaultValue = {
14
14
  id: 249641,
15
15
  name: '事件',
16
16
  data: {
17
- app_id: 502391,
17
+ app_id: 503302,
18
18
  module: 'event',
19
- appId: 502391,
20
- platform: 0,
21
19
  userGroup: [0],
22
20
  time: {
23
- begin: '2023-12-12',
24
- end: '2024-01-11',
21
+ begin: '2024-08-04',
22
+ end: '2024-09-03',
25
23
  relative: [30, 0],
26
24
  unit: 'day'
27
25
  },
28
26
  chartType: 'line',
29
- analysisIndex: 'number'
27
+ analysisIndex: 'number',
28
+ appId: 503302
30
29
  },
31
- chosen_data: ['订单支付页-支付订单', '订单详情页-查看订单', '收入']
30
+ chosen_data: ['崩溃']
32
31
  };
33
32
  export default (function () {
34
33
  var _useState = useState(false),
@@ -39,7 +39,7 @@ export default (function () {
39
39
  };
40
40
  return /*#__PURE__*/React.createElement(DemoWrapper, {
41
41
  needMeta: true,
42
- defaultApp: 461
42
+ defaultApp: 616
43
43
  }, isDetail ? /*#__PURE__*/React.createElement("div", null, JSON.stringify(detailParams), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
44
44
  onClick: function onClick() {
45
45
  return setIsDetail(false);
@@ -1,33 +1,33 @@
1
- /*滚动条凹槽的颜色,还可以设置边框属性 */
2
- ::-webkit-scrollbar-track-piece {
3
- background-color: #fff;
4
- -webkit-border-radius: 10px;
5
- -moz-border-radius: 10px;
6
- border-radius: 10px;
7
- }
8
-
9
- /*滚动条的宽度*/
10
- ::-webkit-scrollbar {
11
- width: 10px;
12
- height: 10px;
13
- }
14
-
15
- /*滚动条的设置*/
16
- ::-webkit-scrollbar-thumb {
17
- background-color: #cacdd4;
18
- background-clip: padding-box;
19
- border: 2px solid #fff;
20
- -webkit-border-radius: 10px;
21
- -moz-border-radius: 10px;
22
- border-radius: 10px;
23
- }
24
-
25
- /*滚动条鼠标移上去*/
26
- ::-webkit-scrollbar-thumb:hover {
27
- // background-color: #bbb;
28
- }
29
-
30
- ::-webkit-scrollbar-track-piece {
31
- width: 6px;
32
- height: 6px;
33
- }
1
+ /*滚动条凹槽的颜色,还可以设置边框属性 */
2
+ ::-webkit-scrollbar-track-piece {
3
+ background-color: #fff;
4
+ -webkit-border-radius: 10px;
5
+ -moz-border-radius: 10px;
6
+ border-radius: 10px;
7
+ }
8
+
9
+ /*滚动条的宽度*/
10
+ ::-webkit-scrollbar {
11
+ width: 10px;
12
+ height: 10px;
13
+ }
14
+
15
+ /*滚动条的设置*/
16
+ ::-webkit-scrollbar-thumb {
17
+ background-color: #cacdd4;
18
+ background-clip: padding-box;
19
+ border: 2px solid #fff;
20
+ -webkit-border-radius: 10px;
21
+ -moz-border-radius: 10px;
22
+ border-radius: 10px;
23
+ }
24
+
25
+ /*滚动条鼠标移上去*/
26
+ ::-webkit-scrollbar-thumb:hover {
27
+ // background-color: #bbb;
28
+ }
29
+
30
+ ::-webkit-scrollbar-track-piece {
31
+ width: 6px;
32
+ height: 6px;
33
+ }
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import React, { useContext, useEffect, useState } from 'react';
13
+ import React, { useContext, useEffect, useState, useRef } from 'react';
14
14
  import { Spin } from 'antd';
15
15
  import { BizGlobalDataContext, BizTargetFromPanel } from '@zgfe/business-lib';
16
16
  import './styles/index.less';
@@ -26,11 +26,16 @@ var ModuleEvent = function ModuleEvent(props) {
26
26
  eventGroupList = _useContext.eventGroupList,
27
27
  eventEnvList = _useContext.eventEnvList,
28
28
  userPropList = _useContext.userPropList,
29
- userGroupList = _useContext.userGroupList;
29
+ userGroupList = _useContext.userGroupList,
30
+ useBizStoreLoading = _useContext.useBizStoreLoading;
30
31
  var _useState = useState(),
31
32
  _useState2 = _slicedToArray(_useState, 2),
32
33
  searchData = _useState2[0],
33
34
  setSearchData = _useState2[1];
35
+ var _useState3 = useState(),
36
+ _useState4 = _slicedToArray(_useState3, 2),
37
+ completedSearchData = _useState4[0],
38
+ setCompletedSearchData = _useState4[1];
34
39
  var onChangeUrlParam = function onChangeUrlParam(data) {
35
40
  clearTimeout(onChangeTimer);
36
41
  onChangeTimer = setTimeout(function () {
@@ -39,39 +44,39 @@ var ModuleEvent = function ModuleEvent(props) {
39
44
  });
40
45
  }, 500);
41
46
  };
42
- var _useState3 = useState(),
43
- _useState4 = _slicedToArray(_useState3, 2),
44
- selectEventData = _useState4[0],
45
- setSelectEventData = _useState4[1];
46
47
  var _useState5 = useState(true),
47
48
  _useState6 = _slicedToArray(_useState5, 2),
48
49
  loading = _useState6[0],
49
50
  setLoading = _useState6[1];
50
- var _useState7 = useState(true),
51
+ var _useState7 = useState(false),
51
52
  _useState8 = _slicedToArray(_useState7, 2),
52
- pageLoading = _useState8[0],
53
- setPageLoading = _useState8[1];
54
- var _useState9 = useState(),
53
+ refreshLoading = _useState8[0],
54
+ setRefreshLoading = _useState8[1];
55
+ var _useState9 = useState(true),
55
56
  _useState10 = _slicedToArray(_useState9, 2),
56
- title = _useState10[0],
57
- setTitle = _useState10[1];
57
+ pageLoading = _useState10[0],
58
+ setPageLoading = _useState10[1];
58
59
  var _useState11 = useState(),
59
60
  _useState12 = _slicedToArray(_useState11, 2),
60
- panelId = _useState12[0],
61
- setPanelId = _useState12[1];
61
+ title = _useState12[0],
62
+ setTitle = _useState12[1];
62
63
  var _useState13 = useState(),
63
64
  _useState14 = _slicedToArray(_useState13, 2),
64
- elementId = _useState14[0],
65
- setElementId = _useState14[1];
65
+ panelId = _useState14[0],
66
+ setPanelId = _useState14[1];
66
67
  var _useState15 = useState(),
67
68
  _useState16 = _slicedToArray(_useState15, 2),
68
- showList = _useState16[0],
69
- setShowList = _useState16[1];
69
+ elementId = _useState16[0],
70
+ setElementId = _useState16[1];
71
+ var _useState17 = useState(),
72
+ _useState18 = _slicedToArray(_useState17, 2),
73
+ showListHome = _useState18[0],
74
+ setShowListHome = _useState18[1];
70
75
  useEffect(function () {
71
76
  setPageLoading(true);
72
77
  if (props.defaultValue) {
73
78
  var _props$defaultValue;
74
- setShowList(props.defaultValue.chosen_data);
79
+ setShowListHome(props.defaultValue.chosen_data);
75
80
  setPanelId(props.defaultValue.panelId);
76
81
  setTitle(props.defaultValue.name);
77
82
  if ((_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.id) {
@@ -95,23 +100,33 @@ var ModuleEvent = function ModuleEvent(props) {
95
100
  chartType: 'line'
96
101
  });
97
102
  };
103
+ var eventContentRef = useRef();
98
104
  var onSelectEvent = function onSelectEvent(id, name) {
99
105
  if ((searchData === null || searchData === void 0 ? void 0 : searchData.id) === undefined) {
100
- setSelectEventData({
106
+ var _eventContentRef$curr;
107
+ setSearchData({
108
+ id: id,
109
+ name: name,
101
110
  analysisIndex: searchData === null || searchData === void 0 ? void 0 : searchData.analysisIndex,
102
111
  chartType: searchData === null || searchData === void 0 ? void 0 : searchData.chartType,
103
112
  time: searchData === null || searchData === void 0 ? void 0 : searchData.time,
104
- userGroup: searchData === null || searchData === void 0 ? void 0 : searchData.userGroup,
105
- id: id,
106
- name: name
113
+ userGroup: searchData === null || searchData === void 0 ? void 0 : searchData.userGroup
114
+ });
115
+ eventContentRef === null || eventContentRef === void 0 ? void 0 : (_eventContentRef$curr = eventContentRef.current) === null || _eventContentRef$curr === void 0 ? void 0 : _eventContentRef$curr.onFormSetFieldsValue({
116
+ filterConditions: {
117
+ id: id,
118
+ name: name
119
+ },
120
+ userGroup: searchData === null || searchData === void 0 ? void 0 : searchData.userGroup
107
121
  });
108
122
  }
109
123
  };
110
- if (pageLoading) {
124
+ if (pageLoading || useBizStoreLoading) {
111
125
  return /*#__PURE__*/React.createElement(Spin, null);
112
126
  }
113
- return /*#__PURE__*/React.createElement("div", {
114
- className: classPrefix
127
+ return /*#__PURE__*/React.createElement(Spin, {
128
+ spinning: false,
129
+ wrapperClassName: classPrefix
115
130
  }, /*#__PURE__*/React.createElement(BizTargetFromPanel, {
116
131
  value: panelId ? {
117
132
  panelId: panelId,
@@ -122,18 +137,21 @@ var ModuleEvent = function ModuleEvent(props) {
122
137
  app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
123
138
  module: 'event'
124
139
  }, searchData),
125
- showList: showList
140
+ showList: showListHome
126
141
  }
127
142
  } : undefined,
128
143
  disabled: props === null || props === void 0 ? void 0 : props.panelDisabled,
129
144
  styleOptions: chartTypes,
130
145
  afterEditTarget: props.afterEditTarget
131
- }), !panelId && /*#__PURE__*/React.createElement("div", {
132
- className: "".concat(classPrefix, "-header-title")
133
- }, "\u4E8B\u4EF6\u5206\u6790"), /*#__PURE__*/React.createElement(EventContext.Provider, {
146
+ }, /*#__PURE__*/React.createElement(EventContext.Provider, {
134
147
  value: {
148
+ refreshLoading: refreshLoading,
149
+ setRefreshLoading: setRefreshLoading,
150
+ currentApp: currentApp,
135
151
  loading: loading,
136
152
  setLoading: setLoading,
153
+ showListHome: showListHome,
154
+ setShowListHome: setShowListHome,
137
155
  panelId: panelId,
138
156
  elementId: elementId,
139
157
  eventGroupList: eventGroupList,
@@ -141,8 +159,9 @@ var ModuleEvent = function ModuleEvent(props) {
141
159
  userPropList: userPropList,
142
160
  searchData: searchData,
143
161
  setSearchData: setSearchData,
162
+ completedSearchData: completedSearchData,
163
+ setCompletedSearchData: setCompletedSearchData,
144
164
  onChangeUrlParam: onChangeUrlParam,
145
- selectEventData: selectEventData,
146
165
  onSelectEvent: onSelectEvent,
147
166
  panelName: title,
148
167
  includeToday: props.includeToday,
@@ -154,11 +173,10 @@ var ModuleEvent = function ModuleEvent(props) {
154
173
  }
155
174
  }, /*#__PURE__*/React.createElement(EventContent, {
156
175
  elementId: elementId,
176
+ ref: eventContentRef,
157
177
  value: searchData,
158
- show: showList,
159
- initSearch: initSearch,
160
- onChangeShow: setShowList
161
- })));
178
+ initSearch: initSearch
179
+ }))));
162
180
  };
163
181
  ModuleEvent.defaultProps = {
164
182
  includeToday: true