diff --git a/src/components/ActiveChart/index.js b/src/components/ActiveChart/index.js index 42e1694dff7b00918588bb35b7e8ee918563d58f..3b8e80ddcc05ed5aff9397b643fd254a9a5d40ba 100644 --- a/src/components/ActiveChart/index.js +++ b/src/components/ActiveChart/index.js @@ -2,10 +2,13 @@ import React, { PureComponent } from 'react'; import { MiniArea } from '../Charts'; import NumberInfo from '../NumberInfo'; -import { fixedZero } from '../../utils/utils'; import styles from './index.less'; +function fixedZero(val) { + return val * 1 < 10 ? `0${val}` : val; +} + function getActiveData() { const activeData = []; for (let i = 0; i < 24; i += 1) { diff --git a/src/components/ActiveChart/index.less b/src/components/ActiveChart/index.less index 0f7814702c7164b7e6685f29e85b883b348d5313..8ecc3237abe5c7e1c58925c59d8cdf10fbb285cd 100644 --- a/src/components/ActiveChart/index.less +++ b/src/components/ActiveChart/index.less @@ -1,6 +1,3 @@ -@import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; - .activeChart { position: relative; } diff --git a/src/components/Charts/ChartCard/index.less b/src/components/Charts/ChartCard/index.less index d6bb659eff3a1db9989a168e2968acc1757d4297..2d60257baab990e8c00c8a3ce530bcc42aa378c5 100644 --- a/src/components/Charts/ChartCard/index.less +++ b/src/components/Charts/ChartCard/index.less @@ -1,5 +1,11 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../../utils/utils.less"; + +.textOverflow() { + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + white-space: nowrap; +} .chartCard { position: relative; diff --git a/src/components/Charts/Field/index.less b/src/components/Charts/Field/index.less index 69e265b33144b202f3c858f0873e9b2779ab27ac..8242dcc9d2358dcdfb6ec0f2447b14d2736e32af 100644 --- a/src/components/Charts/Field/index.less +++ b/src/components/Charts/Field/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../../utils/utils.less"; .field { white-space: nowrap; diff --git a/src/components/Charts/MiniProgress/index.less b/src/components/Charts/MiniProgress/index.less index 29314c6f15a7bb14622dca68eb524b04a548f11d..06823be4a77eaef6781b33eb763789507ae1ab8f 100644 --- a/src/components/Charts/MiniProgress/index.less +++ b/src/components/Charts/MiniProgress/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../../utils/utils.less"; .miniProgress { padding: 5px 0; diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index 8a0f3023b89a9e83460e1b2830ce8e63cd3d9490..d40b6447eee758f7536e63c71fbe0bde20671111 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -45,14 +45,16 @@ class Pie extends Component { if (!this.state.legendBlock) { this.setState({ legendBlock: true, + }, () => { + this.renderChart(); }); - this.renderChart(); } } else if (this.state.legendBlock) { this.setState({ legendBlock: false, + }, () => { + this.renderChart(); }); - this.renderChart(); } } @@ -94,7 +96,7 @@ class Pie extends Component { animate = true, colors, lineWidth = 0, - } = this.props; + } = this.props; const defaultColors = colors; diff --git a/src/components/Charts/Pie/index.less b/src/components/Charts/Pie/index.less index ad0823fea2b7dad107d856fb2dfce33f0e3bd4eb..84b234231542e31606f826d6407b2e7c1777ce8f 100644 --- a/src/components/Charts/Pie/index.less +++ b/src/components/Charts/Pie/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../../utils/utils.less"; .pie { position: relative; diff --git a/src/components/Charts/Radar/index.less b/src/components/Charts/Radar/index.less index a3e85eeb44f4f5f87e1d510a559902f4d33d3020..0e9827241f2eeb3d30d3709cb5c4a09ce8e9de7b 100644 --- a/src/components/Charts/Radar/index.less +++ b/src/components/Charts/Radar/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../../utils/utils.less"; .radar { .legend { diff --git a/src/components/Charts/WaterWave/index.less b/src/components/Charts/WaterWave/index.less index 7cb9a4ecac824a76fee7f42eb7031faacf93eb5c..d185ca3b3b27830d5223b2e438cc941f4f7c1e12 100644 --- a/src/components/Charts/WaterWave/index.less +++ b/src/components/Charts/WaterWave/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../../utils/utils.less"; .waterWave { display: inline-block; diff --git a/src/components/Exception/index.less b/src/components/Exception/index.less index 3313f75f2c6f1a9590fda7c594b566589d90e3b8..22e0c1ee229bc0378c416dd2e8149729652e83b9 100644 --- a/src/components/Exception/index.less +++ b/src/components/Exception/index.less @@ -1,5 +1,5 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; +@import "~antd/lib/style/mixins/clearfix.less"; .exception { display: flex; diff --git a/src/components/NumberInfo/index.less b/src/components/NumberInfo/index.less index 2545624d3c6d851061119fd6314d8cf90636a7e5..7c179ac32b4a9edbb75146be370b0261c8f5c3c3 100644 --- a/src/components/NumberInfo/index.less +++ b/src/components/NumberInfo/index.less @@ -1,5 +1,11 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; + +.textOverflow() { + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + white-space: nowrap; +} .numberInfo { .suffix { diff --git a/src/components/StandardFormRow/index.less b/src/components/StandardFormRow/index.less index 760f84437369470a04ffaf7fc68cabd82c9d11cb..291d127313c49785b3f761eb82260e7039b4640b 100644 --- a/src/components/StandardFormRow/index.less +++ b/src/components/StandardFormRow/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; .standardFormRow { border-bottom: 1px dashed @border-color-split; diff --git a/src/components/StandardTable/index.less b/src/components/StandardTable/index.less index 31de3180eba02a36ea6c708c8f315e07ce1c6122..66e824884b83cc19102fefc7938b8b0d99e40b34 100644 --- a/src/components/StandardTable/index.less +++ b/src/components/StandardTable/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; .standardTable { :global { diff --git a/src/components/TagSelect/index.less b/src/components/TagSelect/index.less index eac1f711b4d1522b672fd92af967ffe602bf6d56..df2669c48af830fe28e345f0353e027fe81379a8 100644 --- a/src/components/TagSelect/index.less +++ b/src/components/TagSelect/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; .tagSelect { user-select: none; diff --git a/src/components/Trend/index.less b/src/components/Trend/index.less index 47f39a30f93c1c19b7178679fabb4cabee4d3b05..48695c967f4b143e500d032d4d58da2abf754002 100644 --- a/src/components/Trend/index.less +++ b/src/components/Trend/index.less @@ -1,5 +1,4 @@ @import "~antd/lib/style/themes/default.less"; -@import "../../utils/utils.less"; .trendItem { display: inline-block;