import{d as R,r as l,t as E,A as $,a as h,j as e,D as N,B as v,g as D}from"./index-BtzNP73w.js";import{P}from"./index-CYUf_agm.js";import{B as M}from"./index-CJeWDVq8.js";import{e as O,c as A}from"./chartsConfig-CLQzSBgN.js";import{O as I}from"./index-Bulw9wNg.js";import{d as z}from"./htmlToPdf-DfRLdXs-.js";import"./index-B6m4IotF.js";import"./iconUtil-D_WnT0lW.js";const H=R.div`
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  &::-webkit-scrollbar {
    display: none;
  }
  .leftorg {
    width: 220px;
    height: 100%;
    margin-right: 16px;
    background-color: ${s=>s.theme.colorBgContainer};
  }
  .rightreport {
    width: 800px;
    height: 100%;
    margin: auto;
    overflow: hidden;
    .topsearch {
      height: 60px;
      display: flex;
      padding-top: 10px;
      margin-bottom: 20px;
      background-color: ${s=>s.theme.colorBgContainer};
      .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;
        }
      }
    }
    .content {
      height: calc(100% - 80px);
      display: flex;
      justify-content: space-around;
      overflow: auto;
      /* .organ {
        width: 220px;
        height: 100%;
        margin-right: 16px;
        background-color: ${s=>s.theme.colorBgContainer};
      } */
      .report {
        width: 796px;
        overflow: auto;
      }

      .teamReport {
        padding: 10px;
        font-size: 16px;
        border: 1px solid ${s=>s.theme.colorBorder};
        > .title {
          font-size: 18px;
          text-align: center;
        }
        .basicInfo {
          height: 36px;
          line-height: 36px;
          display: flex;
          border: 1px solid ${s=>s.theme.colorBorder};
          span {
            flex: 1;
            text-align: center;
            border-right: 1px solid ${s=>s.theme.colorBorder};
            &:nth-child(2) {
              flex: 2;
            }
            &:nth-last-child(1) {
              border: none;
            }
          }
        }
        .trainType {
          line-height: 36px;
        }
        .spaceTimeEstimate {
          margin-bottom: 10px;
          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: 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 ${s=>s.theme.colorText};
    }
    .world {
      text-align: center;
      padding: 0 20px;
      height: 100%;
      line-height: 50px;
    }
  }
`,L=s=>{switch(s){case 1:return"轻";case 2:return"中";case 3:return"重";default:return""}},b=s=>{switch(s){case 1:return"低";case 2:return"中";case 3:return"高";default:return""}},F=s=>{switch(s){case 1:return"无";case 2:return"中";case 3:return"高";default:return""}},V=s=>{switch(s){case 1:return"比较稳定";case 2:return"小幅波动";case 3:return"大幅波动";default:return""}},m=s=>!!(Array.isArray(s)&&s.length>0),G=(s=[])=>{const o=[{value:0,name:"优秀型"},{value:0,name:"成长型"},{value:0,name:"失调型"},{value:0,name:"警示型"}];return JSON.parse(s).forEach((a,p)=>{o[p].value=a}),o},d=s=>{const{title:o}=s;return e.jsxs("div",{className:"dividerLine",children:[e.jsx("div",{className:"line"}),e.jsx("div",{className:"world",children:o}),e.jsx("div",{className:"line"})]})},J=s=>{const o=[{name:"时空估计能力",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"视觉检索能力",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"空间知觉能力",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"注意力反应速度",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"注意力分配能力",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"手眼脑协调能力",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"注意广度能力",top1:"",top2:"",top3:"",top4:"",top5:""},{name:"工作记忆能力",top1:"",top2:"",top3:"",top4:"",top5:""}],a=s.map(n=>{const i=[];for(const x in n)i.push(n[x]);return i});return o.map((n,i)=>(n.top1=a[0]?a[0][i]:"",n.top2=a[1]?a[1][i]:"",n.top3=a[2]?a[2][i]:"",n.top4=a[3]?a[3][i]:"",n.top5=a[4]?a[4][i]:"",n))},Q=l.memo(()=>{const s=l.useRef(null),{token:o}=E.useToken(),{message:a}=$.useApp(),[p,n]=l.useState(h().add(-5,"year")),[i,x]=l.useState(h()),[r,j]=l.useState({}),[w,g]=l.useState(!1),[u,y]=l.useState(0);l.useEffect(()=>{(async()=>{const{code:c,data:Y,msg:B}=await D("/api/DVReport/GetCompositeReportbyOrg",{QorganizeId:u,StartTime:h().add(-5,"year").format("YYYY-MM-DD HH:mm:ss"),EndTime:h().format("YYYY-MM-DD HH:mm:ss")});c===200?j(Y):a.error(B)})()},[]);const T=t=>{n(t)},S=t=>{x(t)},f=async t=>{D("/api/DVReport/GetCompositeReportbyOrg",{QorganizeId:t||t===0?t:u,StartTime:p.format("YYYY-MM-DD"),EndTime:i.format("YYYY-MM-DD")}).then(c=>{c.code===200?j(c.data):a.success(c.msg,3)})},k=()=>{g(!0),setTimeout(()=>{z("训练报告",s.current),g(!1)},0)},C=t=>{y(t),f(t)};return e.jsxs(H,{theme:o,children:[e.jsx("div",{className:"leftorg",children:e.jsx(I,{onSelectOrg:C})}),e.jsxs("div",{className:"rightreport",children:[e.jsxs("div",{className:"topsearch",children:[e.jsxs("div",{className:"left",children:[e.jsxs("div",{className:"startDate",children:[e.jsx("span",{className:"label",children:"开 始: "}),e.jsx(N,{className:"date",value:p,onChange:T})]}),e.jsxs("div",{className:"endDate",children:[e.jsx("span",{className:"label",children:"结 束: "}),e.jsx(N,{className:"date",value:i,onChange:S})]})]}),e.jsxs("div",{className:"right",children:[e.jsx(v,{className:"space",onClick:f,children:"搜索"}),e.jsx(v,{onClick:k,children:"导出"})]})]}),e.jsx("div",{className:"content",children:e.jsx("div",{className:"report",children:r&&e.jsxs("div",{className:`teamReport ${w?"isprint":""}`,ref:s,children:[e.jsx("p",{className:"title",children:"团体报告"}),e.jsx(d,{title:"基本信息"}),e.jsxs("div",{className:"basicInfo",children:[e.jsx("span",{children:"训练日期"}),e.jsx("span",{children:r.trainDate}),e.jsx("span",{children:"训练人数"}),e.jsx("span",{children:r.trainCount})]}),e.jsx(d,{title:"总体数据"}),e.jsxs("ul",{className:"spaceTimeEstimate",children:[e.jsxs("li",{className:"title",children:[e.jsx("span",{children:"top10"}),e.jsx("span",{className:"special",children:"开始时间"}),e.jsx("span",{className:"special",children:"结束时间"}),e.jsx("span",{children:"编号"}),e.jsx("span",{children:"姓名"}),e.jsx("span",{children:"总成绩"})]}),m(r.grid)?r.grid.map(t=>e.jsxs("li",{children:[e.jsx("span",{children:t.ranking}),e.jsx("span",{className:"special",children:t.startTime}),e.jsx("span",{className:"special",children:t.endTime}),e.jsx("span",{className:"text-nowrap",children:t.pNum}),e.jsx("span",{className:"text-nowrap",children:t.pName}),e.jsx("span",{children:t.totalScore})]},t.ranking)):e.jsx("li",{className:"empty",children:"暂无数据"})]}),e.jsx(d,{title:"训练状态及成绩分布图"}),e.jsxs("div",{className:"charts",children:[e.jsx("div",{className:"leftpie",children:r.train&&e.jsx(P,{option:O(G(r.train),"训练状态类型饼图")})}),e.jsx("div",{className:"rightbar",children:r.totalScoreDistribution&&e.jsx(M,{option:A(JSON.parse(r.totalScoreDistribution),["80-100","60-80","40-60","20-40","0-20"],"总成绩分布情况")})})]}),e.jsx(d,{title:"身心状态排行"}),e.jsxs("ul",{className:"spaceTimeEstimate",children:[e.jsxs("li",{className:"title",children:[e.jsx("span",{children:"TOP5"}),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.jsx("span",{children:"兴奋度"})]}),m(r.mind)?r.mind.map(t=>e.jsxs("li",{children:[e.jsx("span",{children:t.top5}),e.jsx("span",{className:"text-nowrap",children:t.pName}),e.jsx("span",{children:t.psyScore}),e.jsx("span",{children:V(t.jinZhang)}),e.jsx("span",{children:F(t.cognitiveStress)}),e.jsx("span",{children:L(t.focusState)}),e.jsx("span",{children:b(t.fatigue)}),e.jsx("span",{children:b(t.energyState)})]},t.top5)):e.jsx("li",{className:"empty",children:"暂无数据"})]}),e.jsx(d,{title:"心理科目排行"}),e.jsxs("ul",{className:"spaceTimeEstimate",children:[e.jsxs("li",{className:"title",children:[e.jsx("span",{children:"心理科目排行"}),e.jsx("span",{children:"Top1"}),e.jsx("span",{children:"Top2"}),e.jsx("span",{children:"Top3"}),e.jsx("span",{children:"Top4"}),e.jsx("span",{children:"Top5"})]}),m(r.subjectTask)?J(r.subjectTask).map((t,c)=>e.jsxs("li",{children:[e.jsx("span",{children:t.name}),e.jsx("span",{className:"text-nowrap",children:t.top1}),e.jsx("span",{className:"text-nowrap",children:t.top2}),e.jsx("span",{className:"text-nowrap",children:t.top3}),e.jsx("span",{className:"text-nowrap",children:t.top4}),e.jsx("span",{className:"text-nowrap",children:t.top5})]},c)):e.jsx("li",{className:"empty",children:"暂无数据"})]})]})})})]})]})});Q.displayName="DarkTeamReport";export{Q as default};
