import React from 'react';
import { Input, Button, Form, Select, Upload, Icon, Spin, message } from 'antd';
import './edu.less';
import EduPfsSelect from './eduPfsSelect.jsx';
import YearSelect from '../../yearSelect.jsx';
const FormItem = Form.Item;
const Option = Select.Option;
const edulvlArr = ["高中", "大专", "本科", "硕士研究生", "博士研究生"];
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 (
:
最高学历