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 HasInfoItem from '@common/components/HasInfoItem' 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(position) { const { selectDrug } = this.props; selectDrug && selectDrug(position); } 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( position) { this.showTreatDesc(); const { setOtherRecommend } = this.props; setOtherRecommend && setOtherRecommend(position); } 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 { treatmentPlan,showDrugInfo } = this.props const { currentImg, currentIndex, hasEnterImg } = this.state return( treatmentPlan && treatmentPlan.length > 0 &&