dev_forum
hjm 5 years ago
parent 6d0860d44f
commit d7a4b99380

@ -201,7 +201,7 @@ class AccountBasic extends Component {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
org2:e org2:e
}) })
let arr = this.state.departments ? this.state.departments.filter(function(item){ let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){
return item.name.indexOf(e) > -1 return item.name.indexOf(e) > -1
}) : [] }) : []
this.setState({ this.setState({
@ -213,9 +213,9 @@ class AccountBasic extends Component {
// 选择部门、学院 // 选择部门、学院
changeDepartment=(e)=>{ changeDepartment=(e)=>{
let arr=this.state.departments.filter(function(item){ let arr= this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){
return item.name == e; return item.name == e;
}); }) : [];
this.setState({ this.setState({
departmentsName:e, departmentsName:e,
department_id:arr[0].id department_id:arr[0].id

Loading…
Cancel
Save