소스 검색

回退删除显示修改1694

zhouna 6 년 전
부모
커밋
fa4f7fdfc5
2개의 변경된 파일22개의 추가작업 그리고 2개의 파일을 삭제
  1. 11 1
      src/components/MedicalInfo/index.jsx
  2. 11 1
      src/components/ScaleSearch/index.jsx

+ 11 - 1
src/components/MedicalInfo/index.jsx

@@ -41,9 +41,19 @@ class MedicalInfo extends Component {
       handleChangeValue&&handleChangeValue(val);
     }
   handleChange(){
+    const value = this.$inp.current.value;
+    const {clearResult} = this.props;
       this.setState({
-        val:this.$inp.current.value
+        val: value
       });
+    if (value === '') {
+      this.setState({
+        val: '',
+        hasSearch: false,
+        msg: ''
+      });
+      clearResult && clearResult();
+    }
   }
   handleEnter(e){
       if(e.keyCode==13){

+ 11 - 1
src/components/ScaleSearch/index.jsx

@@ -56,9 +56,19 @@ class ScaleSearch extends Component {
     handleChangeValue&&handleChangeValue(val);
   }
   handleChange(){
+    const value = this.$inp.current.value;
+    const {clearResult} = this.props;
     this.setState({
-      val:this.$inp.current.value
+      val: value
     });
+    if (value === '') {
+      this.setState({
+        val: '',
+        hasSearch: false,
+        msg: ''
+      });
+      clearResult && clearResult();
+    }
   }
   handleEnter(e){
     if(e.keyCode==13){