| | |
| | | import React, {Component} from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Row, Col, Icon, Radio, Input, Button } from 'antd' |
| | | import { Row, Col, Radio, Input, Button } from 'antd' |
| | | import { CheckOutlined } from '@ant-design/icons' |
| | | import './index.scss' |
| | | |
| | | const { Search } = Input |
| | |
| | | super(props) |
| | | |
| | | let _type = props.card.type |
| | | if (props.type === 'columns') { |
| | | if (_type === 'date' || _type === 'datetime') { |
| | | _type = 'text' |
| | | |
| | | if (!props.card.origin) { |
| | | if (props.type === 'columns') { |
| | | if (_type !== 'number') { |
| | | _type = 'text' |
| | | } |
| | | } else if (props.type === 'search') { |
| | | if (_type !== 'select') { |
| | | _type = 'text' |
| | | } |
| | | } else if (props.type === 'form') { |
| | | if (_type === 'datetime' || _type === 'date') { |
| | | _type = 'date' |
| | | } else if (_type !== 'number') { |
| | | _type = 'text' |
| | | } |
| | | } |
| | | } else if (props.type === 'search') { |
| | | if (_type === 'number') { |
| | | _type = 'text' |
| | | } else if (_type === 'datetime') { |
| | | _type = 'daterange' |
| | | } |
| | | } else if (props.type === 'form') { |
| | | |
| | | } |
| | | |
| | | this.state = { |
| | |
| | | return ( |
| | | <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '') + (card.origin ? ' fixed' : '')} > |
| | | <div className="base" onClick={this.changeSelect}> |
| | | <Icon type="check" /> |
| | | <CheckOutlined /> |
| | | <p title={card.field}>字段: <span>{card.field}</span></p> |
| | | <p title={card.label}>名称: <span>{card.label}</span></p> |
| | | </div> |
| | |
| | | <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}> |
| | | <Radio value="text">text</Radio> |
| | | <Radio value="select">select</Radio> |
| | | <Radio value="daterange">dateRange</Radio> |
| | | </Radio.Group> : null |
| | | } |
| | | {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 value="picture">picture</Radio> |
| | | </Radio.Group> : null |
| | | } |
| | | {type === 'form' ? |