import style from "../index.less";
import { normalVal,getStatusImg } from '@utils/tools';

const PreviewInspect = (props) => {
  const { dataJson, toTime ,dateTime,showDetails  } = props;
  // console.log(dateTime,'dateTime');
    return <tr className={style['patInfoFst']}>
      <td className={style['patInfoSec']}>检验：</td>
      <td className={style['patInfoSec']}>
        <table style={style.assistTable}>
        {
          (dataJson.labelListSmall.length !== 0 || dataJson.labelListBig.length !== 0) && ( <tr style={{ lineHeight: '36px' }}>检验结果数据</tr>)
        }
        {
          dataJson && dataJson.labelListSmall && dataJson.labelListSmall.map((item) => {
            // console.log(item, item,'=====');
              return (               
                  <tr className={style.assistTableTrSec}>
                    <td className={style.assistTableTdFst}>{item.detailName}</td>
                    <td className={style.assistTableTdSec}>
                      {/* {getStatusImg(value.type, value.value, 1)}
                      {value.unit} */}
                      {getStatusImg(0, item.value, 1)}
                      {item.units}
                      {/* {getStatusImg(2, 9.8, 1)}
                      {'mmol/L'} */}
                    </td>
                    {/* {showDetails(item)} */}
                    <td className={style.assistTableTdTrd}>
                      {normalVal(item.minValue, item.maxValue)}
                      {/* {normalVal(3.9, 6.1)} */}
                    </td>
                    {/* <td className={style.assistTableTdFor}>{item.time == '' ? ('导入时间：' + dateTime) : '检验时间：' + toTime(item.time) */}
                  {/* <td className={style.assistTableTdFor}>{item.time == '' ?   dateTime  :  item.time}</td> */}
                  <td className={style.assistTableTdFor}>{item.time }</td>
                  </tr>
                // </table>
              )
          })
        }

        {
          dataJson && dataJson.labelListBig && dataJson.labelListBig.map((item) => {
            return (
              // <table style={style.assistTable}>
                <tr className={style.assistTableTrSec}>
                  <td className={style.assistTableTdFst}>{item.name}</td>  
                  <td className={style.assistTableTdSec}></td>
                  <td className={style.assistTableTdTrd}></td>                                             
                  {/* <td className={style.assistTableTdFor}>{item.time == '' ? ('导入时间：' + dateTime) : '检验时间：' + toTime(item.time) */}
                  {/* <td className={style.assistTableTdFor}>{item.time == '' ? dateTime : toTime(item.time) */}
                  <td className={style.assistTableTdFor}>{item.time == '' ? dateTime : toTime(item.time)}</td>
                </tr>
              // </table>
            )
          })
        }

        </table>
        {/* {
          dataJson&&dataJson.getExcelDataList && dataJson.getExcelDataList.map((items) => {
            return items.lisExcelRes && items.lisExcelRes.map((item) => {
              return <table style={style.assistTable}>
                <tr style={style.assistTableTrFst}><td><span>{item.menus}</span></td></tr>
                {
                  item.lisExcelItem && item.lisExcelItem.map((value) => {
                    return <tr className={style.assistTableTrSec}>
                      <td className={style.assistTableTdFst}>{value.itemName}</td>
                      <td className={style.assistTableTdSec}>
                        {getStatusImg(value.type,value.value,1)}
                        {value.unit}
                      </td>
                      <td className={style.assistTableTdTrd}>
                        {normalVal(value.min, value.max)}
                      </td>
                      <td className={style.assistTableTdFor}>{value.time == '' ? ('导入时间：' + dateTime) : '检验时间：' + toTime(value.time)
                    }</td>
                    </tr>
                  })
                }
              </table>
            })
          })
        } */}
        {/* {
          dataJson&&dataJson.labelList && dataJson.labelList.map((item, idx) => {
            return <table style={{ margin: '8px 0', width: '100%' }}>
              {
                item.show?<tr className={style.assistTableTrFst}>
                  <td colSpan='4'>
                    <span> {item.name} </span> 
                    <p style={{display:item.inpValue?'inline-block':'none'}}>
                      ({item.inpValue})
                      <i></i>
                    </p>
                    </td>
                </tr>:
                <tr className={style.assistTableTrFstExcel}><td><span>「{item.name}」</span></td></tr>
              }
              {
                item.details.map((val) => {
                  if (val.value && val.value != '') {
                    return <tr className={style.assistTableTrSecExcel}>
                      <td className={style.assistTableTdFst}>{val.name}</td>
                      {showDetails(val)}
                      <td className={style.assistTableTdTrd}>
                        {normalVal(val.minValue, val.maxValue)}
                      </td>
                      <td className={style.assistTableTdFor}>{'检验时间：' + item.time}</td>
                    </tr>
                  }
                })
              }
            </table>
          })
        } */}
      </td>
    </tr>
}

export default PreviewInspect;
