import{p as M,r as t,t as O,A as V,d as m,j as s,D,B as k,g as y}from"./index-CKIL6d0V.js";import{P as $}from"./index-ByXZCobc.js";import{a as H,B as J,c as L}from"./chartsConfig-B08bcqCP.js";import{d as Z}from"./htmlToPdf-CBQd1Ckv.js";const G=M.div`
  height: 100%;
  width: 796px;
  overflow: auto;
  margin: 0 auto;
  &::-webkit-scrollbar {
    display: none;
  }
  .topsearch {
    height: 60px;
    display: flex;
    padding-top: 10px;
    .left {
      flex: 3;
      display: flex;
      padding: 0 16px;
      .startDate {
        width: 50%;
        display: flex;
        margin-right: 16px;
        .label {
          width: 40px;
          line-height: 30px;
        }
        .date {
          height: 30px;
        }
      }
      .endDate {
        width: 50%;
        display: flex;
        margin-right: 16px;
        .label {
          width: 40px;
          line-height: 30px;
        }
        .date {
          height: 30px;
        }
      }
    }
    .right {
      flex: 1;
      .space {
        margin-right: 20px;
      }
    }
  }
  .teamReport {
    padding: 10px;
    font-size: 16px;
    border: 1px solid ${n=>n.theme.colorBorder};
    > .title {
      font-size: 18px;
      text-align: center;
    }
    .basicInfo {
      height: 36px;
      line-height: 36px;
      display: flex;
      border: 1px solid ${n=>n.theme.colorBorder};
      span {
        flex: 1;
        text-align: center;
        border-right: 1px solid ${n=>n.theme.colorBorder};
        &:nth-child(2) {
          flex: 2;
        }
        &:nth-last-child(1) {
          border: none;
        }
      }
    }
    .trainType {
      line-height: 36px;
    }
    .spaceTimeEstimate {
      margin-bottom: 10px;
      border: 1px solid ${n=>n.theme.colorBorder};
      li {
        height: 36px;
        line-height: 36px;
        display: flex;
        border-bottom: 1px solid ${n=>n.theme.colorBorder};
        
        &:nth-last-child(1) {
          border: none;
        }
        span {
          flex: 1;
          border-right: 1px solid ${n=>n.theme.colorBorder};
          text-align: center;
          &:nth-last-child(1) {
            border: none;
          }
        }
        .special {
          flex: 2.5;
        }
      }
    }

    .empty {
      justify-content: center;
    }

    .charts {
      height: 300px;
      display: flex;
      .leftpie {
        flex: 1;
      }
      .rightbar {
        flex: 2;
      }
    }
  }
  .isprint.teamReport {
    color: #000;
    background-color: #fff;
  }
  .dividerLine {
    height: 50px;
    display: flex;
    align-items: center;
    .line {
      flex: 1;
      height: 1px;
      border-top: 1px solid ${n=>n.theme.colorText};
    }
    .world {
      text-align: center;
      padding: 0 20px;
      height: 100%;
      line-height: 50px;
    }
  }
`,E=(n,p)=>{const x=Object.keys(n),d=[];return x.forEach(o=>{o.includes(p)&&d.push(n[o])}),d},N=n=>{switch(n){case 1:return"轻";case 2:return"中";case 3:return"重";default:return""}},j=n=>{switch(n){case 1:return"低";case 2:return"中";case 3:return"高";default:return""}},g=n=>{switch(n){case 1:return"无";case 2:return"中";case 3:return"高";default:return""}},T=n=>{switch(n){case 1:return"比较稳定";case 2:return"小幅波动";case 3:return"大幅波动";default:return""}},c=n=>!!(Array.isArray(n)&&n.length>0),I=(n=[])=>{const p=[{value:0,name:"优秀型"},{value:0,name:"成长型"},{value:0,name:"失调型"},{value:0,name:"警示型"}];return JSON.parse(n).forEach((x,d)=>{p[d].value=x}),p},h=n=>{const{title:p}=n;return s.jsxs("div",{className:"dividerLine",children:[s.jsx("div",{className:"line"}),s.jsx("div",{className:"world",children:p}),s.jsx("div",{className:"line"})]})},W=t.memo(()=>{const n=t.useRef(null),{token:p}=O.useToken(),{message:x}=V.useApp(),[d,o]=t.useState(m().add(-5,"year")),[f,C]=t.useState(m()),[a,b]=t.useState({}),[A,v]=t.useState([]),[_,S]=t.useState(!1),[r,P]=t.useState(null);t.useEffect(()=>{(async()=>{const{code:i,data:l,msg:u}=await y("/api/VRRePort/GetCompositeReport",{StartTime:m().add(-5,"year").format("YYYY-MM-DD HH:mm:ss"),EndTime:m().format("YYYY-MM-DD HH:mm:ss")});i===200?(b(l),v(E(l,"specialTrain"))):x.error(u);const F=await y("/api/Dict/GetDict_TrainType");P(F.data)})()},[]);const R=e=>{o(e)},w=e=>{C(e)},Y=async()=>{const{code:e,data:i,msg:l}=await y("/api/VRRePort/GetCompositeReport",{StartTime:d.format("YYYY-MM-DD"),EndTime:f.format("YYYY-MM-DD")});e===200?(b(i),v(E(i,"specialTrain"))):x.success(l,3)},B=()=>{S(!0),setTimeout(()=>{Z("训练报告",n.current),S(!1)},0)};return s.jsxs(G,{theme:p,children:[s.jsxs("div",{className:"topsearch",children:[s.jsxs("div",{className:"left",children:[s.jsxs("div",{className:"startDate",children:[s.jsx("span",{className:"label",children:"开 始: "}),s.jsx(D,{className:"date",value:d,onChange:R})]}),s.jsxs("div",{className:"endDate",children:[s.jsx("span",{className:"label",children:"结 束: "}),s.jsx(D,{className:"date",value:f,onChange:w})]})]}),s.jsxs("div",{className:"right",children:[s.jsx(k,{className:"space",onClick:Y,children:"搜索"}),s.jsx(k,{onClick:B,children:"导出"})]})]}),a&&s.jsxs("div",{className:`teamReport ${_?"isprint":""}`,ref:n,children:[s.jsx("p",{className:"title",children:"团体报告"}),s.jsx(h,{title:"基本信息"}),s.jsxs("div",{className:"basicInfo",children:[s.jsx("span",{children:"训练日期"}),s.jsx("span",{children:a.trainDate}),s.jsx("span",{children:"训练人数"}),s.jsx("span",{children:a.trainCount})]}),s.jsx(h,{title:"专项训练数据"}),A&&A.map((e,i)=>s.jsx(t.Fragment,{children:e[0]&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"trainType",children:r&&r[e[0].trainType]}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"名次"}),s.jsx("span",{children:"账号"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"训练次数"}),s.jsx("span",{children:"平均成绩"})]}),e.length>0?e.map((l,u)=>s.jsxs("li",{children:[s.jsx("span",{children:l.rank}),s.jsx("span",{children:l.pNum}),s.jsx("span",{children:l.pName}),s.jsx("span",{children:l.trainCount}),s.jsx("span",{children:l.totalScoreAvg.toFixed(2)})]},u)):s.jsx("li",{className:"empty",children:"暂无数据"})]})]})},i)),s.jsx(h,{title:r&&r[2.1]}),s.jsx("p",{className:"trainType",children:"综合训练数据"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"名次"}),s.jsx("span",{children:"账号"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"训练次数"}),s.jsx("span",{children:"平均成绩"})]}),c(a.advancedTrain2_1)?a.advancedTrain2_1.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.rank}),s.jsx("span",{children:e.pNum}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:e.trainCount}),s.jsx("span",{children:e.totalScoreAvg})]},e.rank)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx("p",{className:"trainType",children:"心理应激状态排行"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"TOP5"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"情绪稳定性"}),s.jsx("span",{children:"脑力应激"}),s.jsx("span",{children:"专注度"}),s.jsx("span",{children:"疲劳度"}),s.jsx("span",{children:"兴奋度"})]}),c(a.mind2_1)?a.mind2_1.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.top5}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:T(e.pJinZhang)}),s.jsx("span",{children:g(e.pCognitiveStress)}),s.jsx("span",{children:N(e.pFocusState)}),s.jsx("span",{children:j(e.pEnergyState)}),s.jsx("span",{children:j(e.pFocusState)})]},e.top5)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx("p",{className:"trainType",children:"科目任务排行"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"TOP5"}),s.jsx("span",{children:"时空估计"}),s.jsx("span",{children:"视觉检索"}),s.jsx("span",{children:"空间知觉"}),s.jsx("span",{children:"注意反应"}),s.jsx("span",{children:"注意力分配"}),s.jsx("span",{children:"手眼脑协调"}),s.jsx("span",{children:"工作记忆"}),s.jsx("span",{children:"注意广度"})]}),c(a.subjectTask2_1)?a.subjectTask2_1.map((e,i)=>s.jsxs("li",{children:[s.jsx("span",{children:i+1}),s.jsx("span",{children:e.t01SpaceTimeAbility}),s.jsx("span",{children:e.t02VisualRetrievalAbility}),s.jsx("span",{children:e.t03SpatialPerceptionAbility}),s.jsx("span",{children:e.t04AttentionResponseAbility}),s.jsx("span",{children:e.t05AttentionDistributionAbility}),s.jsx("span",{children:e.t06HandEyeBrainCoordination}),s.jsx("span",{children:e.t07WorkingMemoryAbility}),s.jsx("span",{children:e.t08AttentionApanAbility})]},i)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx(h,{title:r&&r[2.2]}),s.jsx("p",{className:"trainType",children:"综合训练数据"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"名次"}),s.jsx("span",{children:"账号"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"训练次数"}),s.jsx("span",{children:"平均总成绩"})]}),c(a.advancedTrain2_2)?a.advancedTrain2_2.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.rank}),s.jsx("span",{children:e.pNum}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:e.trainCount}),s.jsx("span",{children:e.totalScoreAvg})]},e.rank)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx("p",{className:"trainType",children:"心理应激状态排行"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"TOP5"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"情绪稳定性"}),s.jsx("span",{children:"脑力应激"}),s.jsx("span",{children:"专注度"}),s.jsx("span",{children:"疲劳度"}),s.jsx("span",{children:"兴奋度"})]}),c(a.mind2_2)?a.mind2_2.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.top5}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:T(e.pJinZhang)}),s.jsx("span",{children:g(e.pCognitiveStress)}),s.jsx("span",{children:N(e.pFocusState)}),s.jsx("span",{children:j(e.pEnergyState)}),s.jsx("span",{children:j(e.pFocusState)})]},e.top5)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx("p",{className:"trainType",children:"科目任务排行"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"TOP5"}),s.jsx("span",{children:"时空估计"}),s.jsx("span",{children:"视觉检索"}),s.jsx("span",{children:"空间知觉"}),s.jsx("span",{children:"注意反应"}),s.jsx("span",{children:"注意力分配"}),s.jsx("span",{children:"手眼脑协调"}),s.jsx("span",{children:"工作记忆"}),s.jsx("span",{children:"注意广度"})]}),c(a.subjectTask2_2)?a.subjectTask2_2.map((e,i)=>s.jsxs("li",{children:[s.jsx("span",{children:i+1}),s.jsx("span",{children:e.t01SpaceTimeAbility}),s.jsx("span",{children:e.t02VisualRetrievalAbility}),s.jsx("span",{children:e.t03SpatialPerceptionAbility}),s.jsx("span",{children:e.t04AttentionResponseAbility}),s.jsx("span",{children:e.t05AttentionDistributionAbility}),s.jsx("span",{children:e.t06HandEyeBrainCoordination}),s.jsx("span",{children:e.t07WorkingMemoryAbility}),s.jsx("span",{children:e.t08AttentionApanAbility})]},i)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx(h,{title:r&&r[2.3]}),s.jsx("p",{className:"trainType",children:"综合训练数据"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"名次"}),s.jsx("span",{children:"账号"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"训练次数"}),s.jsx("span",{children:"平均总成绩"})]}),c(a.advancedTrain2_3)?a.advancedTrain2_3.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.rank}),s.jsx("span",{children:e.pNum}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:e.trainCount}),s.jsx("span",{children:e.totalScoreAvg})]},e.rank)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx("p",{className:"trainType",children:"心理应激状态排行"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"TOP5"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"情绪稳定性"}),s.jsx("span",{children:"脑力应激"}),s.jsx("span",{children:"专注度"}),s.jsx("span",{children:"疲劳度"}),s.jsx("span",{children:"兴奋度"})]}),c(a.mind2_3)?a.mind2_3.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.top5}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:T(e.pJinZhang)}),s.jsx("span",{children:g(e.pCognitiveStress)}),s.jsx("span",{children:N(e.pFocusState)}),s.jsx("span",{children:j(e.pEnergyState)}),s.jsx("span",{children:j(e.pFocusState)})]},e.top5)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx("p",{className:"trainType",children:"科目任务排行"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"TOP5"}),s.jsx("span",{children:"时空估计"}),s.jsx("span",{children:"视觉检索"}),s.jsx("span",{children:"空间知觉"}),s.jsx("span",{children:"注意反应"}),s.jsx("span",{children:"注意力分配"}),s.jsx("span",{children:"手眼脑协调"}),s.jsx("span",{children:"工作记忆"}),s.jsx("span",{children:"注意广度"})]}),c(a.subjectTask2_3)?a.subjectTask2_3.map((e,i)=>s.jsxs("li",{children:[s.jsx("span",{children:i+1}),s.jsx("span",{children:e.t01SpaceTimeAbility}),s.jsx("span",{children:e.t02VisualRetrievalAbility}),s.jsx("span",{children:e.t03SpatialPerceptionAbility}),s.jsx("span",{children:e.t04AttentionResponseAbility}),s.jsx("span",{children:e.t05AttentionDistributionAbility}),s.jsx("span",{children:e.t06HandEyeBrainCoordination}),s.jsx("span",{children:e.t07WorkingMemoryAbility}),s.jsx("span",{children:e.t08AttentionApanAbility})]},i)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx(h,{title:r&&r[2.4]}),s.jsx("p",{className:"trainType",children:"综合训练数据"}),s.jsxs("ul",{className:"spaceTimeEstimate",children:[s.jsxs("li",{className:"title",children:[s.jsx("span",{children:"名次"}),s.jsx("span",{children:"日期"}),s.jsx("span",{children:"开始时间"}),s.jsx("span",{children:"结束时间"}),s.jsx("span",{children:"编号"}),s.jsx("span",{children:"姓名"}),s.jsx("span",{children:"总题目数"}),s.jsx("span",{children:"总成绩"})]}),c(a.advancedTrain2_4)?a.advancedTrain2_4.map(e=>s.jsxs("li",{children:[s.jsx("span",{children:e.rank}),s.jsx("span",{children:e.startTime.split(" ")[0]}),s.jsx("span",{children:e.startTime.split(" ")[1]}),s.jsx("span",{children:e.endTime.split(" ")[1]}),s.jsx("span",{children:e.pNum}),s.jsx("span",{children:e.pName}),s.jsx("span",{children:e.totalSubCount}),s.jsx("span",{children:e.totalScore})]},e.rank)):s.jsx("li",{className:"empty",children:"暂无数据"})]}),s.jsx(h,{title:"训练状态及成绩分布图"}),s.jsxs("div",{className:"charts",children:[s.jsx("div",{className:"leftpie",children:a.train&&s.jsx($,{option:H(I(a.train),"训练状态类型饼图")})}),s.jsx("div",{className:"rightbar",children:a.totalScoreDistribution&&s.jsx(J,{option:L(JSON.parse(a.totalScoreDistribution),["80-100","60-80","40-60","20-40","0-20"],"总成绩分布情况")})})]})]})]})});W.displayName="VRTeam";export{W as default};
