Browse Source

Merge remote-tracking branch 'origin/pro_zn' into dev/new1

zhouna 5 years ago
parent
commit
99f300b1a0

+ 4 - 4
src/common/components/Textarea/index.jsx

@@ -26,8 +26,8 @@ class Textarea extends Component {
   }
   handleFocus(e){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput,isChronic,hasMain,boxMark} = this.props;
-    const {inpText} = this.state;
-    if(boxMark!='1'&&!hasMain&&!inpText){
+    //const {inpText} = this.state;console.log(inpText,boxMark,hasMain)
+    if(boxMark!='1'&&!hasMain&&!e.target.innerText){
       //现病史、其他史无主诉且本身无内容是聚焦提示无法操作
       this.setState({
         editable:false
@@ -41,11 +41,11 @@ class Textarea extends Component {
       });
     }
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&& !isChronic&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
+    /*if(fuzhen&& !isChronic&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
       const text = config.currentText.replace("(**)",fuzhen.replace(";",''));
       this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});
-    }
+    }*/
 
   }
   handleInput(e){

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

@@ -102,7 +102,7 @@ class PushItems extends Component {
       }
       store.dispatch(addAssistLabel(checkArr))
     }
-    if(checkedAssay.length > 0){
+    /*if(checkedAssay.length > 0){
       document.getElementById("inspectResultData").scrollIntoView(true)
     }else{
       if(checkedCheck.length > 0){
@@ -110,7 +110,7 @@ class PushItems extends Component {
       }else{
         return;
       }
-    }
+    }*/
   }
 
   changeAssay(item) {

+ 32 - 19
src/components/SpreadDrop/index.jsx

@@ -438,6 +438,7 @@ class ListItems extends Component{
 class ListItem extends Component{
   constructor(props){
     super(props);
+    this.getData = this.getData.bind(this);
   }
   handleClick(e,item,i){
     e.stopPropagation();
@@ -490,9 +491,8 @@ class ListItem extends Component{
       return '';
     }
   }
-  render(){
+  getData(){
     const {datas,isSpecialPos} = this.props;
-    const pos = isSpecialPos?style['independent']:'';
     const contStyle={
       opacity:'0.4',
       right:'0',
@@ -501,23 +501,36 @@ class ListItem extends Component{
       width:'6px',
       background:'#f1f1f1'};
     const barStyle={background:'#777',width:'100%'};
-    return <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
-    <ScrollArea speed={0.8}
-    horizontal={false}
-    stopScrollPropagation={datas.length>11?true:false}
-    style={{maxHeight:'330px'}}
-    className={style["area"]}
-    verticalContainerStyle={contStyle}
-    verticalScrollbarStyle={barStyle}
-    contentClassName="content">
-      {datas&&datas.map((it,i)=>{
-        if(isSpecialPos){
-          return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)}>{it.name}</li>
-        }
-        return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
-      })}
-      </ScrollArea>
-    </ul>;
+    if(datas.length>11){
+      return <ScrollArea speed={0.8}
+                    horizontal={false}
+                    stopScrollPropagation={true}
+                    style={{maxHeight:'330px'}}
+                    className={style["area"]}
+                    verticalContainerStyle={contStyle}
+                    verticalScrollbarStyle={barStyle}
+                    contentClassName="content">
+          {datas&&datas.map((it,i)=>{
+            if(isSpecialPos){
+              return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)}>{it.name}</li>
+            }
+            return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
+          })}
+        </ScrollArea>;
+    }
+    return datas&&datas.map((it,i)=>{
+      if(isSpecialPos){
+        return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)}>{it.name}</li>
+      }
+      return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
+    });
+  }
+  render(){
+    const {datas,isSpecialPos} = this.props;
+    const pos = isSpecialPos?style['independent']:'';
+    return  <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
+      {this.getData()}
+    </ul>
   }
 }
 export default SpreadDrop;