diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js index f025825fd7a949bcf8fe2891b3fe657bf8064053..75f85791dfad020b5333cefec339005794ffcbee 100644 --- a/src/routes/Dashboard/Analysis.js +++ b/src/routes/Dashboard/Analysis.js @@ -75,6 +75,17 @@ export default class Analysis extends Component { }); } + isActive(type) { + const { rangePickerValue } = this.state; + const value = getTimeDistance(type); + if (!rangePickerValue[0] || !rangePickerValue[1]) { + return; + } + if (rangePickerValue[0].isSame(value[0], 'day') && rangePickerValue[1].isSame(value[1], 'day')) { + return styles.currentDate; + } + } + render() { const { rangePickerValue, salesType, currentTabKey } = this.state; const { chart } = this.props; @@ -104,10 +115,18 @@ export default class Analysis extends Component { const salesExtra = (
- this.selectDate('today')}>今日 - this.selectDate('week')}>本周 - this.selectDate('month')}>本月 - this.selectDate('year')}>全年 + this.selectDate('today')}> + 今日 + + this.selectDate('week')}> + 本周 + + this.selectDate('month')}> + 本月 + + this.selectDate('year')}> + 全年 +