@zgfe/modules-interval 1.0.23-zhongyuan.23 → 1.0.23-zhongyuan.24

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.
@@ -22,5 +22,8 @@ export interface EventTableProps {
22
22
  /**
23
23
  * 改变展示内容
24
24
  */
25
- changeShow: (names: string[]) => void;
25
+ changeShow: (names: {
26
+ label: string;
27
+ value: number;
28
+ }[]) => void;
26
29
  }
@@ -20,7 +20,7 @@ import { searchDataParams } from "../content/utils";
20
20
  import { ERROR_RESPONESE_CODE } from "../../constants/code";
21
21
  import { Spin } from 'antd';
22
22
  var IntervalEventChart = function IntervalEventChart(props) {
23
- var _dataSource$appData2;
23
+ var _dataSource$appData;
24
24
  var params = props.params,
25
25
  onChangeException = props.onChangeException;
26
26
  // 显示内容
@@ -47,16 +47,16 @@ var IntervalEventChart = function IntervalEventChart(props) {
47
47
 
48
48
  // 初始化,判断showList是否有值,如果没值,取结果的前10条
49
49
  useEffect(function () {
50
- var _dataSource$appData, _dataSource$appData$s;
51
- var dataSource = props.dataSource;
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) {
50
+ var _dataSourceCopy$appDa, _dataSourceCopy$appDa2;
51
+ var dataSourceCopy = props.dataSource;
52
+ if ((dataSourceCopy === null || dataSourceCopy === void 0 ? void 0 : (_dataSourceCopy$appDa = dataSourceCopy.appData) === null || _dataSourceCopy$appDa === void 0 ? void 0 : (_dataSourceCopy$appDa2 = _dataSourceCopy$appDa.series) === null || _dataSourceCopy$appDa2 === void 0 ? void 0 : _dataSourceCopy$appDa2.length) > 0) {
53
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);
55
- var app = getDefaultShow(dataSource, arr);
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(dataSourceCopy)) === null || _extractNames2 === void 0 ? void 0 : _extractNames2.splice(0, 4);
55
+ var app = getDefaultShow(dataSourceCopy, arr);
56
56
  setShowList(app);
57
57
  setDataSource(app);
58
58
  } else {
59
- setDataSource(dataSource);
59
+ setDataSource(dataSourceCopy);
60
60
  }
61
61
  }, [params === null || params === void 0 ? void 0 : params.displaySetup, props.dataSource, params]);
62
62
  var fetchResult = function fetchResult() {
@@ -119,7 +119,7 @@ var IntervalEventChart = function IntervalEventChart(props) {
119
119
  }, "\u4E8B\u4EF6\u5DF2\u88AB\u5220\u9664\u65E0\u6CD5\u67E5\u770B\uFF0C\u8BF7\u91CD\u65B0\u8BBE\u7F6E")
120
120
  }));
121
121
  }
122
- if (!dataSource || !(dataSource !== null && dataSource !== void 0 && (_dataSource$appData2 = dataSource.appData) !== null && _dataSource$appData2 !== void 0 && _dataSource$appData2.series.length)) {
122
+ if (!dataSource || !(dataSource !== null && dataSource !== void 0 && (_dataSource$appData = dataSource.appData) !== null && _dataSource$appData !== void 0 && _dataSource$appData.series.length)) {
123
123
  return /*#__PURE__*/React.createElement(MiNone, {
124
124
  label: !dataSource ? '请选择条件进行查询' : '暂无数据'
125
125
  });
@@ -21,6 +21,7 @@ var _currentAxisBreaks = [{
21
21
  gap: '1.5%'
22
22
  }];
23
23
  var IntervalChart = function IntervalChart(props) {
24
+ var _props$dataSource2, _props$dataSource2$ap;
24
25
  var _useState = useState({}),
25
26
  _useState2 = _slicedToArray(_useState, 2),
26
27
  optionECharts = _useState2[0],
@@ -37,9 +38,13 @@ var IntervalChart = function IntervalChart(props) {
37
38
  }, []);
38
39
  useEffect(function () {
39
40
  var _props$showList$appDa, _props$showList, _props$dataSource, _seriesData$series;
40
- // chartRef && chartRef.current.getEchartsInstance().clear();
41
+ chartInstance && chartInstance.clear();
41
42
  var seriesData = (_props$showList$appDa = props === null || props === void 0 ? void 0 : (_props$showList = props.showList) === null || _props$showList === void 0 ? void 0 : _props$showList.appData) !== null && _props$showList$appDa !== void 0 ? _props$showList$appDa : props === null || props === void 0 ? void 0 : (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.appData;
42
43
  var params = props === null || props === void 0 ? void 0 : props.params;
44
+ var hasUndefined = convertDateArray(params, seriesData === null || seriesData === void 0 ? void 0 : seriesData.xAxis).some(function (item) {
45
+ return item === undefined;
46
+ });
47
+ if (hasUndefined) return;
43
48
  var eCharts = {
44
49
  tooltip: {
45
50
  trigger: 'item',
@@ -233,10 +238,14 @@ var IntervalChart = function IntervalChart(props) {
233
238
  setOptionECharts(function () {
234
239
  return eCharts;
235
240
  });
236
- }, [props === null || props === void 0 ? void 0 : props.showList]);
241
+ }, [props === null || props === void 0 ? void 0 : (_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : (_props$dataSource2$ap = _props$dataSource2.appData) === null || _props$dataSource2$ap === void 0 ? void 0 : _props$dataSource2$ap.xAxis]);
237
242
  useEffect(function () {
238
243
  // true 表示ecahrt不合并,直接替换
239
- chartInstance && chartInstance.setOption(optionECharts, true);
244
+ chartInstance && chartInstance.setOption(optionECharts, {
245
+ notMerge: true,
246
+ // 核心:不合并新旧配置,完全覆盖
247
+ lazyUpdate: false // 立即更新,不延迟渲染
248
+ });
240
249
  }, [optionECharts]);
241
250
  useEffect(function () {
242
251
  setTimeout(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-interval",
3
- "version": "1.0.23-zhongyuan.23",
3
+ "version": "1.0.23-zhongyuan.24",
4
4
  "private": false,
5
5
  "module": "dist/esm/index.js",
6
6
  "typings": "dist/esm/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "ab04d73432d30deffb9217192f7cbb2a6a2e7672",
62
+ "gitHead": "9d7d3c7b598f1aca3c87ddc179c2ca4748b1ff02",
63
63
  "gitHooks": {
64
64
  "pre-commit": "lint-staged"
65
65
  }