index.jsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import style from "../index.less";
  2. import { normalVal,getStatusImg } from '@utils/tools';
  3. const PreviewInspect = (props) => {
  4. const { dataJson, toTime ,dateTime,showDetails } = props;
  5. console.log(props,'===props');
  6. console.log(dataJson,'===dataJson==_');
  7. return <tr className={style['patInfoFst']}>
  8. <td className={style['patInfoSec']}>化验:</td>
  9. <td className={style['patInfoSec']}>
  10. {
  11. dataJson&&dataJson.getExcelDataList && dataJson.getExcelDataList.map((items) => {
  12. return items.lisExcelRes && items.lisExcelRes.map((item) => {
  13. return <table style={style.assistTable}>
  14. <tr style={style.assistTableTrFst}><td><span>{item.menus}</span></td></tr>
  15. {
  16. item.lisExcelItem && item.lisExcelItem.map((value) => {
  17. return <tr className={style.assistTableTrSec}>
  18. <td className={style.assistTableTdFst}>{value.itemName}</td>
  19. <td className={style.assistTableTdSec}>
  20. {getStatusImg(value.type,value.value,1)}
  21. {value.unit}
  22. </td>
  23. <td className={style.assistTableTdTrd}>
  24. {normalVal(value.min, value.max)}
  25. </td>
  26. <td className={style.assistTableTdFor}>{value.time == '' ? ('导入时间:' + dateTime) : '化验时间:' + toTime(value.time)
  27. }</td>
  28. </tr>
  29. })
  30. }
  31. </table>
  32. })
  33. })
  34. }
  35. {
  36. dataJson&&dataJson.labelList && dataJson.labelList.map((item, idx) => {
  37. return <table style={{ margin: '8px 0', width: '100%' }}>
  38. {
  39. item.show?<tr className={style.assistTableTrFst}>
  40. <td colSpan='4'>
  41. <span> {item.name} </span>
  42. <p style={{display:item.inpValue?'inline-block':'none'}}>
  43. ({item.inpValue})
  44. <i></i>
  45. </p>
  46. </td>
  47. </tr>:
  48. <tr className={style.assistTableTrFstExcel}><td><span>「{item.name}」</span></td></tr>
  49. }
  50. {
  51. item.details.map((val) => {
  52. if (val.value && val.value != '') {
  53. return <tr className={style.assistTableTrSecExcel}>
  54. <td className={style.assistTableTdFst}>{val.name}</td>
  55. {showDetails(val)}
  56. <td className={style.assistTableTdTrd}>
  57. {normalVal(val.minValue, val.maxValue)}
  58. </td>
  59. <td className={style.assistTableTdFor}>{'化验时间:' + item.time}</td>
  60. </tr>
  61. }
  62. })
  63. }
  64. </table>
  65. })
  66. }
  67. </td>
  68. </tr>
  69. }
  70. export default PreviewInspect;