dev_forum
hjm 6 years ago
parent b1b38e776c
commit a0e6368be7

@ -44,25 +44,31 @@ class AccountBasic extends Component {
setValue=(basicInfo)=>{ setValue=(basicInfo)=>{
if(basicInfo){ if(basicInfo){
//if(basicInfo.nickname){
this.setState({
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
identity:basicInfo.identity
})
//}
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
nickname:basicInfo.nickname, nickname:basicInfo.nickname,
name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name, name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name,
student_No:basicInfo.student_id,
sex:String(basicInfo.gender), sex:String(basicInfo.gender),
job:map[basicInfo.identity], job:map[basicInfo.identity],
org:basicInfo.school_name, org:basicInfo.school_name,
org2:basicInfo.department_name, org2:basicInfo.department_name,
city:[basicInfo.location,basicInfo.location_city]
})
setTimeout(() => {
// 等显示后再set
this.props.form.setFieldsValue({
student_No:basicInfo.student_id,
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
city:[basicInfo.location,basicInfo.location_city]
}) })
}, 100)
//if(basicInfo.nickname){
this.setState({
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
identity:basicInfo.identity
})
//}
} }
} }
@ -115,9 +121,9 @@ class AccountBasic extends Component {
gender:parseInt(values.sex), gender:parseInt(values.sex),
location:values.city[0], location:values.city[0],
location_city:values.city[1], location_city:values.city[1],
identity:values.job=="教师"?"teacher":values.job=="学生"?"student":"professional", identity: this.state.identity || (values.job=="teacher"?"teacher":values.job=="student"?"student":"professional"),
technical_title:values.job1 || values.job2, technical_title:values.job1 || values.job2,
student_id:values.job=="学生" ? values.student_No : null, student_id:values.job=="student" ? values.student_No : null,
school_id:this.state.school_id, school_id:this.state.school_id,
department_id:this.state.department_id department_id:this.state.department_id
}).then((result)=>{ }).then((result)=>{

@ -121,7 +121,7 @@ class ChangeHeaderPicModal extends Component{
render(){ render(){
const { course_lists } = this.state const { course_lists } = this.state
const { moduleName, current_user } = this.props const { moduleName, current_user } = this.props
const userHeaderImgUrl = `${getUrl()}/images/${current_user.image_url}` const userHeaderImgUrl = current_user ? `${getUrl()}/images/${current_user.image_url}` : ''
return( return(
<ModalWrapper <ModalWrapper
ref="modalWrapper" ref="modalWrapper"

Loading…
Cancel
Save