From 37758b8a6e6395eaa8efbed93689706895304bc2 Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Thu, 2 Nov 2017 09:52:58 +0800 Subject: [PATCH] Remove unnecessary dependency of components from scaffold --- src/components/ActiveChart/index.js | 5 ++++- src/components/ActiveChart/index.less | 3 --- src/components/Charts/ChartCard/index.less | 8 +++++++- src/components/Charts/Field/index.less | 1 - src/components/Charts/MiniProgress/index.less | 1 - src/components/Charts/Pie/index.js | 8 +++++--- src/components/Charts/Pie/index.less | 1 - src/components/Charts/Radar/index.less | 1 - src/components/Charts/WaterWave/index.less | 1 - src/components/Exception/index.less | 2 +- src/components/NumberInfo/index.less | 8 +++++++- src/components/StandardFormRow/index.less | 1 - src/components/StandardTable/index.less | 1 - src/components/TagSelect/index.less | 1 - src/components/Trend/index.less | 1 - 15 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/components/ActiveChart/index.js b/src/components/ActiveChart/index.js index 42e1694d..3b8e80dd 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 0f781470..8ecc3237 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 d6bb659e..2d60257b 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 69e265b3..8242dcc9 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 29314c6f..06823be4 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 8a0f3023..d40b6447 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 ad0823fe..84b23423 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 a3e85eeb..0e982724 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 7cb9a4ec..d185ca3b 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 3313f75f..22e0c1ee 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 2545624d..7c179ac3 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 760f8443..291d1273 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 31de3180..66e82488 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 eac1f711..df2669c4 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 47f39a30..48695c96 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; -- GitLab