|
@@ -4,28 +4,9 @@ import './person.less';
|
|
import ajax from 'jquery/src/ajax/xhr.js'
|
|
import ajax from 'jquery/src/ajax/xhr.js'
|
|
import $ from 'jquery/src/ajax';
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
|
-import { addressInit, splitUrl, } from '../../tools.js';
|
|
|
|
|
|
+import { addressInit, splitUrl, getBase64, beforeUpload } from '../../tools.js';
|
|
import { eduLevelList, zizhiArr, schoolArr } from '../../dataDic.js';
|
|
import { eduLevelList, zizhiArr, schoolArr } from '../../dataDic.js';
|
|
|
|
|
|
-
|
|
|
|
-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 {
|
|
class Avatar extends React.Component {
|
|
constructor(props) {
|
|
constructor(props) {
|
|
super(props);
|
|
super(props);
|
|
@@ -135,12 +116,13 @@ const PersonFrom = Form.create()(React.createClass({
|
|
dataType: "json",
|
|
dataType: "json",
|
|
url: globalConfig.context + "/api/user/member",
|
|
url: globalConfig.context + "/api/user/member",
|
|
success: function (data) {
|
|
success: function (data) {
|
|
-
|
|
|
|
if (data.data && data.data.info && data.data.pro) {
|
|
if (data.data && data.data.info && data.data.pro) {
|
|
addressInit('cmbProvince', 'cmbCity', 'cmbArea',
|
|
addressInit('cmbProvince', 'cmbCity', 'cmbArea',
|
|
data.data.info.locationProvince, data.data.info.locationCity, data.data.info.locationArea);
|
|
data.data.info.locationProvince, data.data.info.locationCity, data.data.info.locationArea);
|
|
let theArr = splitUrl(data.data.info.publicityPictureUrl, ',', globalConfig.avatarHost + '/upload');
|
|
let theArr = splitUrl(data.data.info.publicityPictureUrl, ',', globalConfig.avatarHost + '/upload');
|
|
this.setState({
|
|
this.setState({
|
|
|
|
+ iid: data.data.info.id,
|
|
|
|
+ pid: data.data.pro.id,
|
|
idttType: data.data.info.identityType,
|
|
idttType: data.data.info.identityType,
|
|
unitName: data.data.info.companyName,
|
|
unitName: data.data.info.companyName,
|
|
unitNumber: data.data.info.unitSize,
|
|
unitNumber: data.data.info.unitSize,
|
|
@@ -173,9 +155,7 @@ const PersonFrom = Form.create()(React.createClass({
|
|
getInitialState() {
|
|
getInitialState() {
|
|
return {
|
|
return {
|
|
loading: false,
|
|
loading: false,
|
|
-
|
|
|
|
idttType: '企业',
|
|
idttType: '企业',
|
|
-
|
|
|
|
companyDis: 'block',
|
|
companyDis: 'block',
|
|
schoolDis: 'none',
|
|
schoolDis: 'none',
|
|
resDis: 'none',
|
|
resDis: 'none',
|
|
@@ -215,29 +195,31 @@ const PersonFrom = Form.create()(React.createClass({
|
|
crossDomain: false,
|
|
crossDomain: false,
|
|
url: globalConfig.context + "/api/user/orgPro",
|
|
url: globalConfig.context + "/api/user/orgPro",
|
|
data: {
|
|
data: {
|
|
- "info.identityType": values.identityType,
|
|
|
|
- "info.companyName": values.unitName,
|
|
|
|
- "info.locationProvince": cmbP,
|
|
|
|
- "info.locationCity": cmbC,
|
|
|
|
- "info.locationArea": cmbA,
|
|
|
|
- "info.unitSize": values.unitNumber,
|
|
|
|
- "info.companyIntroduction": values.unitIntro,
|
|
|
|
- "info.homeUnit": values.unitFrom,
|
|
|
|
- "info.logoUrl": this.state.companyLogoUrl,
|
|
|
|
- "info.publicityPictureUrl": lifePhotoUrl,
|
|
|
|
- "pro.qualification": values.qiyezizhi,
|
|
|
|
- "pro.turnover": values.turnover,
|
|
|
|
- "pro.collegeAttribute": values.schoolProp,
|
|
|
|
- "pro.collegeEstablishTime": values.schoolTime,
|
|
|
|
- "pro.academician": values.aca,
|
|
|
|
- "pro.doctoralTutor": values.PhDTutor,
|
|
|
|
- "pro.masterTutor": values.MSTutor,
|
|
|
|
- "pro.otherExpert": values.otherExperts,
|
|
|
|
- "pro.nationalLab": values.StateKeyLab,
|
|
|
|
- "pro.educationLab": values.EduKeyLab,
|
|
|
|
- "pro.enterpriseCenter": values.ComCenter,
|
|
|
|
- "pro.otherCenter": values.otherCenter,
|
|
|
|
- "pro.institutionEstablishTime": values.resTime
|
|
|
|
|
|
+ "iid":this.state.iid,
|
|
|
|
+ "pid":this.state.pid,
|
|
|
|
+ "identityType": values.identityType,
|
|
|
|
+ "companyName": values.unitName,
|
|
|
|
+ "locationProvince": cmbP,
|
|
|
|
+ "locationCity": cmbC,
|
|
|
|
+ "locationArea": cmbA,
|
|
|
|
+ "unitSize": values.unitNumber,
|
|
|
|
+ "companyIntroduction": values.unitIntro,
|
|
|
|
+ "homeUnit": values.unitFrom,
|
|
|
|
+ "logoUrl": this.state.companyLogoUrl,
|
|
|
|
+ "publicityPictureUrl": lifePhotoUrl,
|
|
|
|
+ "qualification": values.qiyezizhi,
|
|
|
|
+ "turnover": values.turnover,
|
|
|
|
+ "collegeAttribute": values.schoolProp,
|
|
|
|
+ "collegeEstablishTime": values.schoolTime,
|
|
|
|
+ "academician": values.aca,
|
|
|
|
+ "doctoralTutor": values.PhDTutor,
|
|
|
|
+ "masterTutor": values.MSTutor,
|
|
|
|
+ "otherExpert": values.otherExperts,
|
|
|
|
+ "nationalLab": values.StateKeyLab,
|
|
|
|
+ "educationLab": values.EduKeyLab,
|
|
|
|
+ "enterpriseCenter": values.ComCenter,
|
|
|
|
+ "otherCenter": values.otherCenter,
|
|
|
|
+ "institutionEstablishTime": values.resTime
|
|
}
|
|
}
|
|
}).done(function (data) {
|
|
}).done(function (data) {
|
|
if (!data.error.length) {
|
|
if (!data.error.length) {
|