import React,{Component} from 'react'; import style from './index.less'; import {ItemBox} from '@commonComp'; import {setFontColorSize} from '@utils/tools'; import Textarea from './Textarea'; import FollowUp from '@components/Treat/FollowUp' class Advice extends Component{ constructor(props){ super(props); this.treatInput = React.createRef(); this.assayRef = React.createRef(); this.checkRef = React.createRef(); this.adviceInputRef = React.createRef(); this.handleTreatInput = this.handleTreatInput.bind(this); this.handleAssayInput = this.handleAssayInput.bind(this); this.handleCheckInput = this.handleCheckInput.bind(this); this.handleComTreatInput = this.handleComTreatInput.bind(this); this.handleAdviceInput = this.handleAdviceInput.bind(this); } componentWillReceiveProps(next){ const isRead = this.props.isRead; // if(next.isRead != isRead||next.value!=this.props.value){ //value对比解决复诊不显示bug // this.adviceInputRef.current.innerText?(this.adviceInputRef.current.innerText = next.value||''):(this.adviceInputRef.current.innerHTML = next.value||''); // } } handleTreatInput(e, index, ii) { const {advice} = this.props.pushMessage; const changeInput = e.target.value //改变的同类药的值 const { setChangeAdviceTreatment } = this.props; setChangeAdviceTreatment && setChangeAdviceTreatment(index, ii, changeInput) } handleAssayInput(e) { const changeInput = e.target.value const { setChangeAdviceAssay } = this.props; setChangeAdviceAssay && setChangeAdviceAssay(changeInput) } handleCheckInput(e) { const changeInput = e.target.value const { setChangeAdviceCheck } = this.props; setChangeAdviceCheck && setChangeAdviceCheck(changeInput) } handleComTreatInput(text) { const { comTreatChange } = this.props; comTreatChange && comTreatChange(text) } handleAdviceInput(text) { const { adviceInputChange } = this.props; adviceInputChange && adviceInputChange(text) } componentDidMount(){ // this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '') // const {advice} = this.props.pushMessage.advice } render(){ const {advice} = this.props.pushMessage; const {isRead, isFirstMainDiag, followUp, hasFollowUp, saveFollowUp, typeConfig,hideAllDrop} = this.props let scheme = advice.scheme && advice.scheme.map((item0, index0) => { return
{item0.treatment.map((item1, index1) => { return item1.meditionDetails.map((item2, index2) => { return item2.treatment.map((item3, index3) => { return(item3.treatmentStr && item3.treatmentStr.length > 0 ?