Browse Source

病情提示添加危急值

zhangxc 5 years ago
parent
commit
faa18ca7f2
1 changed files with 15 additions and 5 deletions
  1. 15 5
      src/components/ChronicInfo/index.jsx

+ 15 - 5
src/components/ChronicInfo/index.jsx

@@ -352,21 +352,31 @@ class ChronicInfo extends React.Component{
       hasEnterImg: false
     })
   }
-  
+  getCritical(v) {
+    let hasCritical = false;
+    if(v.details) {
+      for (let i = 0; i < v.details.length; i++) {
+        if(v.details[i].type == 4) {
+          hasCritical = true
+        }
+      }
+    }
+    return hasCritical
+  }
   getDetail(){
     const {data,formulaResult,calcuResult,chronicMagItem} = this.props;
     const {formulaId,optionId,possible,radioVal,calcuValues,currentIndex,hasEnterImg} = this.state;
     let list = data&&data.map((v,i)=>{
                     return <div className={style["list"]}>
                       {v.name?<p>
-                                <span>患者可能有</span>
+                                {this.getCritical(v) ? '':<span>患者可能有</span>}
                                 <span
-                                  className={style['dis-name']}
+                                  className={this.getCritical(v)?style['dis-name-no-line']: style['dis-name']}
                                   onMouseEnter={this.handleMouseEnterDrug.bind(this, i)}
                                   onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                                 >
                                   {v.name}
-                                  {<img className={style['info-img']}
+                                  {this.getCritical(v)?'':<img className={style['info-img']}
                                     style ={currentIndex === i  ? {display: "inline-block"} : {display: "none"}}
                                     src={currentIndex === i ?(hasEnterImg ? infoMove : infoShow ): infoShow}
                                     onMouseEnter={this.handleMouseEnterImg.bind(this)}
@@ -376,7 +386,7 @@ class ChronicInfo extends React.Component{
                                 </span>
                                 {/* <img src={infoShow} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/> */}
 
-                                :
+                                {this.getCritical(v)?'':''}
                               </p>:''}
                       {v.details&&v.details.map((it,j)=>{
                         if(it.type==1){