import React from 'react'; import { Input, Button, Form, Select, Radio, Upload, Icon, Spin, message, InputNumber } from 'antd'; import './person.less'; import { addressInit } from '../../tools.js'; const FormItem = Form.Item; const Option = Select.Option; const RadioGroup = Radio.Group; const edulvlArr = ["企业", "院校", "研究机构", "政府部门", "非法人团体"]; const zizhiArr = ["高新技术型企业", "创新型企业", "双软企业", "小心微利企业", "科技部认定示范企业","其他"]; function getBase64(img, callback) { const reader = new FileReader(); reader.addEventListener('load', () => callback(reader.result)); reader.readAsDataURL(img); }; function beforeUpload(file) { const isJPG = file.type === 'image/jpeg'; if (!isJPG) { message.error('You can only upload JPG file!'); } const isLt2M = file.size / 1024 / 1024 < 2; if (!isLt2M) { message.error('Image must smaller than 2MB!'); } return isJPG && isLt2M; }; class Avatar extends React.Component { constructor(props) { super(props); this.state = { imageUrl: '' } } handleChange(info) { if (info.file.status === 'done') { // Get this url from response in real world. getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl })); } } render() { const imageUrl = this.state.imageUrl; return ( { imageUrl ? : } ); } }; const PersonFrom = Form.create()(React.createClass({ getInitialState() { return { loading: false, }; }, handleSubmit(e) { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { console.log('Received values of form: ', values); } }); }, normFile(e) { if (Array.isArray(e)) { return e; } return e && e.fileList; }, componentDidMount() { addressInit('cmbProvince', 'cmbCity', 'cmbArea'); }, render() { const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 3 }, wrapperCol: { span: 12 }, }; const _me = this; return (
{getFieldDecorator('edulvl')( )} {getFieldDecorator('nickname', { initialValue: this.props.companyname })( )} {getFieldDecorator('province')(
)}
{getFieldDecorator('peoplenum')(
)}
{getFieldDecorator('intro')(

还可输入{ (() => { if (_me.props.form.getFieldValue('intro') && _me.props.form.getFieldValue('intro').length) { return 1000 - _me.props.form.getFieldValue('intro').length; } else { return 1000; } })() }字/1000

)}
{getFieldDecorator('companyfrom')( )} {getFieldDecorator('qiyezizhi')( )} {getFieldDecorator('turnover')(
万元
)}
{getFieldDecorator('avatar')( )}

上传的照片图片格式应为jpg格式,大小在2M以内

{getFieldDecorator('companyimg', { valuePropName: 'fileList', normalize: this.normFile, })(

上传的照片图片格式应为jpg格式,大小在2M以内

)}
); }, })); const Person = React.createClass({ getInitialState() { return { companyname: '湖南智明信息技术有限公司', loading: false }; }, render() { return (

个人资料

) } }); export default Person;