dev_forum
hjm 5 years ago
parent fea8646212
commit 93f61c92cd

@ -200,16 +200,17 @@ class AccountBasic extends Component {
// 过滤学校 // 过滤学校
filterList=(e)=>{ filterList=(e)=>{
const inputVal = e.trim()
let arr=[]; let arr=[];
if(e){ if(inputVal){
arr= this.state.schoolList.filter(function(item){ arr= this.state.schoolList.filter(function(item){
return item.name.indexOf(e)>-1; return item.name.indexOf(inputVal)>-1;
}); });
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
org:e org: inputVal
}) })
this.setState({ this.setState({
school:e, school: inputVal,
filterSchoolList:arr filterSchoolList:arr
}) })
} else { } else {
@ -266,7 +267,7 @@ class AccountBasic extends Component {
// 选择学校(获取对应学校的学院、部门) // 选择学校(获取对应学校的学院、部门)
changeList=(e)=>{ changeList=(e)=>{
this.getDepartments(e,true); this.getDepartments(e.trim(),true);
} }
getDepartments=(e,flag)=>{ getDepartments=(e,flag)=>{

Loading…
Cancel
Save