king
2020-10-20 7b01bec1609710729a868093ad69484ebea82d80
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React, {Component} from 'react'
import PropTypes from 'prop-types'
// import { fromJS } from 'immutable'
import { Col, Row } from 'antd'
 
import './index.scss'
 
 
class CheckCard extends Component {
  static propTpyes = {
    multiple: PropTypes.bool,    // 是否可多选
    width: PropTypes.number,     // 宽度
    display: PropTypes.string,   // 显示为:text(文本)、picture(图片)
    fields: PropTypes.array,     // 字段集
    options: PropTypes.array,    // 数据列表
    onChange: PropTypes.func,    // 数据切换
  }
 
  state = {
    selectKeys: null,       // 选中数据id
  }
 
  UNSAFE_componentWillMount () {
 
  }
 
  UNSAFE_componentWillReceiveProps (nextProps) {
 
  }
 
  getCards = () => {
    const { display, options, fields } = this.props
    if (display === 'picture') {
      return options.map(item => {
        <Col>
          <div>
            {fields.map(col => {
              return <span></span>
            })}
          </div>
        </Col>
      })
    } else {
      return <Col></Col>
    }
  }
 
  render() {
 
    return (
      <Row gutter={24}>{this.getCards()}</Row>
    )
  }
}
 
export default CheckCard