瀏覽代碼

Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

zhouna 6 年之前
父節點
當前提交
3e2cb6d443

二進制
src/common/images/info-move.png


二進制
src/common/images/info-show.png


+ 42 - 3
src/components/ChronicInfo/index.jsx

@@ -9,6 +9,8 @@ import allTableIcon from '@common/images/all-table.png';
 import add from '@common/images/add-result.png';
 import added from '@common/images/first.png';
 import checkIcon from '@common/images/check.png';
+import infoShow from '@common/images/info-show.png';
+import infoMove from '@common/images/info-move.png';
 import {ComplexModal,ConfirmModal,MiniToast, Radio,CheckBtn} from '@commonComp';
 import ScaleTable from '@containers/ScaleTable';
 import Notify from '@commonComp/Notify';
@@ -40,6 +42,8 @@ class ChronicInfo extends React.Component{
       formulaParam: {}, //量表计算公式计算入参
       isCalculated:false,     //是否刚计算过,关闭时值与结果对应
       calcuValues:deepClone(props.calcuValues),       //计算公式填的值
+      hasEnterImg: false, //是否移入info
+      currentIndex: -1 //当前index
     };
 
     this.showInfo = this.showInfo.bind(this);
@@ -305,14 +309,49 @@ class ChronicInfo extends React.Component{
 
     return btn;
   }
+  handleMouseEnterDrug(index) {
+    this.setState({
+        currentIndex: index,
+    })
+  }
+  handleMouseLeaveDrug() {
+    this.setState({
+        currentIndex: -1, 
+    })
+  }
+  handleMouseEnterImg() {
+    this.setState({
+      hasEnterImg: true
+    })
+  }
+  handleMouseLeaveImg() {
+    this.setState({
+      hasEnterImg: false
+    })
+  }
   getDetail(){
     const {data,formulaResult,calcuResult} = this.props;
-    const {formulaId,optionId,possible,radioVal,calcuValues} = this.state;
+    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>{'患者可能有'+v.name}</span>
-                                <img src={infoPic} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/>
+                                <span>患者可能有</span>
+                                <span
+                                  className={style['dis-name']}
+                                  onMouseEnter={this.handleMouseEnterDrug.bind(this, i)}
+                                  onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
+                                >
+                                  {v.name}
+                                  {<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)}
+                                    onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
+                                    onClick={this.showInfo.bind(this,v.id)}/>}
+                                
+                                </span>
+                                {/* <img src={infoShow} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/> */}
+                                
                               </p>:''}
                       {v.details&&v.details.map((it,j)=>{

+ 13 - 1
src/components/ChronicInfo/index.less

@@ -263,4 +263,16 @@
   }
   .recomand{
     color:#3B9ED0;
-  }
+  }
+  .dis-name {
+    position: relative;
+    cursor: pointer;
+  }
+  .info-img {
+    position: absolute;
+    width: 15px;
+    top: -14px;
+    left: 50%;
+    margin-left: -7px;
+    cursor: pointer;
+}

+ 1 - 0
src/components/Treat/AdverseReactions/index.less

@@ -38,6 +38,7 @@
     top: -15px;
     left: 50%;
     margin-left: -8px;
+    cursor: pointer;
 }
 .last-treat-big-name-box {
     display: inline-block;

+ 2 - 1
src/components/Treat/DrugHistory/LastDrug/index.less

@@ -11,7 +11,7 @@
 }
 .last-common-warpper {
     position: relative;
-    margin: 0 20px 0 0;
+    margin: 0 4px 0 0;
     display: inline-block;
 }
 .info-img {
@@ -20,4 +20,5 @@
     top: -8px;
     left: 50%;
     margin-left: -7px;
+    cursor: pointer;
 }

+ 1 - 0
src/components/Treat/DrugTreat/index.less

@@ -37,6 +37,7 @@
     top: -15px;
     left: 50%;
     margin-left: -7px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

+ 1 - 0
src/components/TreatDesc/index.less

@@ -65,6 +65,7 @@
     top: -15px;
     left: 50%;
     margin-left: -7px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;