import{p as T,r,t as y,f as D,j as e,B as j,cg as O,A as P,d as c,I as W,D as S,g as m,a as _,l as V}from"./index-CKIL6d0V.js";import{d as k,e as G}from"./chartsConfig-B08bcqCP.js";import{R as J}from"./index-B2ZyvyaB.js";import{L as U}from"./index-BBmyp6e2.js";import{d as Z}from"./htmlToPdf-CBQd1Ckv.js";import{R as K}from"./PrinterOutlined-IzRNsDbg.js";import{F as Q}from"./Table-BaVi_066.js";import{P as q}from"./index-V9Oy4lBT.js";import"./iconUtil-Co5gbObL.js";import"./index-C-LPyJas.js";const X=T.div`
  height: 100%;
  display: flex;
  .leftTable {
    flex: 1;
    display: flex;
    flex-direction: column;
    .topsearch {
      height: 60px;
      display: flex;
      background-color: ${s=>s.theme.colorBgContainer};
      .inp {
        flex: 2;
        display: flex;
        padding: 0 16px;
        align-items: center;
        .label {
          width: 60px;
          line-height: 30px;
        }
        .antd_input {
          height: 30px;
        }
      }
      .date {
        flex: 4;
        display: flex;
        padding: 0 16px;
        .startDate {
          width: 50%;
          display: flex;
          align-items: center;
          margin-right: 16px;
          .label {
            width: 40px;
            line-height: 30px;
          }
          .date {
            height: 30px;
          }
        }
        .endDate {
          width: 50%;
          display: flex;
          align-items: center;
          margin-right: 16px;
          .label {
            width: 40px;
            line-height: 30px;
          }
          .date {
            height: 30px;
          }
        }
      }
      .btn {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .bottomtable {
      flex: 1;
      padding: 16px 0;
      box-sizing: border-box;
      overflow: hidden;
      border-radius: 6px;
    }
  }
  .rightReport {
    width: 794px;
    height: 100%;
    overflow: auto;
    position: relative;
  }
`,ee=T.div`
  height: 1100px;
  position: relative;
  .dom {
    height: 100%;
    padding: 16px;
    overflow: auto;
    .title {
      font-size: 18px;
      text-align: center;
    }
    .personInfo {
      border: 1px solid ${s=>s.theme.colorBorder};
      li {
        height: 36px;
        line-height: 36px;
        display: flex;
        border-bottom: 1px solid ${s=>s.theme.colorBorder};
        
        &:nth-last-child(1) {
          border: none;
        }
        span {
          flex: 1;
          border-right: 1px solid ${s=>s.theme.colorBorder};
          text-align: center;
          &:nth-last-child(1) {
            border: none;
          }
        }
      }
    }
    .traindata {
      border: 1px solid ${s=>s.theme.colorBorder};
      li {
        height: 36px;
        line-height: 36px;
        display: flex;
        border-bottom: 1px solid ${s=>s.theme.colorBorder};
        
        &:nth-last-child(1) {
          border: none;
        }
        span {
          flex: 1;
          border-right: 1px solid ${s=>s.theme.colorBorder};
          text-align: center;
          &:nth-last-child(1) {
            border: none;
          }
        }
        .special {
          flex: 3;
        }
      }
    }
    
    .chartLine {
      height: 200px;
      padding-top: 20px;
    }
    .charts {
      height: 240px;
      display: flex;
      justify-content: center;
      .radarChart {
        width: 100%;
      }
      /* .barChart {
        width: 60%;
      } */
    }
    .suggestText {
      text-indent: 2em;
      font-size: 14px;
    }
  }
  .isprint.dom {
    color: #000;
    background-color: #fff;
  }

  .dividerLine {
    height: 50px;
    display: flex;
    align-items: center;
    .line {
      flex: 1;
      height: 1px;
      border-top: 1px solid ${s=>s.theme.colorText};
    }
    .world {
      text-align: center;
      padding: 0 20px;
      height: 100%;
      line-height: 50px;
    }
  }
  .printbtn {
    position: absolute;
    top: 16px;
    right: 20px;
    height: 40px;
    width: 40px;
  }
`,te=s=>{switch(s){case 1:return"轻";case 2:return"中";case 3:return"重";default:return""}},w=s=>{switch(s){case 1:return"低";case 2:return"中";case 3:return"高";default:return""}},se=s=>{switch(s){case 1:return"无";case 2:return"中";case 3:return"高";default:return""}},ae=s=>{switch(s){case 1:return"比较稳定";case 2:return"小幅波动";case 3:return"大幅波动";default:return""}},ne=s=>{const i=`t0${(s.trainType*10-10).toString()}`;let n="";return Object.keys(s).forEach(t=>{i==="t06"?t.includes(i)&&t.endsWith("CoordinationTotal")&&(n=s[t]):t.includes(i)&&t.endsWith("AbilityTotal")&&(n=s[t])}),n},ie=s=>{const i=`t0${(s.trainType*10-10).toString()}`;let n="";return Object.keys(s).forEach(t=>{t.includes(i)&&t.endsWith("Unanswered")&&(n=s[t])}),n},re=s=>{const i=`t0${(s.trainType*10-10).toString()}`;let n="";return Object.keys(s).forEach(t=>{i==="t06"?t.includes(i)&&t.endsWith("CoordinationTime")&&(n=s[t]):t.includes(i)&&t.endsWith("AbilityTime")&&(n=s[t])}),O(n)},le=s=>{const i=`t0${(s.trainType*10-10).toString()}`;let n="";return Object.keys(s).forEach(t=>{i==="t06"?t.includes(i)&&t.endsWith("CorrectRate")&&(n=s[t]):t.includes(i)&&t.endsWith("AbilityCorrectRate")&&(n=s[t])}),n},de=s=>{const i=`t0${(s.trainType*10-10).toString()}`;let n="";return Object.keys(s).forEach(t=>{i==="t06"?t.includes(i)&&t.endsWith("CoordinationScore")&&(n=s[t]):t.includes(i)&&t.endsWith("AbilityScore")&&(n=s[t])}),n},ce=r.memo(s=>{const{token:i}=y.useToken(),n=r.useRef(null),{data:t,type:o,evaluate:p}=s;t&&t.outputTrain_Subject_Infos&&JSON.parse(t.outputTrain_Subject_Infos);const[g,h]=r.useState(!1),{genderList:u}=D(x=>x),f=()=>{h(!0),setTimeout(()=>{Z("训练报告",n.current),h(!1)},0)};return e.jsxs(ee,{theme:i,children:[t&&e.jsxs("div",{className:`dom ${g?"isprint":""}`,ref:n,children:[e.jsx("p",{className:"title",children:"单人训练报告"}),e.jsxs("div",{className:"dividerLine",children:[e.jsx("div",{className:"line"}),e.jsx("div",{className:"world",children:"基本信息"}),e.jsx("div",{className:"line"})]}),e.jsxs("ul",{className:"personInfo",children:[e.jsxs("li",{children:[e.jsx("span",{children:"账 号"}),e.jsx("span",{children:t.pNum}),e.jsx("span",{children:"姓 名"}),e.jsx("span",{children:t.pName}),e.jsx("span",{children:"性 别"}),e.jsx("span",{children:u[t.pSex]}),e.jsx("span",{children:"年龄"}),e.jsx("span",{children:t.pAge})]}),e.jsxs("li",{children:[e.jsx("span",{children:"训练日期"}),e.jsx("span",{children:t.trainDate.split(" ")[0]}),e.jsx("span",{children:"训练总分"}),e.jsx("span",{children:t.totalScore})]}),e.jsxs("li",{children:[e.jsx("span",{children:"开始时间"}),e.jsx("span",{children:t.startTime.split(" ")[1]}),e.jsx("span",{children:"结束时间"}),e.jsx("span",{children:t.endTime.split(" ")[1]})]})]}),t.evaluate!==3&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"dividerLine",children:[e.jsx("div",{className:"line"}),e.jsx("div",{className:"world",children:"训练数据"}),e.jsx("div",{className:"line"})]}),e.jsxs("ul",{className:"traindata",children:[e.jsxs("li",{children:[e.jsx("span",{children:"训练类型"}),e.jsx("span",{children:"总题数"}),e.jsx("span",{children:"未答题数"}),e.jsx("span",{children:"耗时"}),e.jsx("span",{children:"正确率"}),e.jsx("span",{children:"得分"})]}),e.jsxs("li",{children:[e.jsx("span",{children:o&&o[t.trainType]}),e.jsx("span",{children:ne(t)}),e.jsx("span",{children:ie(t)}),e.jsx("span",{children:re(t)}),e.jsx("span",{children:le(t)}),e.jsx("span",{children:de(t)})]})]}),e.jsxs("div",{className:"dividerLine",children:[e.jsx("div",{className:"line"}),e.jsx("div",{className:"world",children:"训练数据"}),e.jsx("div",{className:"line"})]}),e.jsxs("ul",{className:"traindata",children:[e.jsxs("li",{children:[e.jsx("span",{children:"项目"}),e.jsx("span",{children:"情绪稳定性"}),e.jsx("span",{children:"脑力应激"}),e.jsx("span",{children:"疲劳度"}),e.jsx("span",{children:"兴奋度"}),e.jsx("span",{children:"专注度"})]}),e.jsxs("li",{children:[e.jsx("span",{children:o&&o[t.trainType]}),e.jsx("span",{children:ae(t.pJinZhang)}),e.jsx("span",{children:se(t.pCognitiveStress)}),e.jsx("span",{children:te(t.pFatigueState)}),e.jsx("span",{children:w(t.pEnergyState)}),e.jsx("span",{children:w(t.pFocusState)})]})]}),e.jsx("div",{className:"chartLine",children:e.jsx(U,{option:k(JSON.parse(t.meanHr),"心率变化曲线图")})}),e.jsx("div",{className:"charts",children:e.jsx("div",{className:"radarChart",children:e.jsx(J,{option:G(JSON.parse(t.train))})})})]}),e.jsxs("div",{className:"dividerLine",children:[e.jsx("div",{className:"line"}),e.jsx("div",{className:"world",children:"评价建议"}),e.jsx("div",{className:"line"})]}),e.jsx("div",{className:"suggestText",children:p&&p[t.evaluate]})]}),e.jsx("div",{className:"printbtn",children:e.jsx(j,{onClick:f,shape:"circle",icon:e.jsx(K,{})})})]})}),oe=r.memo(()=>{const{token:s}=y.useToken(),{message:i}=P.useApp();D(a=>a);const[n,t]=r.useState(0),[o,p]=r.useState([]),[g,h]=r.useState(null),[u,f]=r.useState(""),[x,R]=r.useState(c().add(-5,"year")),[v,C]=r.useState(c()),[b,Y]=r.useState(null),[he,I]=r.useState(null),[$,E]=r.useState(null);r.useEffect(()=>{(async()=>{const{code:l,data:d,msg:N}=await m("/api/VRRePort/GetSingleReport",{StartTime:c().add(-5,"year").format("YYYY-MM-DD HH:mm:ss"),EndTime:c().format("YYYY-MM-DD HH:mm:ss"),pageIndex:1,pageSize:9999});l===200?(p(d.items),h(d.items[0]),t(d.totalRecords)):i.error(N);const M=await m("/api/Dict/GetDict_TrainType");Y(M.data);const z=await m("/api/Dict/GetDict_TrainModule");I(z.data);const B=await m("/api/Dict/GetDict_VRREvaluate");E(B.data)})()},[]);const F=[{title:"序 号",dataIndex:"id",align:"center",width:65,key:"id",render:(a,l,d)=>e.jsx(e.Fragment,{children:d+1})},{title:"账 号",dataIndex:"pNum",align:"center",key:"id",render:a=>e.jsx(e.Fragment,{children:a})},{title:"姓 名",dataIndex:"pName",align:"center",key:"id",render:a=>e.jsx(e.Fragment,{children:a})},{title:"训练类型",dataIndex:"trainType",align:"center",key:"id",render:a=>e.jsx(e.Fragment,{children:b&&b[a]})},{title:"总 分",dataIndex:"totalScore",align:"center",width:65,key:"id",render:a=>e.jsx(e.Fragment,{children:a})},{title:"训练时间",dataIndex:"trainDate",width:180,align:"center",key:"id",render:a=>e.jsx(e.Fragment,{children:a})},{title:"操 作",dataIndex:"id",align:"center",key:"id",className:"columnStyle",fixed:"right",width:180,render:(a,l)=>e.jsxs(_,{children:[e.jsx(q,{placement:"top",title:"确定删除吗?",onConfirm:d=>confirm(l.id),okText:"确定",cancelText:"取消",children:e.jsx(j,{size:"small",children:"删 除"})}),e.jsxs(j,{size:"small",onClick:d=>h(l),children:["预览",e.jsx(V,{})]})]})}],A=(a,l)=>{console.log(a,l),R(a)},H=(a,l)=>{console.log(a,l),C(a)},L=async()=>{const a={StartTime:x?c(x).format("YYYY-MM-DD HH:mm:ss"):c().add(-5,"year").format("YYYY-MM-DD HH:mm:ss"),EndTime:v?c(v).format("YYYY-MM-DD HH:mm:ss"):c().format("YYYY-MM-DD HH:mm:ss"),pageIndex:1,pageSize:9999,pName:u},{code:l,data:d,msg:N}=await m("/api/VRRePort/GetSingleReport",a);l===200?(p(d.items),h(d.items[0]),t(d.totalRecords)):i.error(N)};return e.jsxs(X,{theme:s,children:[e.jsxs("div",{className:"leftTable",children:[e.jsxs("div",{className:"topsearch",children:[e.jsxs("div",{className:"inp",children:[e.jsx("span",{className:"label",children:"姓 名: "}),e.jsx(W,{className:"antd_input",value:u,allowClear:!0,onChange:a=>f(a.target.value),placeholder:"请输入姓名"})]}),e.jsxs("div",{className:"date",children:[e.jsxs("div",{className:"startDate",children:[e.jsx("span",{className:"label",children:"开 始: "}),e.jsx(S,{className:"date",value:x,onChange:A})]}),e.jsxs("div",{className:"endDate",children:[e.jsx("span",{className:"label",children:"结 束: "}),e.jsx(S,{className:"date",value:v,onChange:H})]})]}),e.jsx("div",{className:"btn",children:e.jsx(j,{onClick:L,children:"搜 索"})})]}),e.jsx("div",{className:"bottomtable",children:o&&e.jsx(Q,{rowKey:a=>a.id,size:"small",showExpandColumn:!1,columns:F,dataSource:o,sticky:!0,pagination:{total:n||0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:13,showTotal:()=>`共 ${n} 条`}})})]}),e.jsx("div",{className:"rightReport",children:e.jsx(ce,{data:g,type:b,evaluate:$})})]})});oe.displayName="VROnce";export{oe as default};
