import{r as m,m as E,_ as z,p as $,A as q,t as G,F as b,u as U,d as u,j as e,S,D as R,a as V,B as A,R as Q,h as ue,g as I,n as me,b as ge,o as he,q as fe,v as xe,f as W,I as Te,w as we,x as Se}from"./index-CKIL6d0V.js";import{O as ke}from"./index-DS0KBckH.js";import{R as je}from"./index-CQHEr9cF.js";import{R as be}from"./FileAddOutlined-DZJhsTo4.js";import{F as ye}from"./Table-BaVi_066.js";import{R as ve}from"./MoreOutlined-D6hW6YIc.js";import{R as Ne}from"./DeleteOutlined-BHDTCKcb.js";import"./index-C-LPyJas.js";import"./iconUtil-Co5gbObL.js";var Ie={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},Ye=function(f,h){return m.createElement(E,z({},f,{ref:h,icon:Ie}))},Oe=m.forwardRef(Ye),Ce={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"}},{tag:"path",attrs:{d:"M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7a321 321 0 01-44.5 55.7 317.17 317.17 0 01-101.3 68.3c-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3a321 321 0 0144.5 55.7c3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8a9.18 9.18 0 00-8.2-13.3z"}}]},name:"field-time",theme:"outlined"},Me=function(f,h){return m.createElement(E,z({},f,{ref:h,icon:Ce}))},H=m.forwardRef(Me),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M666.7 505.5l-246-178A8 8 0 00408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"right-circle",theme:"outlined"},De=function(f,h){return m.createElement(E,z({},f,{ref:h,icon:Fe}))},Ee=m.forwardRef(De),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z"}}]},name:"smile",theme:"outlined"},Pe=function(f,h){return m.createElement(E,z({},f,{ref:h,icon:ze}))},Re=m.forwardRef(Pe);const Ae=$.div`
  height: 100%;
`,$e=$.div`
  height: 100%;
  display: flex;
  flex-direction: column;
  .topSearch {
    padding: 10px 30px 0;
    margin-bottom: 20px;
    border-radius: 6px;
    background-color: ${l=>l.theme.colorBgContainer};
    .ant-form {
      display: flex;
      align-items: center;
      .ant-form-item {
        width: 240px;
        margin-right: 50px;
        margin-bottom: 10px;
        &:nth-last-child(1) {
          width: 300px;
        }
        &:nth-child(1) {
          width: 240px;
        }
        &:nth-last-child(2) {
          width: 180px;
        }
        &:nth-last-child(1) {
          flex: 1;
          display: flex;
          justify-content: flex-end;
        }
        &:nth-last-child(3) {
          width: 180px;
          margin-right: 8px;
        }
        .ant-form-item-label > label {
          font-size: 14px;
        }
      }
    }
    .userTitle {
      height: 100%;
      line-height: 60px;
      font-size: 18px;
      letter-spacing: 2px;
      .word {
        margin-left: 10px;
      }
    }
  }

  .tableList {
    flex: 1;
    height: 0;
    display: flex;
    .leftOrganization {
      width: 220px;
      height: 100%;
      margin-right: 16px;
      border-radius: 6px;
      background-color: ${l=>l.theme.colorBgContainer};
    }
    .rightTable {
      flex: 1;
      padding: 16px;
      overflow: hidden;
      border-radius: 6px;
      background-color: ${l=>l.theme.colorBgContainer};
      .tableBox {
        height: 100%;
        overflow: hidden;
      }
    }
  }
`,_=m.memo(()=>{const{message:l,modal:f}=q.useApp(),{token:h}=G.useToken(),[y]=b.useForm(),c=U(),[d,Y]=m.useState([]),[C,M]=m.useState([]),[O,v]=m.useState([]),[P,k]=m.useState(0),[N,F]=m.useState(""),[D,T]=m.useState(!1),[s,t]=m.useState(!1),[i,o]=m.useState(null),[x,B]=m.useState(null);m.useEffect(()=>{const n={pageIndex:1,pageSize:50,IsFinish:-1,StartTime:u().add(-1,"y").format("YYYY-MM-DD"),EndTime:u().startOf("day").format("YYYY-MM-DD")};T(!0),(async()=>{try{const{code:a,data:p,msg:g}=await I("/api/PsyInfotesttasklist/GetTaskList",n);a===200?(v(p.items),k(p.totalRecords),T(!1)):l.warning(g);const w=await I("/api/PsyTaskName/All",{pageIndex:1,pageSize:9999});if(w.code===200){const j=w.data.items.map(L=>({label:L.ptaskname,value:L.ptaskname}));Y(j),M(j)}else l.warning(w.msg)}catch(a){l.error(a)}})()},[l]);const K=async n=>{if(D)return;const r={orgunitsid:N,TaskType:n.TaskType,pageIndex:1,pageSize:50};if(N||delete r.orgunitsid,n.StartTime&&(r.StartTime=u(n.StartTime).format("YYYY-MM-DD")),n.EndTime&&(r.EndTime=u(n.EndTime).format("YYYY-MM-DD")),u(n.StartTime).valueOf()>u(n.EndTime).valueOf()){l.warning("开始时间大于结束时间, 请重新选择");return}r.IsFinish=n.IsFinish,n.pTaskName&&(r.pTaskName=n.pTaskName),T(!0);try{const{code:a,data:p,msg:g}=await I("/api/PsyInfotesttasklist/GetTaskList",r);a===200?(v(p.items),k(p.totalRecords)):l.warning(g)}catch(a){l.error(a)}finally{T(!1)}},Z=[{title:"序 号",dataIndex:"index",width:60,align:"center",render:(n,r,a)=>e.jsx(e.Fragment,{children:a+1})},{title:"任务名称",dataIndex:"pTaskName",align:"center",render:n=>e.jsx(e.Fragment,{children:n})},{title:"开始日期",dataIndex:"startTime",align:"center",render:n=>e.jsx(e.Fragment,{children:u(n).format("YYYY-MM-DD")})},{title:"结束日期",dataIndex:"endTime",ellipsis:!0,align:"center",render:n=>e.jsx(e.Fragment,{children:u(n).format("YYYY-MM-DD")})},{title:"测评类型",dataIndex:"taskType",align:"center",render:n=>e.jsx(e.Fragment,{children:X(n)})},{title:"人员数量",dataIndex:"pNumCount",align:"center",render:n=>e.jsx(e.Fragment,{children:n})},{title:"量表数量",dataIndex:"tableCodeCount",align:"center",render:n=>e.jsx(e.Fragment,{children:n})},{title:"测评进度",dataIndex:"pTaskNameId",align:"center",key:"pTaskNameId",render:(n,r)=>e.jsx(e.Fragment,{children:e.jsx(me,{size:[100,16],format:a=>e.jsxs("span",{children:[Number.isInteger(a)?a:a.toFixed(1),"%"]}),percent:r.isFinish/r.isFinishcount*100})})},{title:"操 作",dataIndex:"pTasknameId",width:200,align:"center",render:(n,r)=>e.jsxs(V,{size:"middle",style:{color:h.colorPrimaryText},children:[e.jsxs("span",{style:{cursor:"pointer"},onClick:()=>le(r),children:[e.jsx(ge,{})," 编辑"]}),e.jsx(he,{placement:"bottom",arrow:!0,menu:{items:ee,onClick:a=>se(a,r)},children:e.jsxs("span",{style:{cursor:"pointer"},children:["更 多",e.jsx(ve,{})]})})]})}],X=n=>{switch(Number(n)){case 1:return" 个测";case 2:return" 普测";case 0:return" 其他";default:return""}},ee=[{label:e.jsx("span",{children:"延期"}),icon:e.jsx(H,{}),key:"1"},{type:"divider"},{label:e.jsx("span",{children:"删除"}),icon:e.jsx(Ne,{}),key:"2"},{type:"divider"},{label:e.jsx("span",{children:"导出"}),icon:e.jsx(Oe,{}),key:"3"}],se=({key:n},r)=>{switch(n){case"1":t(!0),B(r);break;case"2":f.confirm({title:"温馨提示",content:"确定删除吗?",okText:"删除",onOk(){f.confirm({title:"再次提示",content:"该操作不可逆,请确认删除",okText:"确定",onOk(){pe(r.pTasknameId)}})}});break;case"3":re(r.pTaskName);break}},te=(n,r)=>{o(r)},ne=()=>{console.log(i,x),t(!1)},ae=n=>{const r=[];C.forEach(a=>{a.value.includes(n)&&r.push(a)}),Y(r)},re=n=>{const r={pTaskName:n,StartTime:"1970-01-01",EndTime:"2099-12-30"},a=`量表任务完成情况${u().format("YYYY年MM月DD日HH时mm分ss秒")}.xlsx`;fe("/api/PsyInfotesttasklist/ExportExcel",r).then(p=>{if("msSaveOrOpenBlob"in navigator){let g=new Blob([p]);window.navigator.msSaveOrOpenBlob(g,a)}else{let g=new Blob([p],{type:"application/vnd.ms-excel"}),w=URL.createObjectURL(g),j=document.createElement("a");j.setAttribute("href",w),j.setAttribute("download",a),j.click()}})},ie=()=>{c("/layout/psyTasksAdd")},le=n=>{c("/layout/psyTasksEdit",{state:n})},oe=n=>{F(n),ce(n)},ce=async(n="")=>{const r=y.getFieldValue(),a={orgunitsid:n,IsFinish:r.IsFinish,TaskType:r.TaskType,pTaskName:r.pTaskName,pageIndex:1,pageSize:50};if(r.StartTime&&(a.StartTime=u(r.StartTime).format("YYYY-MM-DD")),r.EndTime&&(a.EndTime=u(r.EndTime).format("YYYY-MM-DD")),u(r.StartTime).valueOf()>u(r.EndTime).valueOf()){l.warning("开始时间大于结束时间, 请重新选择");return}a.orgunitsid||(F(""),delete a.orgunitsid),a.pTaskName||delete a.pTaskName,T(!0);try{const{code:p,data:g,msg:w}=await I("/api/PsyInfotesttasklist/GetTaskList",a);p===200?(v(g.items),k(g.totalRecords)):l.warning(w)}catch(p){l.error(p)}finally{T(!1)}},de=async(n,r)=>{const a=y.getFieldValue(),p={orgunitsid:N,TaskType:a.TaskType,pageIndex:n,pageSize:r};if(N||delete p.orgunitsid,a.StartTime&&(p.StartTime=u(a.StartTime).format("YYYY-MM-DD")),a.EndTime&&(p.EndTime=u(a.EndTime).format("YYYY-MM-DD")),u(a.StartTime).valueOf()>u(a.EndTime).valueOf()){l.warning("开始时间大于结束时间, 请重新选择");return}p.IsFinish=a.IsFinish,a.pTaskName&&(p.pTaskName=a.pTaskName),T(!0);try{const{code:g,data:w,msg:j}=await I("/api/PsyInfotesttasklist/GetTaskList",p);g===200?(v(w.items),k(w.totalRecords)):l.warning(j)}catch(g){l.error(g)}finally{T(!1)}},pe=async n=>{try{const r=await xe("/api/PsyTaskName/DelTaskName",{},{ptasknameid:n});if(r.code===200){l.success("删除成功",4);const a=y.getFieldValue(),p={orgunitsid:N,pageIndex:1,pageSize:50};if(p.IsFinish=a.IsFinish,p.TaskType=a.TaskType,a.pTaskName&&(p.pTaskName=a.pTaskName),a.StartTime&&(p.StartTime=u(a.StartTime).format("YYYY-MM-DD")),a.EndTime&&(p.EndTime=u(a.EndTime).format("YYYY-MM-DD")),u(a.StartTime).valueOf()>u(a.EndTime).valueOf()){l.warning("开始时间大于结束时间, 请重新选择");return}p.orgunitsid||delete p.orgunitsid,T(!0);const g=await I("/api/PsyInfotesttasklist/GetTaskList",p);g.code===200?(v(g.data.items),k(g.data.totalRecords)):l.error(g.msg,3),T(!1)}else l.error(r.msg,4)}catch(r){l.error(r)}};return e.jsxs($e,{theme:h,children:[e.jsx("div",{className:"topSearch",children:e.jsxs(b,{form:y,layout:"inline",onFinish:K,initialValues:{pTaskName:"",IsFinish:"-1",TaskType:0,StartTime:null,endTime:null},children:[e.jsx(b.Item,{label:"任务名称: ",name:"pTaskName",children:e.jsx(je,{options:d,allowClear:!0,placeholder:"请输入任务名称",onChange:ae})}),e.jsx(b.Item,{label:"完成状态: ",name:"IsFinish",children:e.jsxs(S,{children:[e.jsx(S.Option,{value:"-1",children:"所有"}),e.jsx(S.Option,{value:"1",children:"已完成"}),e.jsx(S.Option,{value:"0",children:"未开始"}),e.jsx(S.Option,{value:"2",children:"未完成"})]})}),e.jsx(b.Item,{label:"测评类型: ",name:"TaskType",children:e.jsxs(S,{children:[e.jsx(S.Option,{value:0,children:"其他"}),e.jsx(S.Option,{value:1,children:"个测"}),e.jsx(S.Option,{value:2,children:"普测"})]})}),e.jsx(b.Item,{label:"开始 : ",name:"StartTime",children:e.jsx(R,{})}),e.jsx(b.Item,{label:" 至 : ",name:"EndTime",children:e.jsx(R,{})}),e.jsx(b.Item,{children:e.jsxs(V,{children:[e.jsxs(A,{type:"primary",htmlType:"submit",children:[e.jsx(Q,{}),"搜 索"]}),e.jsxs(A,{onClick:ie,children:[e.jsx(be,{}),"新建测评"]})]})})]})}),e.jsxs("div",{className:"tableList",children:[e.jsx("div",{className:"leftOrganization",children:e.jsx(ke,{onSelectOrg:oe})}),e.jsx("div",{className:"rightTable",children:e.jsx("div",{className:"tableBox",children:O&&e.jsx(ye,{rowKey:n=>n.pTasknameId,columns:Z,dataSource:O,size:"small",sticky:!0,loading:D,pagination:{total:P,showSizeChanger:!0,showQuickJumper:!0,onChange:de,defaultPageSize:50,showTotal:n=>`共 ${n} 条`}})})})]}),e.jsx(ue,{text:e.jsxs("span",{style:{fontSize:"24px"},children:[e.jsx(H,{}),"  延 期"]}),open:s,onOk:ne,onCancel:()=>{t(!1),B(null)},children:e.jsxs("div",{style:{padding:"16px"},children:[e.jsx("span",{children:"延长日期至 : "})," ",e.jsx(R,{style:{width:"60%"},onChange:te,disabledDate:n=>n&&n<u(x.endTime).startOf("day")})]})})]})});_.displayName="PSYTaskPC";const Be=$.div`
  height: 100%;
  display: flex;
  flex-direction: column;
  .userTitle {
    height: 60px;
    line-height: 60px;
    font-size: 18px;
    letter-spacing: 2px;
    border-radius: 6px;
    padding: 0 16px;
    margin-bottom: 16px;
    background-color: ${l=>l.theme.colorBgContainer};
    .word {
      margin-left: 10px;
    }
  }
  .cards {
    flex: 1;
    height: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    overflow: auto;
    .card {
      width: 250px;
      border-radius: 6px;
      border: 1px solid ${l=>l.theme.colorBorder};
      background-color: ${l=>l.theme.colorBgContainer};

      margin-bottom: 10px;

      .cardTitle {
        padding: 5px 0;
        font-size: 18px;
        text-align: center;

        .english {
          line-height: 16px;
          font-size: 14px;
        }
      }

      .questionNum {
        padding: 5px 0;
        text-align: center;
        > span {
          margin-left: 10px;
          font-size: 24px;
        }
      }

      .lists {
        padding: 10px 0;
        li {
          height: 36px;
          padding-left: 10px;
          display: flex;
          align-items: center;
          border-bottom: 1px dashed ${l=>l.theme.colorBorder};
          span {
            &:nth-child(1) {
              width: 80px;
            }
            &:nth-child(2) {
              flex: 1;
            }
          }

          .date {
            font-size: 12px;
            margin-left: 5px;
            overflow: hidden;
          }

          .answerValue {
            margin-left: 15px;
          }
        }
      }

      .answer {
        padding: 10px 0;
        text-align: center;
      }
    }
  }
`,J=m.memo(()=>{const l=U(),{token:f}=G.useToken(),{modal:h}=q.useApp(),{userInfo:{userID:y},changeCurrentQuestion:c,changeAnswerList:d,changeAnswerTime:Y}=W(s=>s),[C,M]=m.useState(null),[O,v]=m.useState(""),[P,k]=m.useState(!1);m.useEffect(()=>{const s={PNum:y,pageIndex:1,pageSize:9999,IsFinish:-2};(async()=>{k(!0);try{const{code:i,data:o}=await I("/api/PsyInfotesttasklist/All",s);i===200?(k(!1),M(o.items.filter(x=>x.isFinish!==1))):M(null)}catch(i){console.log(i)}})()},[y]);const N=s=>{let t="未知";switch(s){case 0:t="未开始";break;case 1:t="已完成";break;case 2:t="未完成";break;default:t="未知";break}return t},F=s=>{const t=u().valueOf(),i=u(s.startTime).valueOf(),o=u(s.endTime).valueOf();t<i?h.confirm({title:"温馨提示",content:"非答题时间，请在开始时间内答题！"}):t>o?h.confirm({title:"温馨提示",content:"已超过答题时间，请联系管理员！"}):(l("/layout/psyTasksAnswer",{state:s}),D(s))},D=s=>{switch(s.consumeTime?Y(s.consumeTime):Y("00:00:00"),s.tableCode){case"Adhd":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Cbcl2to3":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|"),i=s.answerString.split("@@")[0].split("|").map(o=>Number(o));c(t.length),d(i)}else d([]),c(0);return;case"Cgi":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Cmi":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Embu":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(x=>Number(x)),o=t%2===0?t/2:(t-1)/2;c(o),d(i)}else d([]),c(0);return;case"Epps":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Group":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map((o,x)=>x===37?o:Number(o));c(t),d(i)}else d([]),c(0);return;case"Issi":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|").length,i=s.answerString.split("@@")[0].split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Lsas":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(x=>Number(x)),o=t%2===0?t/2:(t-1)/2;c(o),d(i)}else d([]),c(0);return;case"Mast":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|").length,i=s.answerString.split("@@")[0].split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Psqi":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|").length,i=s.answerString.split("@@")[0].split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Shirritant":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|").length,i=s.answerString.split("@@")[0].split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Tess":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|").length,i=t%2===0?t/2:(t-1)/2,o=s.answerString.split("@@")[0].split("|").map(x=>Number(x));c(i),d(o)}else d([]),c(0);return;case"Upi":if(s.answerString&&s.answerString.includes("@@")){const t=s.answerString.split("@@")[0].split("|").length,i=s.answerString.split("@@")[0].split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Whoqol":if(s.answerString&&s.answerString.includes("|0@@")){const t=s.answerString.split("|0@@")[0].split("|").length,i=s.answerString.split("|0@@")[0].split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return;case"Yffs":if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(x=>Number(x)),o=t%2===0?t/2:(t-1)/2;c(o),d(i)}else d([]),c(0);return;case"Zyqx":return;default:if(s.answerString){const t=s.answerString.split("|").length,i=s.answerString.split("|").map(o=>Number(o));c(t),d(i)}else d([]),c(0);return}},T=()=>C?C.filter(s=>s.nameChinese.includes(O)||s.tableCode.includes(O)).map(s=>e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"cardTitle",children:[e.jsx("p",{className:"text-nowrap",title:s.nameChinese,children:s.nameChinese}),e.jsxs("p",{className:"english",children:["(",s.tableCode,")"]})]}),e.jsxs("div",{className:"questionNum",children:["题目数 :",e.jsx("span",{children:s.questionSum})]}),e.jsxs("ul",{className:"lists",children:[e.jsxs("li",{children:[e.jsx("span",{children:"任务名称 : "}),e.jsx("span",{className:"answerValue text-nowrap",title:s.ptaskname,children:s.ptaskname})]}),e.jsxs("li",{children:[e.jsx("span",{children:"开始时间 : "}),e.jsx("span",{className:"answerValue",children:u(s.startTime).format("YYYY-MM-DD")})]}),e.jsxs("li",{children:[e.jsx("span",{children:"结束时间 : "}),e.jsx("span",{className:"answerValue",children:u(s.endTime).format("YYYY-MM-DD")})]}),e.jsxs("li",{children:[e.jsx("span",{children:"完成情况 : "}),e.jsx("span",{className:"answerValue",children:N(s.isFinish)})]})]}),e.jsx("div",{className:"answer",children:e.jsxs(A,{type:"primary",onClick:()=>F(s),children:["答题",e.jsx(Ee,{})]})})]},s.id)):e.jsx(Se,{icon:e.jsx(Re,{}),title:"恭喜您已经完成所有的测评!"});return e.jsxs(Be,{theme:f,children:[e.jsx("div",{className:"userTitle",children:e.jsx(Te,{prefix:e.jsx(Q,{}),placeholder:"输入量表名称或编号查找",variant:"filled",onPressEnter:s=>v(s.target.value)})}),e.jsx("div",{className:"cards",children:P?e.jsx(we,{}):T()})]})});J.displayName="PSYTaskMobile";const Le=m.memo(()=>{const{isPC:l,userInfo:f}=W(h=>h);return e.jsx(Ae,{children:l===1&&f.isAdmin!==0?e.jsx(_,{}):e.jsx(J,{})})});Le.displayName="PSYTask";export{Le as default};
