| | |
| | | import { Form, Row, Col, Select, Button, Input, InputNumber, Radio } from 'antd' |
| | | import './index.scss' |
| | | |
| | | |
| | | class UniqueForm extends Component { |
| | | class ExcelInColumn extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | columns: PropTypes.array, // 列名集合 |
| | |
| | | this.props.form.setFieldsValue({ |
| | | Column: record.Column, |
| | | Text: record.Text, |
| | | required: record.required, |
| | | required: record.required || 'true', |
| | | import: record.import || 'true', |
| | | type: record.type |
| | | }) |
| | | if (record.type === 'Int' || /^Decimal/ig.test(record.type)) { |
| | |
| | | Column: '', |
| | | Text: '', |
| | | required: 'true', |
| | | import: 'true', |
| | | type: 'Nvarchar(50)' |
| | | }) |
| | | } |
| | |
| | | <Select.Option value="Decimal(18,2)"> Decimal(18,2) </Select.Option> |
| | | <Select.Option value="Decimal(18,4)"> Decimal(18,4) </Select.Option> |
| | | <Select.Option value="Decimal(18,6)"> Decimal(18,6) </Select.Option> |
| | | <Select.Option value="date"> date </Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | initialValue: 'true' |
| | | })( |
| | | <Radio.Group disabled={this.state.locked}> |
| | | <Radio value="true">{dict['model.true']}</Radio> |
| | | <Radio value="false">{dict['model.false']}</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={7}> |
| | | <Form.Item label={dict['model.import']}> |
| | | {getFieldDecorator('import', { |
| | | initialValue: 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">{dict['model.true']}</Radio> |
| | | <Radio value="false">{dict['model.false']}</Radio> |
| | | </Radio.Group> |
| | |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(UniqueForm) |
| | | export default Form.create()(ExcelInColumn) |