| | |
| | | const { display, width, options, fields, ratio, picratio, backgroundColor, borderColor } = this.props.config |
| | | |
| | | let _ratio = picratio || ratio |
| | | let _options = [] |
| | | let paddingTop = '100%' |
| | | if (_ratio === '4:3') { |
| | | paddingTop = '75%' |
| | |
| | | paddingTop = '66.7%' |
| | | } else if (_ratio === '16:9') { |
| | | paddingTop = '56.25%' |
| | | } |
| | | |
| | | if (options) { |
| | | _options = options.filter(op => !op.Hide) |
| | | } |
| | | |
| | | let style = {} |
| | |
| | | if (display !== 'picture') { |
| | | let _style = backgroundColor ? {backgroundColor} : null |
| | | |
| | | if (!options || options.length === 0) { |
| | | if (_options.length === 0) { |
| | | return <Col span={width}> |
| | | <div className="card-cell" style={style}> |
| | | <div className="bg-mask" style={_style}></div> |
| | |
| | | </div> |
| | | </Col> |
| | | } |
| | | return options.map(item => { |
| | | return _options.map(item => { |
| | | return <Col span={width} key={item.key}> |
| | | <div className="card-cell" style={style}> |
| | | <div className="bg-mask" style={_style}></div> |
| | |
| | | </Col> |
| | | }) |
| | | } else { |
| | | if (!options || options.length === 0) { |
| | | if (_options.length === 0) { |
| | | return <Col span={width}> |
| | | <div className="card-pic-cell" style={{...style, paddingTop, background: '#91d5ff'}}> |
| | | </div> |
| | | </Col> |
| | | } |
| | | return options.map(item => { |
| | | return _options.map(item => { |
| | | return <Col span={width} key={item.key}> |
| | | <div className="card-pic-cell" style={{...style, paddingTop, backgroundImage: `url(${item.$url})`}}> |
| | | </div> |