|
@@ -2,6 +2,8 @@ import React, { Component } from 'react';
|
|
|
import style from './index.less';
|
|
|
import {ConfirmModal} from '@commonComp';
|
|
|
import Notify from '@commonComp/Notify';
|
|
|
+import infoShow from '@common/images/info-show.png';
|
|
|
+import infoMove from '@common/images/info-move.png';
|
|
|
import {getChronic} from '@store/async-actions/homePage.js';
|
|
|
import {storageLocal} from '@utils/tools';
|
|
|
|
|
@@ -10,7 +12,9 @@ class DiagnosticItem extends Component{
|
|
|
super(props);
|
|
|
|
|
|
this.state = {
|
|
|
- visible: false
|
|
|
+ visible: false,
|
|
|
+ hasEnterItem: false,
|
|
|
+ hasEnterImg: false
|
|
|
}
|
|
|
|
|
|
this.addDiagodal = this.addDiagodal.bind(this);
|
|
@@ -18,6 +22,7 @@ class DiagnosticItem extends Component{
|
|
|
this.confirm = this.confirm.bind(this);
|
|
|
this.cancel = this.cancel.bind(this)
|
|
|
this.close = this.close.bind(this)
|
|
|
+ this.getTips = this.getTips.bind(this)
|
|
|
}
|
|
|
confirm() {
|
|
|
this.close();
|
|
@@ -35,9 +40,11 @@ class DiagnosticItem extends Component{
|
|
|
})
|
|
|
}
|
|
|
chooseDiagodal(item) {
|
|
|
- const { diagnosticList,getTips } = this.props;
|
|
|
+ const { diagnosticList,getTips, type } = this.props;
|
|
|
// getTips && getTips(item);
|
|
|
- getTips && getTips({id:item.id,type:7});
|
|
|
+ if (type == 'search') {
|
|
|
+ getTips && getTips({id:item.id,type:7});
|
|
|
+ }
|
|
|
for (let i = 0; i < diagnosticList.length; i++) {
|
|
|
if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
|
|
|
Notify.info('该诊断已存在');
|
|
@@ -49,6 +56,11 @@ class DiagnosticItem extends Component{
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+ getTips(item, e) {
|
|
|
+ e.stopPropagation();
|
|
|
+ const {getTips } = this.props;
|
|
|
+ getTips && getTips({id:item.id,type:7});
|
|
|
+ }
|
|
|
addDiagodal(diagType){
|
|
|
const {item, isChronicMag,mode} = this.props;
|
|
|
item.type = diagType;
|
|
@@ -87,15 +99,45 @@ class DiagnosticItem extends Component{
|
|
|
// }, 0)
|
|
|
document.getElementById("diagnosisResult").scrollIntoView(true)
|
|
|
}
|
|
|
+ handleMouseEnterDrug() {
|
|
|
+ this.setState({
|
|
|
+ hasEnterItem: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleMouseLeaveDrug() {
|
|
|
+ this.setState({
|
|
|
+ hasEnterItem: false,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleMouseEnterImg() {
|
|
|
+ this.setState({
|
|
|
+ hasEnterImg: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleMouseLeaveImg() {
|
|
|
+ this.setState({
|
|
|
+ hasEnterImg: false
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
render(){
|
|
|
- const { visible } = this.state
|
|
|
- const { item, title } = this.props
|
|
|
+ const { visible,hasEnterItem,hasEnterImg } = this.state
|
|
|
+ const { item, title, type } = this.props
|
|
|
return (<span className={style['diag-item']} >
|
|
|
<span className={style['diag-name']}
|
|
|
title = {title && item.name + (item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': '')}
|
|
|
- onClick={() =>{this.chooseDiagodal(item)}}>
|
|
|
+ onMouseEnter={this.handleMouseEnterDrug.bind(this)}
|
|
|
+ onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
|
|
|
+ onClick={() =>{this.chooseDiagodal(item)}}
|
|
|
+ >
|
|
|
{item.name} {item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': ''}
|
|
|
+ {type== 'disSelect' &&<img className={style['info-img']}
|
|
|
+ style ={hasEnterItem ? {display: "inline-block"} : {display: "none"}}
|
|
|
+ src={hasEnterImg ? infoMove : infoShow}
|
|
|
+ onMouseEnter={this.handleMouseEnterImg.bind(this)}
|
|
|
+ onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
|
|
|
+ onClick={this.getTips.bind(this,item)}
|
|
|
+ />}
|
|
|
</span>
|
|
|
<ConfirmModal visible={visible} okText='初诊' cancelText='复诊' confirm={this.confirm} cancel={this.cancel} close={this.close}>
|
|
|
<div className={style['confirm-info']}>确定选择“{item.name}”为</div>
|