king
2021-01-07 696d85238a734a4b691f486fde05c93fc5dba3ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Tag } from 'antd'
import './index.scss'
 
const { CheckableTag } = Tag
 
class DateGroup extends Component {
  static propTpyes = {
    card: PropTypes.object    // 字典项
  }
 
  render() {
    const { card } = this.props
    let tabs = {day: '日', week: '周', month: '月', quarter: '季', year: '年', customized: '自定义'}
 
    return (
      <div className="model-date-group">
        {card.items.map(tab => (
          <CheckableTag
            key={tab}
            checked={card.initval && card.initval.includes(tab)}
          >
            {tabs[tab]}
          </CheckableTag>
        ))}
      </div>
    )
  }
}
 
export default DateGroup