index.jsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React, { Component } from 'react';
  2. import style from './index.less';
  3. import up from '@common/images/slide-up.png';
  4. import down from '@common/images/slide-down.png';
  5. import chronicPic from "@common/images/chronic.png";
  6. import className from 'classnames';
  7. import $ from 'jquery';
  8. import config from '@config/index';
  9. class MRAnalyse extends Component {
  10. constructor(props) {
  11. super(props)
  12. this.state = {
  13. slideUp: false
  14. }
  15. this.$content = React.createRef();
  16. this.slideToggle = this.slideToggle.bind(this);
  17. }
  18. slideToggle(){
  19. const { slideUp } = this.state
  20. $(this.$content.current).slideToggle(config.slideTime);
  21. this.setState({
  22. slideUp: !slideUp
  23. })
  24. }
  25. getDetail() {
  26. const { MRAnalyseResult } = this.props
  27. // const result =[
  28. // "诊断名称不标准(腹痛待查)",
  29. // "现病史缺少症状部位(腹痛)",
  30. // "现病史缺少症状缓解情况(腹痛)",
  31. // "现病史缺少症状加剧情况(腹痛)"
  32. // ]
  33. return MRAnalyseResult.map(item => (
  34. <p>{item}</p>
  35. ))
  36. }
  37. render() {
  38. const {slideUp} = this.state
  39. return <div className={style["tips"]} style={{marginBottom:'15px'}}>
  40. <div className={className(style["tips-title"],style["chronic"],"clearfix")} onClick={this.slideToggle}>
  41. <div className={style["tips-name"]}>
  42. <img src={chronicPic} />
  43. <h2>{'病历书写规范提示'}<span className={style["redTips"]}></span></h2>
  44. </div>
  45. <div className={style['toggle-btn']}>
  46. <img src={slideUp?down:up} alt="展开/收起"/>
  47. </div>
  48. </div>
  49. <div className={style["content"]} ref={this.$content}>
  50. {this.getDetail()}
  51. </div>
  52. </div>
  53. }
  54. }
  55. export default MRAnalyse;