Browse Source

化验辅捡ie8搜索卡死修改

zhouna 6 years ago
parent
commit
c7e9e73e9d

+ 6 - 3
src/common/components/SearchOption/index.jsx

@@ -20,8 +20,8 @@ class SearchOption extends React.Component {
         this.handleClearVal = this.handleClearVal.bind(this);
     }
     
-    componentWillReceiveProps(nextProps){
-        if(nextProps.visible !== this.props.visible) {
+    /*componentWillReceiveProps(nextProps){
+        if(nextProps.visible != this.props.visible) {
             if(!nextProps.visible) {
                 this.props.handleChangeValue('');
                 this.textInput.current.value = '';
@@ -31,8 +31,11 @@ class SearchOption extends React.Component {
                 this.textInput.current.focus();
             }, 0);
         }
+    }*/
+    componentDidMount(){
+      this.props.handleChangeValue('');
+      this.textInput.current.focus();
     }
-    
     handleClearVal(){
         const { handleChangeValue } = this.props;
         this.textInput.current.value = '';

+ 2 - 2
src/components/AddAssistCheck/index.jsx

@@ -153,9 +153,9 @@ class AddAssistCheck extends React.Component {
                 {this.getAssistLabel()}
                 <div id="searchWrapAssist" style={{position:"relative"}}>
                     <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck"/>
-                    <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
+                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}
-                    </SearchOption>
+                    </SearchOption>:''}
                 </div>
                 <ConfirmModal 
                     visible={visible}

+ 2 - 2
src/components/AddInspect/index.jsx

@@ -379,9 +379,9 @@ class Inspect extends React.Component {
                 </div>
                 <div style={{position:"relative"}}>
                     <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
-                    <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
+                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}
-                    </SearchOption>
+                    </SearchOption>:''}
                 </div>
                 <ConfirmModal 
                     visible={visible}

+ 0 - 1
src/store/async-actions/inspect.js

@@ -19,7 +19,6 @@ export const getSearchList = (val) => {
             sexType:sex == '男'?'1' : sex == '女'?'2':'3'
         })
         .then((res)=>{
-            console.log(res.data.data)
             const data = res.data.data;
             dispatch(searchList(data));
         })