@zgfe/modules-interval 1.0.23-zhongyuan.2 → 1.0.23-zhongyuan.21

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 (32) hide show
  1. package/dist/esm/components/eventFilter/index.js +33 -19
  2. package/dist/esm/components/renderContent/index.js +6 -3
  3. package/dist/esm/components/renderContent/styles/index.css +32 -0
  4. package/dist/esm/components/renderContent/styles/index.less +1 -0
  5. package/dist/esm/components/renderContent/types.d.ts +9 -2
  6. package/dist/esm/components/searchPanel/index.js +14 -10
  7. package/dist/esm/components/searchPanel/types.d.ts +4 -1
  8. package/dist/esm/components/table/index.js +3 -2
  9. package/dist/esm/components/topBar/types.d.ts +4 -0
  10. package/dist/esm/constants/code.js +6 -6
  11. package/dist/esm/modules/chart/customTooltip.js +3 -3
  12. package/dist/esm/modules/chart/customTooltip1.d.ts +7 -0
  13. package/dist/esm/modules/chart/customTooltip1.js +46 -0
  14. package/dist/esm/modules/chart/index.css +52 -0
  15. package/dist/esm/modules/chart/index.js +26 -22
  16. package/dist/esm/modules/chart/index.less +1 -1
  17. package/dist/esm/modules/chart/intervalChart copy.d.ts +4 -0
  18. package/dist/esm/modules/chart/intervalChart copy.js +295 -0
  19. package/dist/esm/modules/chart/intervalChart.js +325 -36
  20. package/dist/esm/modules/chart/types.d.ts +2 -1
  21. package/dist/esm/modules/content/index.js +51 -20
  22. package/dist/esm/modules/content/types.d.ts +9 -1
  23. package/dist/esm/modules/content/utils.js +12 -12
  24. package/dist/esm/modules/home/index.js +8 -2
  25. package/dist/esm/modules/home/types.d.ts +4 -1
  26. package/dist/esm/modules/topPanel/index.js +8 -9
  27. package/dist/esm/modules/topPanel/styles/index.less +219 -219
  28. package/dist/esm/types.d.ts +8 -1
  29. package/dist/esm/types.js +6 -6
  30. package/dist/esm/utils/formData.d.ts +2 -2
  31. package/dist/esm/utils/formData.js +13 -9
  32. package/package.json +3 -3
@@ -18,7 +18,9 @@ import _ from 'lodash';
18
18
  var classPrefix = 'interval-box';
