فهرست منبع

知识搜索状态显示优化1645

zhouna 6 سال پیش
والد
کامیت
c1cd0e056f
2فایلهای تغییر یافته به همراه12 افزوده شده و 2 حذف شده
  1. 6 1
      src/components/MedicalInfo/index.jsx
  2. 6 1
      src/components/ScaleSearch/index.jsx

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

@@ -66,6 +66,11 @@ class MedicalInfo extends Component {
         this.$cont.current.style.height = height+"px";
       });
     }
+  }
+  componentWillReceiveProps(){
+    this.setState({
+      hasSearch: false
+    });
   }
     render() {
         const {searchResult} = this.props;
@@ -85,7 +90,7 @@ class MedicalInfo extends Component {
                     <ul>
                       {this.getSearchList()}
                     </ul>
-              </div>:hasSearch&&<p className={style['no-data']}>暂无搜索结果!</p>}
+              </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
              </div>
 
 

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

@@ -82,6 +82,11 @@ class ScaleSearch extends Component {
       });
     }
   }
+  componentWillReceiveProps(){
+    this.setState({
+      hasSearch: false
+    });
+  }
   render() {
     const {searchResult} = this.props;
     const {val, hasSearch} = this.state;
@@ -100,7 +105,7 @@ class ScaleSearch extends Component {
             <ul>
               {this.getSearchList()}
             </ul>
-          </div>:hasSearch && <p className={style['no-data']}>暂无搜索结果!</p>}
+          </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
         </div>
     )