index.jsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import React, { Component } from 'react';
  2. import style from './index.less';
  3. import {Button, ItemBox, ConfirmModal, Loading, Message} from '@commonComp';
  4. import DiagnosticList from '@containers/DiagnosticList.js';
  5. // import TreatDrug from '@containers/TreatDrug.js'
  6. import DiagResultSearch from '@containers/DiagResultSearch'
  7. import $ from 'jquery';
  8. import more from '@common/images/addItem1.png';
  9. class Diagnosis extends Component {
  10. constructor(props) {
  11. super(props);
  12. this.state = {
  13. diagType: 0,
  14. showSearch: props.show,
  15. }
  16. this.showSearch = this.showSearch.bind(this);
  17. this.hideSearch = this.hideSearch.bind(this);
  18. this.handleshowSearch = this.handleshowSearch.bind(this);
  19. }
  20. componentWillReceiveProps() {
  21. this.setState({
  22. showSearch: this.props.show
  23. })
  24. }
  25. showSearch() {
  26. const { showSearch } = this.props
  27. showSearch && showSearch()
  28. }
  29. hideSearch() {
  30. const { hideSearch } = this.props
  31. hideSearch && hideSearch()
  32. }
  33. handleshowSearch() {
  34. this.props.show ? this.hideSearch() : this.showSearch()
  35. }
  36. render() {
  37. return (<div>
  38. <ItemBox id="diagnosis" title='诊断' boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
  39. <DiagnosticList></DiagnosticList>
  40. <div style={{marginLeft:'10px'}}>
  41. <img src={more} style={{verticalAlign:'middle',marginRight:'2px'}}/>
  42. <span id='addDiag' className={style['add-diag']} onClick={this.handleshowSearch}>添加诊断结果</span>
  43. </div>
  44. <DiagResultSearch></DiagResultSearch>
  45. </ItemBox>
  46. {/* <TreatDrug></TreatDrug> */}
  47. <Message></Message>
  48. </div>)
  49. }
  50. }
  51. export default Diagnosis;