浏览代码

搜索优化

1178232204@qq.com 3 年之前
父节点
当前提交
e7f33e1bbe

+ 5 - 1
src/components/AddNewInspect/SearchSelect/index.jsx

@@ -46,6 +46,8 @@ class SearchSelect extends Component {
   }
   handleChange(e,isClear){
       const val =e.target.value;
+    console.log(e.target.value);
+      
       if(isClear||!val){
           this.setState({
               data:[],
@@ -59,6 +61,8 @@ class SearchSelect extends Component {
           inpVal:val,
       });
       //搜索
+    console.log(val);
+      
       this.getDrugWayList(val)
   }
     //获取药品剂型15,、给药途径16
@@ -90,7 +94,7 @@ class SearchSelect extends Component {
     const {show,data,inpVal} = this.state;
     return (
         <div className={styles.medType}>
-            <input placeholder={title} value={selected} className={styles.inpSearch} onChange={(e)=>this.handleChange(e)} />
+            <input placeholder={title} value={selected} className={styles.inpSearch} onInput={(e)=>this.handleChange(e)} />
                 <img className={styles.down} src={dowm} alt=""/>
                 {inpVal?<img className={styles.clear} src={del} alt="清空" onClick={(e)=>this.handleChange(e,true)}/>:''}
             {

+ 1 - 1
src/components/AddNewInspect/SearchSelect/index.less

@@ -31,7 +31,7 @@
         top:24px;
         background: #fff;
         width: 100%;
-        max-height: 200px;
+        max-height: 110px;
         box-shadow: 0 10px 20px 0 #989da3;
         z-index: 9;
         overflow: auto;

+ 1 - 1
src/utils/tools.js

@@ -1043,7 +1043,7 @@ function getEMRParams() {
     }
     return item
   })
-  let tempOperationName = newAdvice.operationName
+  let tempOperationName = newAdvice.operationName ? newAdvice.operationName:[]
   if (curHos.hosId != -1 && tempOperationName.name) {
     tempOperationName.uniqueName = ''
   }