index.jsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import React, { Component } from 'react';
  2. import style from './index.less';
  3. import { Button, ItemBox, ConfirmModal, Loading, Message, Add } from '@commonComp';
  4. import DiagnosticList from '@containers/DiagnosticList.js';
  5. // import TreatDrug from '@containers/TreatDrug.js'
  6. import { getPageCoordinate } from '@utils/tools';
  7. import DiagResultSearch from '@containers/DiagResultSearch'
  8. import $ from 'jquery';
  9. class Diagnosis extends Component {
  10. constructor(props) {
  11. super(props);
  12. this.state = {
  13. diagType: 0,
  14. showSearch: props.show,
  15. pageTop: ''
  16. }
  17. this.showSearch = this.showSearch.bind(this);
  18. this.hideSearch = this.hideSearch.bind(this);
  19. this.handleshowSearch = this.handleshowSearch.bind(this);
  20. }
  21. componentWillReceiveProps() {
  22. this.setState({
  23. showSearch: this.props.show
  24. })
  25. }
  26. showSearch() {
  27. const { showSearch } = this.props
  28. showSearch && showSearch()
  29. }
  30. hideSearch() {
  31. const { hideSearch } = this.props
  32. hideSearch && hideSearch()
  33. }
  34. handleshowSearch(e) {
  35. this.props.show ? this.hideSearch() : this.showSearch()
  36. this.setState({ pageTop:getPageCoordinate(e).boxTop })
  37. }
  38. render() {
  39. return (<div id="diagnosisResult">
  40. <ItemBox id="diagnosis" title='诊断' boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
  41. <DiagnosticList></DiagnosticList>
  42. <div style={{ marginLeft: '10px', position: 'relative' }}>
  43. <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px" />
  44. <DiagResultSearch windowHeight={this.props.windowHeight} pageTop={this.state.pageTop} height={150}></DiagResultSearch>
  45. </div>
  46. </ItemBox>
  47. {/* <TreatDrug></TreatDrug> */}
  48. <Message></Message>
  49. </div>)
  50. }
  51. }
  52. export default Diagnosis;