index.jsx 2.8 KB

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