import React, { Component } from 'react'; import style from './index.less'; import info from './../img/info.png'; import info1 from './../img/info1.png'; import info2 from './../img/info2.png'; import info3 from './../img/info3.png'; import drugIcon from './../img/drug.png'; import more from '@common/images/addItem1.png'; 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.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this); this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this); this.getImg = this.getImg.bind(this); } handleSelect(index,ii) { const { selectDrug } = this.props; selectDrug && selectDrug(index,ii); } handleMouseEnterDrug(ii, index, it) { this.setState({ currentIndex: index, currentImg: ii }) } handleMouseLeaveDrug() { this.setState({ currentIndex: -1, }) } handleMouseEnterImg() { this.setState({ hasEnterImg: true }) } handleMouseLeaveImg() { this.setState({ hasEnterImg: false }) } setOtherRecommend(item, index) { this.showTreatDesc(); const { setOtherRecommend } = this.props; setOtherRecommend && setOtherRecommend(item, index); } setDrugInfo(item) { const { setDrugInfo } = this.props; setDrugInfo && setDrugInfo({name: item.medicitionName, type: 8, position: 5}); } getImg() { } //搜索药品说明书(查看数据用) handleInputDrug(e) { this.setState({ drugIdList: e.target.value }) } //搜索药品说明书(查看数据用) searchDrug() { const { setDrugInfoMore } = this.props const drugIdList = this.state.drugIdList.split(' ') setDrugInfoMore({drugIdList: drugIdList}) } showTreatDesc() { $('#treatDescBox').css({'display': 'block'}); $('#dragModalWrap').animate({'margin-left': '-471px','left':'50%'}, 300); $('#treatDescBox').animate({'width': '260px'}, 500); } render(){ const { treatment,showDrugInfo } = this.props const { currentImg, currentIndex, hasEnterImg } = this.state return( treatment && treatment.length > 0 &&

常用药物治疗

{/* 查看药物说明书 (添加数据查看数据用)*/} {/*
*/} {treatment.map((item, index) => { return(
{index + 1 + '. ' }{item.bigdrugsName}{item.subdrugsName && '('+item.subdrugsName+')'} {item.medicitionsList.map((it, ii) => { return ((it.isShow == 1 || it.selected) && {ii === 0 ? '' : ', '} {this.setDrugInfo(it);showDrugInfo();}} //药品说明双击显示(现在为点击图标显示) onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''} > {it.medicitionName} {} {it.forbidden === '1' ? 慎用: it.forbidden === '2' ? 禁用 : ''}, 使用率{it.rate} ) })}
{
this.setOtherRecommend(item, index)} >更多同类药
}
) })}
) } } export default DrugTreat;