From 93f61c92cd7121bc71c4d2046ddf9d14ad59f9cd Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 09:39:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/account/AccountBasicEdit.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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)=>{