| | |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | | btn: PropTypes.object, // 字典项 |
| | | dict: PropTypes.object, // 字典项 |
| | | fields: PropTypes.array, // 表单字段 |
| | | uniqueChange: PropTypes.func // 修改函数 |
| | |
| | | } |
| | | |
| | | edit = (record) => { |
| | | const { btn } = this.props |
| | | |
| | | this.setState({ |
| | | editItem: record |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | field: record.field.split(','), |
| | | errorCode: record.errorCode, |
| | | verifyType: record.verifyType || 'physical' |
| | | }) |
| | | let _value = { |
| | | field: record.field.split(',') |
| | | } |
| | | |
| | | if (btn.Ot !== 'requiredOnce') { |
| | | _value.errorCode = record.errorCode |
| | | _value.verifyType = record.verifyType || 'physical' |
| | | } |
| | | |
| | | this.props.form.setFieldsValue(_value) |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { fields } = this.props |
| | | const { fields, btn } = this.props |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6}> |
| | | {btn.Ot !== 'requiredOnce' ? <Col span={6}> |
| | | <Form.Item label={'报错编码'}> |
| | | {getFieldDecorator('errorCode', { |
| | | initialValue: 'E', |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={6}> |
| | | </Col> : null} |
| | | {btn.Ot !== 'requiredOnce' ? <Col span={6}> |
| | | <Form.Item label={'验证类型'}> |
| | | {getFieldDecorator('verifyType', { |
| | | initialValue: 'physical', |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={4} className="add"> |
| | | <Button onClick={this.handleConfirm} className="mk-green"> |
| | | 保存 |