瀏覽代碼

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

zhouna 6 年之前
父節點
當前提交
e1af9c88f7

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

@@ -21,6 +21,7 @@
       }
       a{
         text-decoration: none;
+        font-size: 12px;
       }
       b{
         font-size: 12px;

+ 52 - 3
src/components/PushItems/DetailsModal/index.jsx

@@ -2,33 +2,82 @@ import React, { Component } from "react";
 import styles from "./index.less";
 import NewPortal from './NewPortal'
 import close from "./../img/close.png";
+import $ from "jquery";
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
+        this.state = {
+            currentIndex: 0
+        }
         this.hideTips = this.hideTips.bind(this)
     }
     hideTips() {
         const { hideTips } = this.props;
         hideTips && hideTips();
     }
+    handleClickMenu(index, item, tipsDetails) {
+        const that = this
+        setTimeout(function(){
+            that.setState({
+                currentIndex: index
+            })
+        },0)
+        
+        let scrollTop = 0
+        tipsDetails.introduceDetailList.map((it, ii) => {
+            if( ii < index) {
+                scrollTop = scrollTop + parseInt($('#' + it.title).css('height'))
+            }
+        })
+        $('#detailsContent').scrollTop(scrollTop)
+    }
+    handleScrollModal(tipsDetails) {
+        const scrollTop = $('#detailsContent').scrollTop()
+        let divHeight = 0;
+        for (let i = 0; i < tipsDetails.introduceDetailList.length; i++) {
+            divHeight = divHeight + parseInt($('#' + tipsDetails.introduceDetailList[i].title).css('height'))
+            if(divHeight > scrollTop) {
+                this.setState({
+                    currentIndex: i
+                })
+                return
+            }
+        }
+    }
+    
+    
 
     render() {
         const {showTipsDetails, tipsDetails} = this.props;
+        const { currentIndex } = this.state
         const imageUrlPrefix = 'http://192.168.2.241:82'; //图片服务器地址
         return (<NewPortal visible={showTipsDetails}>
         <div className={styles['details-wrapper']}>
            <div className={styles['details-content-wrapper']}>
                 <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.name} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
-                <div className={styles['details-content']}>
+                <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
                     {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
-                        return (<div>
-                            <div className={styles['details-content-title-box']}>
+                        return (<div id={item.title}>
+                            <div className={styles['details-content-title-box']} >
                                 <span className={styles['details-content-title-name']}>{item.title}</span>
                                 <div className={styles['details-content-title-line']}></div>
                             </div>
                             <div dangerouslySetInnerHTML ={{__html: item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}}></div>
                         </div>)
                     })}
+                    
+                </div>
+                <div className={styles['content-menu']}>
+                    {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
+                            return (<div>
+                                <div className={styles['details-menu-title-box']}>
+                                    {index === 0 ? '' : <div className={styles['details-content-menu-line']}></div>}
+                                    <span onClick={this.handleClickMenu.bind(this, index, item, tipsDetails)} className={styles['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
+                                        <span className={styles['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
+                                    </span>
+                                </div>
+                            </div>)
+                        })}
                 </div>
            </div>
            <div className={styles['details-mask']}>

+ 33 - 1
src/components/PushItems/DetailsModal/index.less

@@ -15,6 +15,7 @@
     left: 10%;
     top: 10%;
     background: #fff;
+    overflow: hidden;
     z-index: 10;
 }
 
@@ -55,10 +56,41 @@
     right: 0;
 }
 .details-content {
+    position: relative;
     height: 100%;
-    padding: 0 40px;
+    padding: 0 180px 0 40px;
     overflow-y: auto;
 }
