From 0d00edd876dd34ee98654fd294eafb59d5347906 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Nov 2017 19:40:27 +0800 Subject: [PATCH] use Table column.align --- src/components/StandardTable/index.js | 7 ++----- src/routes/Dashboard/Analysis.js | 2 +- src/routes/Dashboard/Analysis.less | 5 ----- src/routes/Profile/BasicProfile.js | 6 +++--- src/routes/Profile/BasicProfile.less | 6 ------ 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/components/StandardTable/index.js b/src/components/StandardTable/index.js index 3a4ec8a8..66dba867 100644 --- a/src/components/StandardTable/index.js +++ b/src/components/StandardTable/index.js @@ -59,11 +59,8 @@ class StandardTable extends PureComponent { title: '服务调用次数', dataIndex: 'callNo', sorter: true, - render: val => ( -
- {val} 万 -
- ), + align: 'right', + render: val => `${val} 万`, }, { title: '状态', diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js index 1ef131ca..3f0b3765 100644 --- a/src/routes/Dashboard/Analysis.js +++ b/src/routes/Dashboard/Analysis.js @@ -177,7 +177,7 @@ export default class Analysis extends Component { {text}% ), - className: styles.alignRight, + align: 'right', }, ]; diff --git a/src/routes/Dashboard/Analysis.less b/src/routes/Dashboard/Analysis.less index cdd326e6..9b773a17 100644 --- a/src/routes/Dashboard/Analysis.less +++ b/src/routes/Dashboard/Analysis.less @@ -131,11 +131,6 @@ } } -td.alignRight, -th.alignRight { - text-align: right!important; -} - .trendText { margin-left: 8px; color: @heading-color; diff --git a/src/routes/Profile/BasicProfile.js b/src/routes/Profile/BasicProfile.js index 2efa34cd..da59fc2c 100644 --- a/src/routes/Profile/BasicProfile.js +++ b/src/routes/Profile/BasicProfile.js @@ -99,13 +99,13 @@ export default class BasicProfile extends Component { title: '单价', dataIndex: 'price', key: 'price', - className: 'col-money', + align: 'right', render: renderContent, }, { title: '数量(件)', dataIndex: 'num', key: 'num', - className: 'col-money', + align: 'right', render: (text, row, index) => { if (index < basicGoods.length) { return text; @@ -116,7 +116,7 @@ export default class BasicProfile extends Component { title: '金额', dataIndex: 'amount', key: 'amount', - className: 'col-money', + align: 'right', render: (text, row, index) => { if (index < basicGoods.length) { return text; diff --git a/src/routes/Profile/BasicProfile.less b/src/routes/Profile/BasicProfile.less index 2b543976..cb3e6a37 100644 --- a/src/routes/Profile/BasicProfile.less +++ b/src/routes/Profile/BasicProfile.less @@ -6,9 +6,3 @@ font-weight: 500; margin-bottom: 16px; } - -:global { - .col-money { - text-align: right!important; - } -} -- GitLab