king
2020-08-06 b77c5e22f1ff192d9b09dda8d2376ba40641451c
src/tabviews/zshare/dategroup/yearpicker/index.jsx
@@ -7,6 +7,7 @@
class QuarterPicker extends Component {
  static propTpyes = {
    dict: PropTypes.object,    // 字典项
    card: PropTypes.object,    // 搜索配置
    onChange: PropTypes.func
  }
@@ -16,7 +17,19 @@
  }
  UNSAFE_componentWillMount () {
    const { year } = this.state
    const { card } = this.props
    const { selectYear } = this.state
    let year = this.state.year
    if (card.initval && card.initval[0]) {
      let _type = card.initval[0]
      let _val = parseInt(card.initval[1])
      if (_type === 'year' && _val) {
        this.setState({selectYear: selectYear - _val})
        year = Math.floor((selectYear - _val) / 10) * 10
      }
    }
    this.setState({
      yearlist: [
@@ -24,7 +37,8 @@
        [{value: year + 2, type: ''}, {value: year + 3, type: ''}, {value: year + 4, type: ''}],
        [{value: year + 5, type: ''}, {value: year + 6, type: ''}, {value: year + 7, type: ''}],
        [{value: year + 8, type: ''}, {value: year + 9, type: ''}, {value: year + 10, type: 'down'}],
      ]
      ],
      year
    })
  }