diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 38c8fd98c..82f7d60d8 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -200,16 +200,17 @@ class AccountBasic extends Component { // 过滤学校 filterList=(e)=>{ + const inputVal = e.trim() let arr=[]; - if(e){ + if(inputVal){ arr= this.state.schoolList.filter(function(item){ - return item.name.indexOf(e)>-1; + return item.name.indexOf(inputVal)>-1; }); this.props.form.setFieldsValue({ - org:e + org: inputVal }) this.setState({ - school:e, + school: inputVal, filterSchoolList:arr }) } else { @@ -266,7 +267,7 @@ class AccountBasic extends Component { // 选择学校(获取对应学校的学院、部门) changeList=(e)=>{ - this.getDepartments(e,true); + this.getDepartments(e.trim(),true); } getDepartments=(e,flag)=>{