From 3c18317cdecb91462a406d7e73a72649e4cde84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Wed, 7 Feb 2018 15:16:09 +0800 Subject: [PATCH] div to fragment (#883) * div to fragment * Remove extra divs * fix indent --- src/components/Charts/Radar/index.js | 139 ++++++++++++++------------ src/components/StandardTable/index.js | 6 +- src/layouts/BasicLayout.js | 6 +- src/layouts/UserLayout.js | 4 +- src/routes/Dashboard/Analysis.js | 6 +- src/routes/Dashboard/Monitor.js | 6 +- src/routes/Forms/StepForm/Step1.js | 6 +- src/routes/Forms/StepForm/Step3.js | 6 +- src/routes/Forms/StepForm/index.js | 6 +- src/routes/Forms/TableForm.js | 6 +- src/routes/List/Articles.js | 6 +- src/routes/Profile/AdvancedProfile.js | 14 +-- src/routes/Result/Error.js | 6 +- src/routes/Result/Success.js | 10 +- 14 files changed, 117 insertions(+), 110 deletions(-) diff --git a/src/components/Charts/Radar/index.js b/src/components/Charts/Radar/index.js index 03aaa700..b7f7caf3 100644 --- a/src/components/Charts/Radar/index.js +++ b/src/components/Charts/Radar/index.js @@ -60,7 +60,9 @@ export default class Radar extends Component { const { legendData } = this.state; legendData[i] = newItem; - const filteredLegendData = legendData.filter(l => l.checked).map(l => l.name); + const filteredLegendData = legendData + .filter(l => l.checked) + .map(l => l.name); if (this.chart) { this.chart.filter('name', val => filteredLegendData.indexOf(val) > -1); @@ -109,71 +111,76 @@ export default class Radar extends Component { return (
-
- {title &&

{title}

} - - - - - - - - - {hasLegend && ( - - {legendData.map((item, i) => ( - this.handleLegendClick(item, i)} - > -
-

- - {item.name} -

-
{item.value}
-
- - ))} -
- )} -
+ {title &&

{title}

} + + + + + + + + + {hasLegend && ( + + {legendData.map((item, i) => ( + this.handleLegendClick(item, i)} + > +
+

+ + {item.name} +

+
{item.value}
+
+ + ))} +
+ )}
); } diff --git a/src/components/StandardTable/index.js b/src/components/StandardTable/index.js index 907e8280..a2c35eaf 100644 --- a/src/components/StandardTable/index.js +++ b/src/components/StandardTable/index.js @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import React, { PureComponent, Fragment } from 'react'; import { Table, Alert } from 'antd'; import styles from './index.less'; @@ -84,7 +84,7 @@ class StandardTable extends PureComponent {
+ 已选择 {selectedRowKeys.length} 项   { needTotalList.map(item => ( @@ -97,7 +97,7 @@ class StandardTable extends PureComponent { ) } 清空 -
+ )} type="info" showIcon diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index f8c956a9..062198c1 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { Layout, Icon, message } from 'antd'; import DocumentTitle from 'react-document-title'; @@ -222,9 +222,9 @@ class BasicLayout extends React.PureComponent { blankTarget: true, }]} copyright={ -
+ Copyright 2018 蚂蚁金服体验技术部出品 -
+ } /> diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 946fc953..e736b2a0 100644 --- a/src/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { Link, Redirect, Switch, Route } from 'dva/router'; import DocumentTitle from 'react-document-title'; import { Icon } from 'antd'; @@ -21,7 +21,7 @@ const links = [{ href: '', }]; -const copyright =
Copyright 2018 蚂蚁金服体验技术部出品
; +const copyright = Copyright 2018 蚂蚁金服体验技术部出品; class UserLayout extends React.PureComponent { getPageTitle() { diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js index 2f98da8d..f6df4406 100644 --- a/src/routes/Dashboard/Analysis.js +++ b/src/routes/Dashboard/Analysis.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { Component, Fragment } from 'react'; import { connect } from 'dva'; import { Row, @@ -241,7 +241,7 @@ export default class Analysis extends Component { }; return ( -
+ -
+ ); } } diff --git a/src/routes/Dashboard/Monitor.js b/src/routes/Dashboard/Monitor.js index 4526f121..897dc9ce 100644 --- a/src/routes/Dashboard/Monitor.js +++ b/src/routes/Dashboard/Monitor.js @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import React, { PureComponent, Fragment } from 'react'; import { connect } from 'dva'; import { Row, Col, Card, Tooltip } from 'antd'; import numeral from 'numeral'; @@ -35,7 +35,7 @@ export default class Monitor extends PureComponent { const { tags } = monitor; return ( -
+ @@ -164,7 +164,7 @@ export default class Monitor extends PureComponent { -
+ ); } } diff --git a/src/routes/Forms/StepForm/Step1.js b/src/routes/Forms/StepForm/Step1.js index 2a962fbc..01cf0df2 100644 --- a/src/routes/Forms/StepForm/Step1.js +++ b/src/routes/Forms/StepForm/Step1.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { connect } from 'dva'; import { Form, Input, Button, Select, Divider } from 'antd'; import { routerRedux } from 'dva/router'; @@ -32,7 +32,7 @@ class Step1 extends React.PureComponent { }); }; return ( -
+
转账到银行卡

如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。

- + ); } } diff --git a/src/routes/Forms/StepForm/Step3.js b/src/routes/Forms/StepForm/Step3.js index 78295ae4..8df6388d 100644 --- a/src/routes/Forms/StepForm/Step3.js +++ b/src/routes/Forms/StepForm/Step3.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { connect } from 'dva'; import { Button, Row, Col } from 'antd'; import { routerRedux } from 'dva/router'; @@ -32,14 +32,14 @@ class Step3 extends React.PureComponent { ); const actions = ( -
+ -
+ ); return ( -
+ @@ -45,7 +45,7 @@ export default class StepForm extends PureComponent { -
+
); diff --git a/src/routes/Forms/TableForm.js b/src/routes/Forms/TableForm.js index a8b18c6f..be01d82f 100644 --- a/src/routes/Forms/TableForm.js +++ b/src/routes/Forms/TableForm.js @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import React, { PureComponent, Fragment } from 'react'; import { Table, Button, Input, message, Popconfirm, Divider } from 'antd'; import styles from './style.less'; @@ -203,7 +203,7 @@ export default class TableForm extends PureComponent { }]; return ( -
+ 新增成员 - + ); } } diff --git a/src/routes/List/Articles.js b/src/routes/List/Articles.js index f7aac69a..436a7fa5 100644 --- a/src/routes/List/Articles.js +++ b/src/routes/List/Articles.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { Component, Fragment } from 'react'; import moment from 'moment'; import { connect } from 'dva'; import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd'; @@ -99,7 +99,7 @@ export default class SearchList extends Component { ) : null; return ( -
+ @@ -230,7 +230,7 @@ export default class SearchList extends Component { )} /> -
+ ); } } diff --git a/src/routes/Profile/AdvancedProfile.js b/src/routes/Profile/AdvancedProfile.js index 4f955079..3c0bb252 100644 --- a/src/routes/Profile/AdvancedProfile.js +++ b/src/routes/Profile/AdvancedProfile.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { Component, Fragment } from 'react'; import Debounce from 'lodash-decorators/debounce'; import Bind from 'lodash-decorators/bind'; import { connect } from 'dva'; @@ -23,7 +23,7 @@ const menu = ( ); const action = ( -
+ @@ -32,7 +32,7 @@ const action = ( -
+ ); const extra = ( @@ -69,20 +69,20 @@ const tabList = [{ const desc1 = (
-
+ 曲丽丽 -
+
2016-12-12 12:32
); const desc2 = (
-
+ 周毛毛 -
+
); diff --git a/src/routes/Result/Error.js b/src/routes/Result/Error.js index dee00f84..7ff64393 100644 --- a/src/routes/Result/Error.js +++ b/src/routes/Result/Error.js @@ -1,10 +1,10 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { Button, Icon, Card } from 'antd'; import Result from '../../components/Result'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; const extra = ( -
+
您提交的内容有如下错误:
@@ -16,7 +16,7 @@ const extra = ( 您的账户还不具备申请资格 立即升级
- + ); const actions = ; diff --git a/src/routes/Result/Success.js b/src/routes/Result/Success.js index 13dbbe85..f7aabd7f 100644 --- a/src/routes/Result/Success.js +++ b/src/routes/Result/Success.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import Result from '../../components/Result'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; @@ -24,7 +24,7 @@ const desc2 = ( ); const extra = ( -
+
项目名称
@@ -48,15 +48,15 @@ const extra = ( 财务复核} /> 完成} /> -
+ ); const actions = ( -
+ -
+ ); export default () => ( -- GitLab