From bbb44ba8f70a551a371ea44bc66087d192802f34 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 2 Sep 2018 17:51:27 +0800 Subject: [PATCH] Improve details --- src/components/NumberInfo/index.js | 15 +++++++++++++-- src/locales/en-US.js | 8 ++++---- src/pages/Dashboard/Analysis.js | 16 +++++++++++++--- src/pages/Dashboard/Analysis.less | 24 +++++++++++++++--------- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/components/NumberInfo/index.js b/src/components/NumberInfo/index.js index cf25d6a0..717aee9d 100644 --- a/src/components/NumberInfo/index.js +++ b/src/components/NumberInfo/index.js @@ -10,8 +10,19 @@ const NumberInfo = ({ theme, title, subTitle, total, subTotal, status, suffix, g })} {...rest} > - {title &&
{title}
} - {subTitle &&
{subTitle}
} + {title && ( +
+ {title} +
+ )} + {subTitle && ( +
+ {subTitle} +
+ )}
{total} diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 6986b8d3..729836ec 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -38,19 +38,19 @@ export default { 'app.home.introduce': 'introduce', 'app.analysis.test': 'Gongzhuan No.{no} shop', 'app.analysis.introduce': 'Introduce', - 'app.analysis.total-sales': 'total sales', + 'app.analysis.total-sales': 'Total Sales', 'app.analysis.day-sales': 'Day Sales', 'app.analysis.visits': 'Visits', 'app.analysis.visits-trend': 'Visits Trend', 'app.analysis.visits-ranking': 'Visits Ranking', 'app.analysis.day-visits': 'Day Visits', - 'app.analysis.week': 'week ratio', - 'app.analysis.day': 'day ratio', + 'app.analysis.week': 'Week Ratio', + 'app.analysis.day': 'Day Ratio', 'app.analysis.payments': 'Payments', 'app.analysis.conversion-rate': 'Conversion Rate', 'app.analysis.operational-effect': 'Operational Effect', 'app.analysis.sales-trend': 'Stores Sales Trend', - 'app.analysis.sales-ranking': 'sales ranking', + 'app.analysis.sales-ranking': 'Sales Ranking', 'app.analysis.all-year': 'All Year', 'app.analysis.all-month': 'All Month', 'app.analysis.all-week': 'All Week', diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index e0be87b2..acfc28a2 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -456,9 +456,19 @@ class Analysis extends Component {
    {this.rankingListData.map((item, i) => (
  • - {i + 1} - {item.title} - {numeral(item.total).format('0,0')} + + {i + 1} + + + {item.title} + + + {numeral(item.total).format('0,0')} +
  • ))}
diff --git a/src/pages/Dashboard/Analysis.less b/src/pages/Dashboard/Analysis.less index 8f3eb388..35a93fa7 100644 --- a/src/pages/Dashboard/Analysis.less +++ b/src/pages/Dashboard/Analysis.less @@ -20,30 +20,36 @@ li { .clearfix(); margin-top: 16px; + display: flex; + align-items: center; span { color: @text-color; font-size: 14px; line-height: 22px; } - span:first-child { + .rankingItemNumber { background-color: @background-color-base; border-radius: 20px; display: inline-block; font-size: 12px; font-weight: 600; - margin-right: 24px; + margin-right: 16px; height: 20px; line-height: 20px; width: 20px; text-align: center; + margin-top: 1.5px; + &.active { + background-color: #314659; + color: #fff; + } } - span.active { - //background-color: @primary-color; - background-color: #314659; - color: #fff; - } - span:last-child { - float: right; + .rankingItemTitle { + flex: 1; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + margin-right: 8px; } } } -- GitLab