소스 검색

Merge branch 'chronicTreat' into dev/new1

zhangxc 5 년 전
부모
커밋
be80d10a45

+ 2 - 3
src/common/components/HasInfoItem/index.jsx

@@ -46,15 +46,14 @@ class HasInfoItem extends Component {
         const { item } = this.props
         const { hasEnterItem, hasEnterImg} = this.state
         return (<span className={style['drug-name-wrapper']} >
-            <span className={`${style['drug-name']} ${item.forbidden === '2' ? style['disabled']: item.selected ?  style['selected'] : ''}`}  
+            <span className={`${style['drug-name']}`}  
                 // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
                 onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect()}} 
                 onMouseEnter={this.handleMouseEnterDrug.bind(this)}
                 onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                 >
-                <span className={style['drug-name-span']}>
+                <span className={`${style['drug-name-span']}  ${item.forbidden === '2' ? style['disabled']: item.selected ?  style['selected'] : ''}`}>
                     {item.medicitionName}
-                    <span className={`${style['underline']} ${item.selected ?  style['underline-select'] : ''}`}></span>
                 </span>
                 {<img className={`${style['info-img']} ${hasEnterItem?style['show-content']:style['hide-content']}`}  
                 title='点击i图标可查看详细说明'

+ 1 - 0
src/common/components/HasInfoItem/index.less

@@ -19,6 +19,7 @@
 }
 .drug-name-span {
    position: relative;
+   text-decoration: underline;
    
 }
 }

+ 1 - 1
src/components/Treat/DrugTreat/index.jsx

@@ -83,7 +83,7 @@ class DrugTreat extends Component {
         const { currentImg, currentIndex, hasEnterImg } = this.state
         return(
             treatmentPlan && treatmentPlan.length > 0 && <div className={style['drug-box']}>
-                <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 常用药物治疗</h3>
+                <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 推荐药物</h3>
                 {/* 查看药物说明书 (添加数据查看数据用)*/}
                 {/* <div> <input onInput={this.handleInputDrug.bind(this)} style={{border:'1px solid #000'}} type="text"/><button onClick = {this.searchDrug.bind(this)}>搜索药品说明</button></div> */}
                 {treatmentPlan.map((item0, index0) =>{

+ 1 - 1
src/components/Treat/index.jsx

@@ -93,7 +93,7 @@ class Treat extends Component {
                         </div>} */}
                         { drugHistory && (drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 || drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0) &&<DrugHistory icon={drugIcon} 
                             titleStyle={{background:'#EAF7FA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}}
-                            title='上次用药情况' 
+                            title='上次用药' 
                             drugHistory={drugHistory}  
                             showDrugInfo = {showDrugInfo} 
                             setDrugInfo={ setDrugInfo }>

+ 7 - 37
src/components/TreatDesc/index.jsx

@@ -12,52 +12,23 @@ import HasInfoItem from '@common/components/HasInfoItem'
 class TreatDesc extends Component {
     constructor(props){
         super(props);
-        this.state = {
-            currentIndex: -1,
-            hasEnterImg: false
-        }
+      
         this.hideTreatDesc = this.hideTreatDesc.bind(this);
         this.handleSelect= this.handleSelect.bind(this);
-        this.handleMouseEnterDrug = this.handleMouseEnterDrug.bind(this)
-        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this)
-        this.handleMouseEnterImg = this.handleMouseEnterImg.bind(this)
-        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
+        this.setDrugInfo = this.setDrugInfo.bind(this)
         this.getPosition = this.getPosition.bind(this)
 
     }
-
-    handleMouseEnterDrug( index, item) {
-        // console.log('item', item)
-        // const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
-        
-        // const imgLeft = drugNameWidth/2-10
-        // console.log('imgLeft', imgLeft)
-        // $('#'+item.medicitionName).find('img').css('left', imgLeft)
-       
-        this.setState({
-            currentIndex: index,
-        })
-    }
-    handleMouseLeaveDrug() {
-        this.setState({
-            currentIndex: -1,
-        })
-    }
-    handleMouseEnterImg() {
-        this.setState({
-            hasEnterImg: true
-        })
-    }
-    handleMouseLeaveImg() {
-        this.setState({
-            hasEnterImg: false
-        })
-    }
+  
     handleSelect(position) {
 
         const { selectDrug } = this.props;
         selectDrug && selectDrug(position);
     }
+    setDrugInfo(item) {
+        const { setDrugInfo } = this.props;
+        setDrugInfo && setDrugInfo({name: item.medicitionName, type: 8, position: 5});
+    }
     hideTreatDesc() {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
@@ -73,7 +44,6 @@ class TreatDesc extends Component {
     render(){
         const  { treatment, treatDesc, setDrugInfo} = this.props
         const { title, basic, position, drugDesc} = treatDesc
-        const { currentIndex, hasEnterImg } = this.state
         let treatmentItem
         if(position) {
            treatmentItem = treatment[position[0]].meditionDetails[position[1]].treatment[position[2]]

+ 1 - 1
src/store/async-actions/treat.js

@@ -156,7 +156,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                     ( treatmentPlan &&treatmentPlan.length >0 ||
                         drugHistory&&drugHistory.length >0 || 
                         adverseEvent&&adverseEvent.length >0 ||
-                        !!followUp ||treatment&&treatment.length >0))) {
+                        !!followUp ||treatmentPlan&&treatmentPlan.length >0))) {
                             Notify.info('暂无数据'); 
                             return
                 }