import React, { Component } from "react";
import ReactDom from "react-dom";
import style from "./index.less";
import close from '@common/images/icon_close.png';
import SlideTgl from "./SliddleTgl";

class PreIcss extends Component {
  constructor(props){
    super(props)
  }
  render() {
    const { show,data,windowHeight,showPreModal,showPre,isMove,setMove } = this.props;
    const domNode = document.getElementById('root');
    return ReactDom.createPortal(<div className={style['preInIcss']}>
      <div className={style.title}>
          <span>患者预问诊信息</span>
          <img src={close} alt="关闭" onClick={showPreModal}/>
        </div>
      <div className={style.scrollWrap} style={{height:windowHeight-100+'px'}}>
        {
          data.map((item,index)=>{
            return <div className={style.mainPre}>
              <ul>
                <li><span>预问诊录入时间：</span>{item.gmtCreate}</li>
                <li><span>录入选择医院：</span>{item.sonHospitalName?item.sonHospitalName:item.hospitalName}</li>
                <li><span>科室：</span>{item.hospitalDeptName}</li>
                <li><span>主诉：</span>{item.detail.chiefComplaint}</li>
                <SlideTgl showPre={showPre} item={item} isMove={isMove} setMove={setMove}></SlideTgl>
              </ul>
            </div>
          })
        }
      </div>
    </div>,domNode)
  }
}

export default PreIcss;
