index.jsx 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import React, { Component } from 'react';
  2. import MainSuit from '@containers/MainSuit';
  3. import CurrentIll from '@containers/CurrentIll';
  4. import OtherHistory from '@containers/OtherHistory';
  5. import CheckBody from '@containers/CheckBody';
  6. import Diagnosis from '@containers/Diagnosis';
  7. import Inspect from '@containers/Inspect';
  8. import AssistCheck from '@containers/AssistCheck';
  9. import OperationContainer from '../../containers/OperationContainer'
  10. import style from './index.less';
  11. import AdviceContainer from '../../containers/AdviceContainer';
  12. import InfoTitle from '@components/InfoTitle'
  13. import ScrollArea from 'react-scrollbar';
  14. import {getWindowInnerHeight,getWindowInnerWidth,windowEventHandler} from '@utils/tools';
  15. class EMRContainer extends Component {
  16. constructor(props){
  17. super(props);
  18. this.$cont = React.createRef();
  19. this.$div = React.createRef();
  20. this.setHighter = this.setHighter.bind(this);
  21. }
  22. componentDidMount(){
  23. // const {initHospital} = this.props;
  24. // initHospital()
  25. const height = getWindowInnerHeight() - 175;
  26. const width = getWindowInnerWidth() - 20;
  27. this.$cont.current.style.height = height+"px";
  28. this.$cont.current.style.minWidth = width + "px";
  29. windowEventHandler('resize', ()=>{
  30. const height = getWindowInnerHeight() - 175;
  31. const width = getWindowInnerWidth() - 20;
  32. if(this.$cont.current){
  33. this.$cont.current.style.height = height + "px";
  34. this.$cont.current.style.minWidth = width + "px";
  35. }
  36. });
  37. }
  38. setHighter(ht){
  39. // console.log(this.$div.current.scrollHeight);
  40. if(this.$div.current){
  41. this.$div.current.style.paddingBottom = ht+'px';
  42. }
  43. }
  44. render() {
  45. const contStyle={
  46. opacity:'0.4',
  47. top:'1px',
  48. right:'460px',
  49. zIndex:'15',
  50. width:'14px',
  51. background:'#f1f1f1'};
  52. const barStyle={background:'#777',width:'100%',marginLeft:'0'};
  53. return <div className={style['EMR-container']}
  54. ref={this.$cont} id="addScrollEvent">
  55. <ScrollArea speed={1}
  56. horizontal={false}
  57. className={style["area"]}
  58. verticalContainerStyle={contStyle}
  59. verticalScrollbarStyle={barStyle}
  60. contentClassName="content">
  61. <InfoTitle></InfoTitle>
  62. <div className={style['inner']} id="EmrContainer" ref={this.$div}>
  63. <MainSuit></MainSuit>
  64. <CurrentIll></CurrentIll>
  65. <OtherHistory></OtherHistory>
  66. <div>
  67. <CheckBody setHighter={this.setHighter}></CheckBody>
  68. </div>
  69. <Inspect setHighter={this.setHighter}></Inspect>
  70. <AssistCheck setHighter={this.setHighter}></AssistCheck>
  71. <Diagnosis setHighter={this.setHighter}></Diagnosis>
  72. <AdviceContainer></AdviceContainer>
  73. </div>
  74. <OperationContainer></OperationContainer>
  75. </ScrollArea>
  76. </div>
  77. }
  78. }
  79. export default EMRContainer;