@zgfe/modules-interval 1.0.23-zhongyuan.3 → 1.0.23-zhongyuan.4

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.
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  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; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useEffect, useState } from 'react';
7
+ import React, { useEffect, useRef, useState } from 'react';
8
8
  import ReactECharts from 'echarts-for-react';
9
9
  import * as echarts from 'echarts';
10
10
  import { renderToString } from 'react-dom/server';
@@ -17,8 +17,10 @@ var IntervalChart = function IntervalChart(props) {
17
17
  _useState2 = _slicedToArray(_useState, 2),
18
18
  option = _useState2[0],
19
19
  setOption = _useState2[1];
20
+ var chartRef = useRef(null);
20
21
  useEffect(function () {
21
22
  var _props$showList, _seriesData$series;
23
+ chartRef && chartRef.current.getEchartsInstance().clear();
22
24
  var seriesData = props === null || props === void 0 ? void 0 : (_props$showList = props.showList) === null || _props$showList === void 0 ? void 0 : _props$showList.appData;
23
25
  var params = props === null || props === void 0 ? void 0 : props.params;
24
26
  var eCharts = {
@@ -134,6 +136,7 @@ var IntervalChart = function IntervalChart(props) {
134
136
  setOption(eCharts);
135
137
  }, [props === null || props === void 0 ? void 0 : props.showList]);
136
138
  return /*#__PURE__*/React.createElement(ReactECharts, {
139
+ ref: chartRef,
137
140
  style: {
138
141
  height: '431px',
139
142
  padding: 24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-interval",
3
- "version": "1.0.23-zhongyuan.3",
3
+ "version": "1.0.23-zhongyuan.4",
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": "e8c97df2f4e849232f643a5b105e36f497101ba0",
62
+ "gitHead": "599fc20cb8e246a28c2b87530fd34736c15d13ed",
63
63
  "gitHooks": {
64
64
  "pre-commit": "lint-staged"
65
65
  }