| | |
| | | let _type = props.card.type |
| | | |
| | | if (!props.card.origin) { |
| | | if (props.type === 'columns') { |
| | | if (_type !== 'number') { |
| | | _type = 'text' |
| | | } |
| | | } else if (props.type === 'search') { |
| | | // if (props.type === 'columns') { |
| | | // if (_type !== 'number') { |
| | | // _type = 'text' |
| | | // } |
| | | // } |
| | | if (props.type === 'search') { |
| | | if (_type === 'date' || _type === 'datetime') { |
| | | _type = 'date' |
| | | } else if (_type !== 'select') { |
| | |
| | | |
| | | render() { |
| | | const { card, type } = this.state |
| | | |
| | | let hasPadding = type === 'search' || type === 'form' |
| | | |
| | | return ( |
| | | <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '') + (card.origin ? ' fixed' : '')} > |
| | | <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '') + (card.origin ? ' fixed' : '') + (hasPadding ? ' has-padding' : '')} > |
| | | <div className="base" onClick={this.changeSelect}> |
| | | <CheckOutlined /> |
| | | <p title={card.field}>字段: <span>{card.field}</span></p> |
| | |
| | | <Radio value="date">date</Radio> |
| | | </Radio.Group> : null |
| | | } |
| | | {type === 'columns' ? |
| | | {/* {type === 'columns' ? |
| | | <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}> |
| | | <Radio value="text">text</Radio> |
| | | <Radio value="number">number</Radio> |
| | | </Radio.Group> : null |
| | | } |
| | | } */} |
| | | {type === 'form' ? |
| | | <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}> |
| | | <Radio value="text">text</Radio> |