소스 검색

样式调整

1178232204@qq.com 3 년 전
부모
커밋
613aa4eb48

+ 3 - 3
src/components/AddNewInspect/SearchSelect/index.jsx

@@ -67,9 +67,8 @@ class SearchSelect extends Component {
   }
   //获取药品剂型15,、给药途径16
   getDrugWayList(val) {
-    console.log(123);
     const { hosId, type } = this.props;
-    if(!val && type == 15){
+    if(!val){
       this.setState({
         data: [],
         inpVal: ''
@@ -81,7 +80,7 @@ class SearchSelect extends Component {
       "inputStr": val.trim(),
       "type": type,
       "hospitalId": hosId,
-      "defaultList":type==15?0:1
+      "defaultList":0
     }).then((res) => {
       if (res.data.code == 0) {
         const data = res.data.data;
@@ -97,6 +96,7 @@ class SearchSelect extends Component {
   render() {
     const { idx, title, selected } = this.props;
     const { show, data, inpVal } = this.state; 
+    console.log(inpVal);
     return (
       <div className={styles.medType}>
         <input placeholder={title} value={selected} title={selected} className={styles.inpSearch} onFocus={(e) => this.handleFocu(e)} onInput={(e) => this.handleChange(e)} />

+ 5 - 2
src/components/AddNewInspect/SearchSelect/index.less

@@ -21,7 +21,7 @@
         position: absolute;
         cursor: pointer;
         top: 5px;
-        right: 4px;
+        right: -10px;
     }
     &:hover .clear{
         display: inline-block;
@@ -50,6 +50,9 @@
     }
 }
 .inpSearch{
-    width: 100%;
+    width: 105px;
     padding-left: 5px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
 }

+ 1 - 9
src/components/AddNewInspect/SearchSelect2/index.jsx

@@ -76,19 +76,11 @@ class SearchSelect extends Component {
   //获取药品剂型15,、给药途径16
   getDrugWayList(val) {
     const { hosId, type } = this.props;
-    if(!val && type == 15){
-      this.setState({
-        data: [],
-        inpVal: ''
-      });
-      this.handleSelect({ name: '', uniqueName: '' }, this.props.idx);
-      return
-    }
     axios.json('/demo/retrieval/index', {
       "inputStr": val,
       "type": type,
       "hospitalId": hosId,
-      "defaultList":type==15?0:1
+      "defaultList":1
     }).then((res) => {
       if (res.data.code == 0) {
         const data = res.data.data;

+ 4 - 1
src/components/AddNewInspect/SearchSelect2/index.less

@@ -59,6 +59,9 @@
   }
 }
 .inpSearch {
-  width: 100%;
+  width: 90px;
   padding-left: 5px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }