index.jsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 PastHistory from './PastHistory'
  13. import PersonalHistory from './PersonalHistory'
  14. import FamilyHistory from './FamilyHistory'
  15. import MarriageHistory from './marriageHistory'
  16. import NewAdvice from '@containers/NewAdvice';
  17. import PushDataContainer from '@containers/PushDataContainer'
  18. import MenstruationHistory from './MenstruationHistory'
  19. // import OtherHistory from './OtherHistory';
  20. import CheckBody from './CheckBody';
  21. import {getWindowInnerHeight,getWindowInnerWidth,windowEventHandler} from '@utils/tools';
  22. import store from '@store';
  23. class BlockEMRCont extends Component {
  24. constructor(props){
  25. super(props);
  26. this.state = {
  27. isShowSexInput : true
  28. }
  29. this.$cont = React.createRef();
  30. this.$div = React.createRef();
  31. this.setHighter = this.setHighter.bind(this);
  32. }
  33. componentDidMount(){
  34. // const height = getWindowInnerHeight() - 175;
  35. // const width = getWindowInnerWidth() - 20;
  36. // this.$cont.current.style.height = height+"px";
  37. // this.$cont.current.style.minWidth = width + "px";
  38. // windowEventHandler('resize', ()=>{
  39. // const height = getWindowInnerHeight() - 175;
  40. // const width = getWindowInnerWidth() - 20;
  41. // if(this.$cont.current){
  42. // this.$cont.current.style.height = height + "px";
  43. // this.$cont.current.style.minWidth = width + "px";
  44. // }
  45. // });
  46. }
  47. componentWillReceiveProps(nextProps) {
  48. if (nextProps.patInfoData && nextProps.patInfoData.patInfoData[3].value === 1){
  49. this.setState({
  50. isShowSexInput : false
  51. })
  52. }else {
  53. this.setState({
  54. isShowSexInput: true
  55. })
  56. }
  57. }
  58. setHighter(ht){
  59. // console.log(ht, '-=-=-ht=-------');
  60. // console.log(this.$div.current.scrollHeight,'-=-this.$div.current.scrollHeight=-=-------');
  61. // if (this.$div.current) {
  62. // this.$div.current.style.paddingBottom = ht + 'px';
  63. // }
  64. // 低分辨率屏幕 处理 高度,暂时定为检验 + 48px 检查 +96px,可解决bug但是需要后期优化 2020/08/21
  65. if (this.$div.current && ht === 48){
  66. this.$div.current.style.paddingBottom = ht+'px';
  67. }
  68. if (this.$div.current && ht === 96) {
  69. this.$div.current.style.paddingBottom = ht + 'px';
  70. }
  71. }
  72. render() {
  73. const { isShowSexInput} = this.state
  74. const contStyle={
  75. opacity:'0.4',
  76. top:'1px',
  77. right:'0px',
  78. zIndex:'15',
  79. width:'14px',
  80. background:'#f1f1f1'};
  81. const barStyle={background:'#777',width:'100%',marginLeft:'0'};
  82. return <div className={style['EMR-container']}
  83. ref={this.$cont} id="addBlockScrollEvent">
  84. <InfoTitle hideHistory={true}></InfoTitle>
  85. <ScrollArea speed={1}
  86. horizontal={false}
  87. className={style["area"]}
  88. verticalContainerStyle={contStyle}
  89. verticalScrollbarStyle={barStyle}
  90. contentClassName="content">
  91. <div className={style['inner']} id="EmrBlockContainer" ref={this.$div}>
  92. <MainSuit></MainSuit>
  93. <CurrentIll></CurrentIll>
  94. {/* 既往史 */}
  95. <PastHistory></PastHistory>
  96. {/* 个人史 */}
  97. <PersonalHistory></PersonalHistory>
  98. {/* 家族史 */}
  99. <FamilyHistory></FamilyHistory>
  100. {/* 婚育史 */}
  101. <MarriageHistory></MarriageHistory>
  102. {/* 月经史 */}
  103. {isShowSexInput && <MenstruationHistory></MenstruationHistory>}
  104. {/* <OtherHistory></OtherHistory> */}
  105. <CheckBody setHighter={this.setHighter}></CheckBody>
  106. {/* 检验 */}
  107. <Inspect setHighter={this.setHighter}></Inspect>
  108. {/* 检查 */}
  109. <AssistCheck setHighter={this.setHighter}></AssistCheck>
  110. {/* 诊断 */}
  111. <Diagnosis setHighter={this.setHighter} hideChronic={true}></Diagnosis>
  112. {/* 医嘱 */}
  113. <NewAdvice setHighter={this.setHighter}></NewAdvice>
  114. {/* <AdviceContainer></AdviceContainer> */}
  115. </div>
  116. </ScrollArea>
  117. <PushDataContainer></PushDataContainer>
  118. <OperationContainer hideLabel={true}></OperationContainer>
  119. </div>
  120. }
  121. }
  122. export default BlockEMRCont;