+.content-menu {
+    position: absolute;
+    top: 50px;
+    right: 20px;
+    background: #eee;
+    border: 1px solid #eee;
+    width: 160px;
+    padding: 15px 18px;
+}
+.details-content-menu-line {
+    height: 15px;
+    width: 0;
+    border: 1px solid #ccc;
+    background-color: #ccc;
+    margin-left: 4px
+}
+.details-content-menu-name {
+    color: #33475f;
+    font-size: 13px;
+}
+.details-content-menu-circle {
+    display: inline-block;
+    width: 8px;
+    height: 8px;
+    border-radius: 5px;
+    border: 1px solid #ccc;
+    margin-top: 5px;
+    background-color: #eee;
+    margin-right: 10px;
+}
 .details-mask {
     position: fixed;
     width: 100%;

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

@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import info from './../img/info.png';
+import info1 from './../img/info1.png';
 import drugIcon from './../img/drug.png';
 import more from '@common/images/addItem1.png';
 import $ from "jquery";
@@ -8,16 +9,31 @@ import $ from "jquery";
 class DrugTreat extends Component {
     constructor(props) {
         super(props);
+        this.state = {
+            currentImg: -1
+        }
         this.handleSelect = this.handleSelect.bind(this);
         this.setOtherRecommend = this.setOtherRecommend.bind(this);
         this.setDrugInfo = this.setDrugInfo.bind(this);
         this.showTreatDesc = this.showTreatDesc.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
     }
 
     handleSelect(index,ii) {
         const { selectDrug } = this.props;
         selectDrug && selectDrug(index,ii);
     }
+    handleMouseEnterImg(ii, index) {
+        this.setState({
+            currentIndex: index,
+            currentImg: ii
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            currentIndex: -1,
+        })
+    }
     setOtherRecommend(item, index) {
         this.showTreatDesc();
         const { setOtherRecommend } = this.props;
@@ -38,6 +54,7 @@ class DrugTreat extends Component {
 
     render(){
         const { treatment,showDrugInfo } = this.props
+        const { currentImg, currentIndex } = this.state
         return(
             treatment && treatment.length > 0 && <div className={style['drug-box']}>
                 <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 常用药物治疗</h3>
@@ -53,7 +70,11 @@ class DrugTreat extends Component {
                                             onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}>
                                             {it.medicitionName}
                                         </span>
-                                        {<img className={style['info-img']} src={info} onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
+                                        {<img className={style['info-img']}    
+                                              src={currentIndex === index ? (ii === currentImg ? info1 : info) : info} 
+                                              onMouseEnter={this.handleMouseEnterImg.bind(this, ii, index)}
+                                              onMouseLeave = {this.handleMouseLeaveImg}
+                                              onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
                                         {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{it.rate}
                                         
                                     </span>)

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

@@ -23,6 +23,7 @@
 .info-img {
     width: 12px;
     margin: 0 3px -1px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

二進制
src/components/Treat/img/info1.png


二進制
src/components/TreatDesc/img/info1.png


+ 21 - 1
src/components/TreatDesc/index.jsx

@@ -3,15 +3,30 @@ import style from './index.less';
 import $ from "jquery";
 import close from './img/close.png';
 import info from './img/info.png';
+import info1 from './img/info1.png';
 
 
 class TreatDesc extends Component {
     constructor(props){
         super(props);
+        this.state = {
+            currentIndex: -1
+        }
         this.hideTreatDesc = this.hideTreatDesc.bind(this);
         this.handleSelect= this.handleSelect.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
     }
 
+    handleMouseEnterImg(index) {
+        this.setState({
+            currentIndex: index,
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            currentIndex: -1,
+        })
+    }
     handleSelect(index,ii) {
         const { selectDrug } = this.props;
         selectDrug && selectDrug(index,ii);
@@ -25,6 +40,7 @@ class TreatDesc extends Component {
     render(){
         const  { treatment, treatDesc, setDrugInfo, showDrugInfo} = this.props
         const { title, basic, otherDrugIndex, drugDesc} = treatDesc
+        const { currentIndex } = this.state
         return (treatment && treatment.length >0 && <div  className={style['treat-desc-box']}>
             
             {title && title === '药品推荐' ? <div className={style['similar-drug-box']} id='treatDescBox'>
@@ -50,7 +66,11 @@ class TreatDesc extends Component {
                             </span>
                         </span>              
                         
-                        {<img  onClick={() =>{setDrugInfo(item);showDrugInfo();}}  className={style['info-img']} src={info} />}
+                        {<img className={style['info-img']}    
+                            src={currentIndex === index ? info1 : info} 
+                            onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
+                            onMouseLeave = {this.handleMouseLeaveImg}
+                            onClick={() =>{setDrugInfo(item);showDrugInfo();}}/>}
                         {item.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: item.forbidden === '2' ? <span className={style['info-flag']} style={{border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{item.rate}
                         
                     </span>)

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

@@ -59,6 +59,7 @@
 .info-img {
     width: 12px;
     margin: 0 3px -1px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

+ 10 - 2
src/store/async-actions/diagnosticSearch.js

@@ -8,9 +8,9 @@ export const getSearchResult = (value) =>{
         const url = '/api/icss/retrieval/getTagInfos'
         const param={
             type: 7,
-            age: 44,
+            age: state.patInfo.message.patientAge,
             inputStr: value,
-            sexType: 1
+            sexType: state.patInfo.message.sex
         }
         if(value === state.diagnosticSearch.searchValue) {
             return
@@ -19,6 +19,14 @@ export const getSearchResult = (value) =>{
                 type: SET_SEARCH_VALUE,
                 searchValue: value
             })
+            //如果搜索值为空,则直接将搜索结果设为空
+            if(value === '') {
+                dispatch({
+                    type: GET_SEARCH_RESULT,
+                    searchResult: []
+                })
+                return
+            }
             json(url, param).then((data)=>{
                 const searchRes = data.data.data;
                 const diagList = state.diagnosticList.diagnosticList;