19
19
  var EventFilter = function EventFilter(props) {
20
20
  var _useContext = useContext(BizGlobalDataContext),
21
- eventIdMap = _useContext.eventIdMap;
21
+ eventIdMap = _useContext.eventIdMap,
22
+ envs = _useContext.envs,
23
+ currentApp = _useContext.currentApp;
22
24
  // 筛选条件个数
23
25
  var _useState = useState(0),
24
26
  _useState2 = _slicedToArray(_useState, 2),
@@ -95,8 +97,8 @@ var EventFilter = function EventFilter(props) {
95
97
  return;
96
98
  }
97
99
  // 最多可添加10条属性筛选
98
- if (count >= 10) {
99
- message.error('最多可添加 10 条属性筛选');
100
+ if (count >= ((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 10)) {
101
+ message.error("\u6700\u591A\u53EF\u6DFB\u52A0 ".concat((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 10, " \u6761\u5C5E\u6027\u7B5B\u9009"));
100
102
  return;
101
103
  }
102
104
  setIsAdd(true);
@@ -141,6 +143,18 @@ var EventFilter = function EventFilter(props) {
141
143
  }
142
144
  props.onChange && props.onChange(_event);
143
145
  }, [bizAttributeSelectorValue, filter, event, relevancy]);
146
+
147
+ // const [eventAttrs, setEventAttrs] = useState<any[]>([]);
148
+ // useEffect(() => {
149
+ // if (event) {
150
+ // (async () => {
151
+ // const eventAttrs: any =
152
+ // (await eventApi.fetchEventAttrs(event?.id as number, currentApp?.appId)) || [];
153
+ // setEventAttrs(eventAttrs);
154
+ // })();
155
+ // }
156
+ // }, [event.id]);
157
+
144
158
  return /*#__PURE__*/React.createElement("div", {
145
159
  className: classPrefix
146
160
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizEventSelector, {
@@ -152,26 +166,26 @@ var EventFilter = function EventFilter(props) {
152
166
  value: {
153
167
  event: event
154
168
  },
155
- onChange: onChangeEvent,
156
- filter: function filter(event) {
157
- if (!props.subject) return true;
158
- var propMatch = false;
159
- for (var i = 0; i < event.attrList.length; i++) {
160
- var _props$subject;
161
- var attr = event.attrList[i];
162
- if (attr.label === ((_props$subject = props.subject) === null || _props$subject === void 0 ? void 0 : _props$subject.subjectName)) {
163
- propMatch = true;
164
- break;
165
- }
166
- }
167
- return propMatch;
168
- },
169
+ onChange: onChangeEvent
170
+ // filter={(event) => {
171
+ // if (!props.subject) return true;
172
+ // let propMatch = false;
173
+ // for (let i = 0; i < event.attrList.length; i++) {
174
+ // const attr = event.attrList[i];
175
+ // if (attr.label === props.subject?.subjectName) {
176
+ // propMatch = true;
177
+ // break;
178
+ // }
179
+ // }
180
+ // return propMatch;
181
+ // }}
182
+ ,
169
183
  placeholder: "\u8BF7\u9009\u62E9\u4E8B\u4EF6"
170
184
  }), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
171
185
  placement: "top",
172
- title: !eventOverview ? '请先选择目标事件' : count < 10 ? '添加属性筛选' : '最多可添加 10 条属性筛选'
186
+ title: !eventOverview ? '请先选择目标事件' : count < ((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 10) ? '添加属性筛选' : "\u6700\u591A\u53EF\u6DFB\u52A0 ".concat((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 10, " \u6761\u5C5E\u6027\u7B5B\u9009")
173
187
  }, /*#__PURE__*/React.createElement(IconFont, {
174
- className: "".concat(count >= 10 || event.id === -1 || !eventOverview ? 'disable' : ''),
188
+ className: "".concat(count >= ((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 10) || event.id === -1 || !eventOverview ? 'disable' : ''),
175
189
  type: "shaixuan",
176
190
  onClick: function onClick() {
177
191
  return onAdd();
@@ -12,19 +12,21 @@ import "./styles/index.less";
12
12
  import IntervalEventChart from "../../modules/chart";
13
13
  var classPrefix = 'render-content-interval';
14
14
  var ContentPanel = function ContentPanel(props) {
15
+ var _props$searchData;
15
16
  var loading = props.loading,
16
17
  eventData = props.eventData,
17
18
  searchData = props.searchData;
18
19
  var _useContext = useContext(IntervalContext),
19
20
  refreshLoading = _useContext.refreshLoading;
20
21
  // 显示内容
21
- var _useState = useState(props.showList || []),
22
+ var _useState = useState(((_props$searchData = props.searchData) === null || _props$searchData === void 0 ? void 0 : _props$searchData.displaySetup) || []),
22
23
  _useState2 = _slicedToArray(_useState, 2),
23
24
  showList = _useState2[0],
24
25
  setShowList = _useState2[1];
25
26
  useEffect(function () {
26
- setShowList(props.showList);
27
- }, [eventData]);
27
+ var _props$searchData2;
28
+ setShowList(((_props$searchData2 = props.searchData) === null || _props$searchData2 === void 0 ? void 0 : _props$searchData2.displaySetup) || []);
29
+ }, [props === null || props === void 0 ? void 0 : props.searchData]);
28
30
 
29
31
  // 表格筛选,取前10个
30
32
  var onChangeShow = function onChangeShow(names) {
@@ -45,6 +47,7 @@ var ContentPanel = function ContentPanel(props) {
45
47
  }, searchData ? /*#__PURE__*/React.createElement(IntervalEventChart, {
46
48
  type: "boxplot",
47
49
  dataSource: eventData,
50
+ eventOldData: props.eventOldData,
48
51
  params: searchData,
49
52
  onChangeShow: onChangeShow
50
53
  }) : /*#__PURE__*/React.createElement("div", {
@@ -0,0 +1,32 @@
1
+ .render-content-interval-chart-container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ min-height: 300px;
7
+ }
8
+ .render-content-interval-chart-container .echarts-for-react {
9
+ width: 100%;
10
+ background: #fff;
11
+ border: 1px solid var(--unnamed, #ecedf0);
12
+ border-radius: 8px;
13
+ }
14
+ .render-content-interval-MiNone {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ width: 100%;
19
+ height: 368px;
20
+ padding: 24px 16px;
21
+ border: 1px solid #ecedf0;
22
+ border-radius: 8px;
23
+ }
24
+ .render-content-interval-spin-container {
25
+ display: flex !important;
26
+ align-items: center;
27
+ justify-content: center;
28
+ min-height: 300px;
29
+ }
30
+ .render-content-interval-spin-container .biz-loading-wrapper {
31
+ width: 100%;
32
+ }
@@ -4,6 +4,7 @@
4
4
  flex-direction: column;
5
5
  align-items: center;
6
6
  justify-content: center;
7
+ min-height: 300px;
7
8
 
8
9
  .echarts-for-react {
9
10
  width: 100%;
@@ -8,6 +8,7 @@ export interface RenderContentProps {
8
8
  * 查询结果
9
9
  */
10
10
  eventData?: ResponseDataProps;
11
+ eventOldData?: ResponseDataProps;
11
12
  /**
12
13
  * 查询条件
13
14
  */
@@ -15,7 +16,10 @@ export interface RenderContentProps {
15
16
  /**
16
17
  * 显示列表
17
18
  */
18
- showList: string[];
19
+ showList?: {
20
+ label: string;
21
+ value: number;
22
+ }[];
19
23
  /**
20
24
  * 是否是城市
21
25
  */
@@ -27,5 +31,8 @@ export interface RenderContentProps {
27
31
  /**
28
32
  * 改变显示内容
29
33
  */
30
- onChangeShow?: (data: string[]) => void;
34
+ onChangeShow?: (data: {
35
+ label: string;
36
+ value: number;
37
+ }[]) => void;
31
38
  }
@@ -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 { BizSelect, IconFont, BizDatePickerV2 } from '@zgfe/business-lib';
13
+ import { BizSelect, IconFont, BizDatePickerV2, BizGlobalDataContext } from '@zgfe/business-lib';
14
14
  import { DatePickerTypes } from '@zgfe/business-lib/es/datePickerV2/types';
15
15
  import React, { useContext, useEffect, useState } from 'react';
16
16
  import { chartTypeOptions, getInitDate } from "../../constants";
@@ -24,6 +24,8 @@ var SearchPanel = function SearchPanel(props) {
24
24
  includeToday = _useContext.includeToday,
25
25
  searchData = _useContext.searchData,
26
26
  refreshLoading = _useContext.refreshLoading;
27
+ var _useContext2 = useContext(BizGlobalDataContext),
28
+ envs = _useContext2.envs;
27
29
  // 当前时间段
28
30
  var _useState = useState(props.time || getInitDate(includeToday)),
29
31
  _useState2 = _slicedToArray(_useState, 2),
@@ -45,7 +47,7 @@ var SearchPanel = function SearchPanel(props) {
45
47
  var _useState9 = useState([]),
46
48
  _useState10 = _slicedToArray(_useState9, 2),
47
49
  displaySetupSliceList = _useState10[0],
48
- setDisplaySetupSliceList = _useState10[1];
50
+ setDisplaySetupSliceList = _useState10[1]; // 选中的显示设置
49
51
  // 查询维度
50
52
  var _useState11 = useState({
51
53
  analysisIndex: 'number'
@@ -55,11 +57,13 @@ var SearchPanel = function SearchPanel(props) {
55
57
  setDimension = _useState12[1];
56
58
  // 初始化表格表头和内容
57
59
  useEffect(function () {
58
- if (props !== null && props !== void 0 && props.eventData) {
59
- var arr = extractNames(props === null || props === void 0 ? void 0 : props.eventData);
60
+ if (props !== null && props !== void 0 && props.eventOldData) {
61
+ var _props$searchData;
62
+ var arr = extractNames(props === null || props === void 0 ? void 0 : props.eventOldData);
60
63
  setDisplaySetupLIst(arr);
64
+ setDisplaySetupSliceList(props === null || props === void 0 ? void 0 : (_props$searchData = props.searchData) === null || _props$searchData === void 0 ? void 0 : _props$searchData.displaySetup);
61
65
  }
62
- }, [props === null || props === void 0 ? void 0 : props.eventData]);
66
+ }, [props === null || props === void 0 ? void 0 : props.searchData, props === null || props === void 0 ? void 0 : props.eventOldData]);
63
67
  // 初始化
64
68
  useEffect(function () {
65
69
  if (props.chartType && props.chartType !== chart.value) {
@@ -95,10 +99,7 @@ var SearchPanel = function SearchPanel(props) {
95
99
  // 显示设置选择
96
100
  var onDimensionChange = function onDimensionChange(val) {
97
101
  if (val) {
98
- props.onChange && props.onChange({
99
- time: time,
100
- displaySetup: val
101
- });
102
+ props.onChangeShow && props.onChangeShow(val);
102
103
  setDisplaySetupSliceList(val);
103
104
  }
104
105
  };
@@ -108,6 +109,9 @@ var SearchPanel = function SearchPanel(props) {
108
109
  dateTypeList: [DatePickerTypes.Unit.day, DatePickerTypes.Unit.week, DatePickerTypes.Unit.month, DatePickerTypes.Unit.custom],
109
110
  value: time,
110
111
  includeToday: true,
112
+ selectRange: envs && envs.timeRangeOpen ? envs.timeRangeOpen : 36,
113
+ timeRangeOpen: envs && envs.timeRangeOpen ? envs.timeRangeOpen : 36,
114
+ selectRangeUnit: envs && envs.timeRangeOpen ? 'months' : 'days',
111
115
  onChange: onChangeTime
112
116
  }), /*#__PURE__*/React.createElement(BizSelect, {
113
117
  multiple: true,
@@ -118,7 +122,7 @@ var SearchPanel = function SearchPanel(props) {
118
122
  placeholder: "\u8BF7\u9009\u62E9\u663E\u793A\u8BBE\u7F6E",
119
123
  enableSearch: true,
120
124
  options: displaySetupList,
121
- value: displaySetupSliceList.length > 0 ? displaySetupSliceList : displaySetupList.slice(0, 4),
125
+ value: displaySetupSliceList,
122
126
  labelField: "label",
123
127
  keyField: "value"
124
128
  })), /*#__PURE__*/React.createElement(Button, {
@@ -1,5 +1,5 @@
1
1
  import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
2
- import { EventChartTypes, ResponseDataProps } from '../../types';
2
+ import { EventChartTypes, ResponseDataProps, SearchValue } from '../../types';
3
3
  import { ReactNode } from 'react';
4
4
  /**
5
5
  * 右边的查询组件
@@ -19,6 +19,7 @@ export interface SearchPanelProps {
19
19
  */
20
20
  displaySetup?: DisplaySetup[];
21
21
  eventData?: ResponseDataProps;
22
+ eventOldData?: ResponseDataProps;
22
23
  /**
23
24
  * 地图类型是否可选
24
25
  */
@@ -43,6 +44,8 @@ export interface SearchPanelProps {
43
44
  * 内容改变回调
44
45
  */
45
46
  onChange?: (data: SearchPanelProps) => void;
47
+ searchData?: SearchValue;
48
+ onChangeShow?: (data: DisplaySetup[]) => void;
46
49
  }
47
50
  export interface DisplaySetup {
48
51
  value: number;
@@ -35,7 +35,8 @@ var EventTable = function EventTable(props) {
35
35
  eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou,
36
36
  eventEnvList = _useContext.eventEnvList,
37
37
  userPropList = _useContext.userPropList,
38
- authority = _useContext.authority;
38
+ authority = _useContext.authority,
39
+ showProdDownload = _useContext.showProdDownload;
39
40
  var _useContext2 = useContext(IntervalContext),
40
41
  panelName = _useContext2.panelName,
41
42
  onUserDrill = _useContext2.onUserDrill;
@@ -107,7 +108,7 @@ var EventTable = function EventTable(props) {
107
108
  className: classPrefix
108
109
  }, /*#__PURE__*/React.createElement("div", {
109
110
  className: "".concat(classPrefix, "-table-header")
110
- }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), authority[100059] && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
111
+ }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), authority[100059] && showProdDownload && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
111
112
  onClick: download
112
113
  }, /*#__PURE__*/React.createElement(IconFont, {
113
114
  type: "xiazai1"
@@ -6,6 +6,10 @@ export interface TopBarProps {
6
6
  */
7
7
  searchData?: SearchValue;
8
8
  loading?: boolean;
9
+ showList?: {
10
+ label: string;
11
+ value: number;
12
+ }[];
9
13
  eventData?: ResponseDataProps;
10
14
  onJumpWarning: IntervalProps.Props['onJumpWarning'];
11
15
  platformChange: (data: number) => void;
@@ -1,13 +1,13 @@
1
- /**
2
- * @description 异常状态码
1
+ /**
2
+ * @description 异常状态码
3
3
  */
4
4
  export var ERROR_RESPONESE_CODE = {
5
- /**
6
- * @description 刷新失败
5
+ /**
6
+ * @description 刷新失败
7
7
  */
8
8
  REFRESH_FAIL: '100080',
9
- /**
10
- * @description 用户群或标签查询异常
9
+ /**
10
+ * @description 用户群或标签查询异常
11
11
  */
12
12
  EXCEPTION: '100081'
13
13
  };
@@ -13,14 +13,14 @@ var CustomTooltip = function CustomTooltip(_ref) {
13
13
  }
14
14
  // 根据payload中的数据定义弹窗内容
15
15
  var marker = payload === null || payload === void 0 ? void 0 : payload.marker;
16
- var value = payload === null || payload === void 0 ? void 0 : payload.value;
16
+ var value = payload === null || payload === void 0 ? void 0 : payload.data;
17
17
  return /*#__PURE__*/React.createElement("div", {
18
18
  className: "custom-tooltip-chart"
19
19
  }, /*#__PURE__*/React.createElement("div", {
20
20
  className: "custom-tooltip-name"
21
21
  }, payload.name, " "), /*#__PURE__*/React.createElement("div", {
22
22
  className: "custom-tooltip-div"
23
- }, (series === null || series === void 0 ? void 0 : series.names[0]) && /*#__PURE__*/React.createElement("div", {
23
+ }, payload.seriesName && /*#__PURE__*/React.createElement("div", {
24
24
  className: "tooltip-marker"
25
25
  }, /*#__PURE__*/React.createElement("div", {
26
26
  dangerouslySetInnerHTML: {
@@ -28,7 +28,7 @@ var CustomTooltip = function CustomTooltip(_ref) {
28
28
  }
29
29
  }), /*#__PURE__*/React.createElement("div", {
30
30
  className: "tooltip-span"
31
- }, series.names[0])), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
31
+ }, payload.seriesName)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
32
32
  className: "tooltip-span"
33
33
  }, "\u6700\u5927\u503C\uFF1A"), /*#__PURE__*/React.createElement("div", null, convertToHMS(value[5]))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
34
34
  className: "tooltip-span"
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const CustomTooltip: React.FC<{
4
+ payload: any[];
5
+ series: any[];
6
+ }>;
7
+ export default CustomTooltip;
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import "./index.less";
3
+ var CustomTooltip = function CustomTooltip(_ref) {
4
+ var payload = _ref.payload,
5
+ series = _ref.series;
6
+ // 初始化,判断showList是否有值,如果没值,取结果的前10条
7
+ function convertToHMS(seconds) {
8
+ var hours = Math.floor(seconds / 3600);
9
+ var minutes = Math.floor(seconds % 3600 / 60);
10
+ var remainingSeconds = seconds % 60;
11
+ return ('00' + hours).slice(-2) + ':' + ('00' + minutes).slice(-2) + ':' + ('00' + remainingSeconds).slice(-2);
12
+ }
13
+ // 根据payload中的数据定义弹窗内容
14
+ // const marker = payload?.marker;
15
+
16
+ // const value = payload?.value;
17
+ return /*#__PURE__*/React.createElement(React.Fragment, null, payload.map(function (o, index) {
18
+ return /*#__PURE__*/React.createElement("div", {
19
+ className: "custom-tooltip-chart",
20
+ key: index
21
+ }, /*#__PURE__*/React.createElement("div", {
22
+ className: "custom-tooltip-name"
23
+ }, o.name, " "), /*#__PURE__*/React.createElement("div", {
24
+ className: "custom-tooltip-div"
25
+ }, o.seriesName && /*#__PURE__*/React.createElement("div", {
26
+ className: "tooltip-marker"
27
+ }, /*#__PURE__*/React.createElement("div", {
28
+ dangerouslySetInnerHTML: {
29
+ __html: o === null || o === void 0 ? void 0 : o.marker
30
+ }
31
+ }), /*#__PURE__*/React.createElement("div", {
32
+ className: "tooltip-span"
33
+ }, o.seriesName)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
34
+ className: "tooltip-span"
35
+ }, "\u6700\u5927\u503C\uFF1A"), /*#__PURE__*/React.createElement("div", null, convertToHMS(o.value[5]))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
36
+ className: "tooltip-span"
37
+ }, "\u4E0A\u56DB\u5206\u4F4D\uFF1A"), convertToHMS(o.value[2])), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
38
+ className: "tooltip-span"
39
+ }, "\u4E2D\u4F4D\u6570\uFF1A"), convertToHMS(o.value[3])), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
40
+ className: "tooltip-span"
41
+ }, "\u4E0B\u56DB\u5206\u4F4D\uFF1A"), convertToHMS(o.value[4])), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
42
+ className: "tooltip-span"
43
+ }, "\u6700\u5C0F\u503C\uFF1A"), convertToHMS(o.value[1]))));
44
+ }));
45
+ };
46
+ export default CustomTooltip;
@@ -0,0 +1,52 @@
1
+ .custom-tooltip-chart {
2
+ display: inline-block;
3
+ flex-direction: column;
4
+ flex-shrink: 0;
5
+ gap: 4px;
6
+ align-items: flex-start;
7
+ width: 146px;
8
+ height: 100%;
9
+ padding: 8px;
10
+ color: var(--io-n, #021429);
11
+ font-weight: 500;
12
+ font-size: 12px;
13
+ font-style: normal;
14
+ border-radius: 10px;
15
+ box-shadow: 0px 4px 10px 0px #0000001a;
16
+ }
17
+ .custom-tooltip-chart .custom-tooltip-name {
18
+ color: var(--io-n, #021429);
19
+ font-weight: 500;
20
+ font-size: 12px;
21
+ font-family: PingFang SC;
22
+ font-style: normal;
23
+ line-height: normal;
24
+ }
25
+ .custom-tooltip-chart .custom-tooltip-div {
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: 6px;
29
+ width: 100%;
30
+ height: 100%;
31
+ padding: 0px 8px;
32
+ background: #fff;
33
+ border-radius: 4px;
34
+ box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.04);
35
+ }
36
+ .custom-tooltip-chart .custom-tooltip-div .tooltip-span {
37
+ display: block;
38
+ color: var(--3, #5f6085);
39
+ font-weight: 400;
40
+ font-size: 12px;
41
+ font-family: PingFang SC;
42
+ font-style: normal;
43
+ line-height: normal;
44
+ }
45
+ .custom-tooltip-chart .custom-tooltip-div > div {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ }
50
+ .custom-tooltip-chart .custom-tooltip-div .tooltip-marker {
51
+ justify-content: flex-start;
52
+ }
@@ -11,13 +11,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
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
13
  import React, { useContext, useEffect, useState } from 'react';
14
- import { BizEmpty, BizGlobalDataContext, BizLoading, ajax } from '@zgfe/business-lib';
14
+ import { BizEmpty, BizGlobalDataContext, ajax } from '@zgfe/business-lib';
15
15
  import { EventTable, MiNone } from "../../components";
16
16
  import { extractNames, getDefaultShow } from "../../utils/formData";
17
17
  import { Apis } from "../../constants";
18
18
  import IntervalChart from "./intervalChart";
19
19
  import { searchDataParams } from "../content/utils";
20
20
  import { ERROR_RESPONESE_CODE } from "../../constants/code";
21
+ import { Spin } from 'antd';
21
22
  var IntervalEventChart = function IntervalEventChart(props) {
22
23
  var _dataSource$appData2;
23
24
  var params = props.params,
@@ -27,20 +28,16 @@ var IntervalEventChart = function IntervalEventChart(props) {
27
28
  _useState2 = _slicedToArray(_useState, 2),
28
29
  showList = _useState2[0],
29
30
  setShowList = _useState2[1];
30
- var _useState3 = useState([]),
31
+ var _useState3 = useState(props.dataSource),
31
32
  _useState4 = _slicedToArray(_useState3, 2),
32
- dataSourceList = _useState4[0],
33
- setDataSourceList = _useState4[1];
34
- var _useState5 = useState(props.dataSource),
35
- _useState6 = _slicedToArray(_useState5, 2),
36
- dataSource = _useState6[0],
37
- setDataSource = _useState6[1];
33
+ dataSource = _useState4[0],
34
+ setDataSource = _useState4[1];
38
35
  var _useContext = useContext(BizGlobalDataContext),
39
36
  currentApp = _useContext.currentApp;
40
- var _useState7 = useState(false),
41
- _useState8 = _slicedToArray(_useState7, 2),
42
- loading = _useState8[0],
43
- setLoading = _useState8[1];
37
+ var _useState5 = useState(false),
38
+ _useState6 = _slicedToArray(_useState5, 2),
39
+ loading = _useState6[0],
40
+ setLoading = _useState6[1];
44
41
  useEffect(function () {
45
42
  // 没有dataSource时(看板列表访问),请求查询
46
43
  if (!props.dataSource) {
@@ -51,14 +48,17 @@ var IntervalEventChart = function IntervalEventChart(props) {
51
48
  // 初始化,判断showList是否有值,如果没值,取结果的前10条
52
49
  useEffect(function () {
53
50
  var _dataSource$appData, _dataSource$appData$s;
51
+ var dataSource = props.dataSource;
54
52
  if ((dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData = dataSource.appData) === null || _dataSource$appData === void 0 ? void 0 : (_dataSource$appData$s = _dataSource$appData.series) === null || _dataSource$appData$s === void 0 ? void 0 : _dataSource$appData$s.length) > 0) {
55
- var _extractNames;
56
- var arr = params !== null && params !== void 0 && params.displaySetup ? params === null || params === void 0 ? void 0 : params.displaySetup : (_extractNames = extractNames(dataSource)) === null || _extractNames === void 0 ? void 0 : _extractNames.splice(0, 4);
53
+ var _extractNames, _extractNames2;
54
+ var arr = params !== null && params !== void 0 && params.displaySetup ? params === null || params === void 0 ? void 0 : params.displaySetup : props !== null && props !== void 0 && props.eventOldData ? (_extractNames = extractNames(props === null || props === void 0 ? void 0 : props.eventOldData)) === null || _extractNames === void 0 ? void 0 : _extractNames.splice(0, 4) : (_extractNames2 = extractNames(dataSource)) === null || _extractNames2 === void 0 ? void 0 : _extractNames2.splice(0, 4);
57
55
  var app = getDefaultShow(dataSource, arr);
58
56
  setShowList(app);
59
- setDataSourceList(arr);
57
+ setDataSource(app);
58
+ } else {
59
+ setDataSource(dataSource);
60
60
  }
61
- }, [params === null || params === void 0 ? void 0 : params.displaySetup, dataSource]);
61
+ }, [params === null || params === void 0 ? void 0 : params.displaySetup, props.dataSource, params]);
62
62
  var fetchResult = function fetchResult() {
63
63
  var _obj$start, _obj$end, _params$start, _params$end;
64
64
  var obj = searchDataParams(params);
@@ -79,7 +79,11 @@ var IntervalEventChart = function IntervalEventChart(props) {
79
79
  onChangeException === null || onChangeException === void 0 ? void 0 : onChangeException();
80
80
  return;
81
81
  }
82
- setDataSource(res.data);
82
+ var resultApp = res.data;
83
+ if (params !== null && params !== void 0 && params.showList) {
84
+ resultApp = getDefaultShow(res.data, params === null || params === void 0 ? void 0 : params.showList);
85
+ }
86
+ setDataSource(resultApp);
83
87
  }).catch(function () {
84
88
  setLoading(false);
85
89
  });
@@ -91,9 +95,10 @@ var IntervalEventChart = function IntervalEventChart(props) {
91
95
  if (props.onChangeShow) props.onChangeShow(names);
92
96
  };
93
97
  if (loading) {
94
- return /*#__PURE__*/React.createElement(BizLoading, {
95
- className: "mi-common-interval-content"
96
- }, /*#__PURE__*/React.createElement("div", null));
98
+ return /*#__PURE__*/React.createElement(Spin, {
99
+ tip: "",
100
+ size: "default"
101
+ }, "\u6570\u636E\u6B63\u5728\u52AA\u529B\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u7B49~");
97
102
  }
98
103
  if (dataSource !== null && dataSource !== void 0 && dataSource.appData.delEvent) {
99
104
  return /*#__PURE__*/React.createElement("div", {
@@ -122,11 +127,10 @@ var IntervalEventChart = function IntervalEventChart(props) {
122
127
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IntervalChart, {
123
128
  dataSource: dataSource,
124
129
  showList: showList,
125
- dataSourceList: dataSourceList,
126
130
  params: params,
127
131
  onlyChart: props.onlyChart
128
132
  }), !props.onlyChart && /*#__PURE__*/React.createElement(EventTable, {
129
- dataSource: dataSource,
133
+ dataSource: props === null || props === void 0 ? void 0 : props.eventOldData,
130
134
  searchData: params,
131
135
  showList: [],
132
136
  changeShow: onChangeShow
@@ -1,5 +1,5 @@
1
1
  .custom-tooltip-chart {
2
- display: flex;
2
+ display: inline-block;
3
3
  flex-direction: column;
4
4
  flex-shrink: 0;
5
5
  gap: 4px;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { eventChartProps } from './types';
3
+ declare const IntervalChart: React.FC<eventChartProps.Props>;
4
+ export default IntervalChart;