import{d as m,r as l,u as g,t as u,j as s,g as j,a as c,e as y,B as I}from"./index-BtzNP73w.js";const w="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEUSURBVGiB7doxioNAFMbxb2aIK9YRwQMkdbDyHiLicfYwyyLew8oDeAEhGEgnOmEyWwXCVtHiDQPvX77qV7zuPXG6rxYArMFoFvR4y84Yrr/BDxyUVLoWEc7vMxUiEwopAIjTfbXPFc3jhmZqg84F8tPiQueHI0r5hVJag9EHNABMbdA9bmiswSjNgt4H9KupDTqzoJeuIXtjOHXSzhhcI7ZmZwwi+rYXPHF1jdmUROLvqrgG7I3h1DGcOoZTx3DqGE4dw6ljOHUMp47h1DGcOoZTx3DqGE6dv/Ck0rVrxNaSStfy/0nOh0SEs7+r4hqwN3/hKkQWFzp3Dfm0uNC5CpFJoZAejih9wL9O4kIhFb4+IfwBGatcwmah5+AAAAAASUVORK5CYII=",N=m.div`
  height: 100%;
  padding: 20px;
  padding-right: 0;
  .layout {
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    .card {
      width: 390px;
      height: 360px;
      margin-bottom: 16px;
      overflow: hidden;
      cursor: pointer;
      border-radius: 10px;
      border: 1px solid ${a=>a.theme.colorBorder};
      padding: 24px;
      .topuser {
        height: 90px;
        position: relative;
        border-bottom: 1px solid rgba(5, 166, 219, 0.5);
        .imgAndWord {
          height: 100%;
          width: 180px;
          font-size: 16px;
          display: flex;
          .img {
            width: 68px;
            height: 68px;
            line-height: 68px;
            text-align: center;
            border-radius: 34px;
            margin-right: 10px;
            font-size: 48px;
            border: 1px solid ${a=>a.theme.colorBorder};
          }
          .nameword {
            font-size: 20px;
          }
        }
        .tag {
          position: absolute;
          max-width: 200px;
          height: 46px;
          line-height: 46px;
          text-align: center;
          overflow: hidden;
          top: 15px;
          right: 0;
          padding: 0 15px;
          background: url(${w}) no-repeat center;
          background-size: 100% 100%;

          font-size: 16px;
          font-weight: 400;
          color: rgba(38, 239, 249, 1);
        }
      }
      .detailInfo {
        .bottomLine {
          border-bottom: 1px dashed rgba(5, 166, 219, 0.5); 
        }
        .infoItem1 {
          display: flex;
          flex-wrap: wrap;
          font-size: 16px;
          p {
            width: 50%;
            height: 56px;
            line-height: 56px;
            &:nth-child(2n) {
              text-align: right;
            }
            .value {
              margin-left: 15px;
            }
          }
          .time {
            width: 100%;
          }
        }
        .infoItem2 {
          height: 120px;
          padding: 15px 0;
          display: flex;
          flex-wrap: wrap;
          font-size: 16px;
          p {
            width: 50%;
            height: 30px;
            line-height: 30px;
            display: flex;
            .label {
              width: 55%;
              text-align: right;
            }
            .value {
              width: 40%;
              margin-left: 15px;
              text-align: left;
            }
            &:nth-child(2n) {
            }
          }
          .time {
            width: 100%;
          }
        }
        .infoItem3 {
          height: 65px;
          display: flex;
          flex-wrap: wrap;
          font-size: 16px;
          p {
            width: 50%;
            height: 65px;
            line-height: 65px;
            .value {
              margin-left: 15px;
            }
          }
          .time {
            width: 70%;
          }
          .infobtn {
            line-height: 65px;
            width: 30%;
          }
        }
      }
    }
  }

`,A=l.memo(()=>{const a=g(),{token:h}=u.useToken(),[p,n]=l.useState([]);l.useEffect(()=>{const e=async()=>{const d=await j("/api/DVPsyIndicator/All_muti");d.code===200&&d.data.length>0?n(d.data):n([{id:1,pNum:1011,age:18,pName:"演示一",pSex:1,createTime:c().format("HH:mm:ss")},{id:2,pNum:1012,age:18,pName:"演示二",pSex:2,createTime:c().format("HH:mm:ss")}])};e();const r=setInterval(()=>{e()},20*1e3);return()=>{clearInterval(r)}},[]);const t=(e,r)=>{if(r)switch(e){case 1:return"#43cf7c";case 2:return"#ffc300";case 3:return"#d43030";default:return""}else switch(e){case 1:return"rgba(255, 255, 255, 0.3)";case 2:return"rgba(255, 255, 255, 0.5)";case 3:return"rgba(255, 255, 255, 0.3)";default:return""}},i=e=>{switch(e){case 1:return"低";case 2:return"中";case 3:return"高";default:return"无"}},o=e=>{switch(e){case 1:return"稳定";case 2:return"小幅波动";case 3:return"大幅波动";default:return"无"}},x=(e,r)=>s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"topuser",children:[s.jsxs("div",{className:"imgAndWord",children:[s.jsx("div",{className:"img",children:s.jsx(y,{})}),s.jsxs("div",{className:"word",children:[s.jsx("p",{className:"nameword",children:e.pName?e.pName:"--"}),s.jsxs("p",{children:[e.sex===0?"--":e.pSex===1?"男":"女"," | ",e.age?e.age:"--","岁"]})]})]}),s.jsx("div",{className:"tag",children:e.pNum})]}),s.jsxs("div",{className:"detailInfo",children:[s.jsxs("div",{className:"infoItem1 bottomLine",children:[s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"心率:"}),s.jsxs("span",{className:"value",children:[s.jsx("span",{style:{color:"#43cf7c"},children:e.dV_PsyIndicator?parseInt(e.dV_PsyIndicator.meanHr):"--"}),"次/分"]})]}),s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"血氧:"}),s.jsxs("span",{className:"value",children:[s.jsx("span",{style:{color:"#43cf7c"},children:e.dV_PsyIndicator?parseInt(e.dV_PsyIndicator.saO2):"--"}),"%"]})]})]}),s.jsxs("div",{className:"infoItem2 bottomLine",children:[s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"专注度: "}),s.jsx("span",{className:"value",style:{color:t(e.dV_PsyIndicator&&e.dV_PsyIndicator.focus_State,e.id)},children:e.dV_PsyIndicator?i(e.dV_PsyIndicator.focus_State):"--"})]}),s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"情绪稳定性: "}),s.jsx("span",{className:"value",style:{color:t(e.dV_PsyIndicator&&e.dV_PsyIndicator.jinZhang,e.id)},children:e.dV_PsyIndicator?o(e.dV_PsyIndicator.jinZhang):"--"})]}),s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"兴奋度: "}),s.jsx("span",{className:"value",style:{color:t(e.dV_PsyIndicator&&e.energy_State,e.id)},children:e.dV_PsyIndicator?i(e.dV_PsyIndicator.energy_State):"--"})]}),s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"脑力应激: "}),s.jsx("span",{className:"value",style:{color:t(e.dV_PsyIndicator&&e.cognitiveStress,e.id)},children:e.dV_PsyIndicator?i(e.dV_PsyIndicator.cognitiveStress):"--"})]}),s.jsxs("p",{children:[s.jsx("span",{className:"label",children:"疲劳度: "}),s.jsx("span",{className:"value",style:{color:t(e.dV_PsyIndicator&&e.fatigue_State,e.id)},children:e.dV_PsyIndicator?i(e.dV_PsyIndicator.fatigue_State):"--"})]})]}),s.jsxs("div",{className:"infoItem3",children:[s.jsxs("p",{className:"time",children:[s.jsx("span",{className:"label",children:"更新时间:"}),s.jsx("span",{className:"value",children:e.dV_PsyIndicator?e.dV_PsyIndicator.createTime:"--"})]}),s.jsx("div",{className:"infobtn",children:s.jsx(I,{type:"primary",disabled:!e.dV_PsyIndicator,onClick:()=>a("/layout/DarkVisonMonitorInfo",{state:e.id}),children:"查看详情"})})]})]})]},r);return s.jsx(N,{theme:h,children:s.jsx("div",{className:"layout",children:p.map(e=>x(e,e.id))})})});A.displayName="DarkMonitor";export{A as default};
