From 769725931ef28d1a86b0fdd89cf5a44faf7bec27 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 03 八月 2020 12:07:57 +0800 Subject: [PATCH] 2020-08-03 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx | 47 +++++++++++++++++++++++++++++++---------------- 1 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx index b1e6c8f..d262c0b 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx @@ -1,10 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Select, Button, Input, InputNumber } from 'antd' +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, // 鍒楀悕闆嗗悎 @@ -33,7 +32,8 @@ 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)) { @@ -92,6 +92,7 @@ Column: '', Text: '', required: 'true', + import: 'true', type: 'Nvarchar(50)' }) } @@ -99,6 +100,7 @@ } render() { + const { dict } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -117,33 +119,33 @@ <Form {...formItemLayout} className="verify-form"> <Row gutter={24}> <Col span={7}> - <Form.Item label={'Column'}> + <Form.Item label={dict['model.form.field']}> {getFieldDecorator('Column', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'Column!' + message: dict['form.required.input'] + dict['model.form.field'] + '!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={7}> - <Form.Item label={'Text'}> + <Form.Item label={dict['model.name']}> {getFieldDecorator('Text', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'Text!' + message: this.props.dict['form.required.input'] + dict['model.name'] + '!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={7}> - <Form.Item label={'绫诲瀷'}> + <Form.Item label={dict['model.form.type']}> {getFieldDecorator('type', { initialValue: 'Nvarchar(50)' })( @@ -158,24 +160,37 @@ <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> </Col> <Col span={3} className="add"> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> - 淇濆瓨 + {dict['model.save']} </Button> </Col> <Col span={7}> - <Form.Item label={'鏄惁蹇呭~'}> + <Form.Item label={dict['model.required']}> {getFieldDecorator('required', { initialValue: 'true' })( - <Select disabled={this.state.locked}> - <Select.Option value="false"> 鍚� </Select.Option> - <Select.Option value="true"> 鏄� </Select.Option> - </Select> + <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> )} </Form.Item> </Col> @@ -199,4 +214,4 @@ } } -export default Form.create()(UniqueForm) \ No newline at end of file +export default Form.create()(ExcelInColumn) \ No newline at end of file -- Gitblit v1.8.0