import{s as n}from"./index.module-eed6ff4d-1743496079034.js";import{o as z,p as K}from"./api-d57212df-1743496079034.js";import{d as A,a as x,b as _,r as g,e as k,a5 as Q,q as S,f as e,N as q,aO as X,aP as T,g as y,h as M,ac as E,x as N,j as I,k as d,l as L,m as Y,a9 as Z,w as C,aj as w,y as J,aU as ee,aT as ae,t as te,v as B}from"./index-32ff339b-1743496079034.js";import{C as se}from"./index-4b28fbc5-1743496079034.js";import{d as W}from"./teacherIcon-b8e3946d-1743496079034.js";import{m as ue,f as ne,P as le,E as re}from"./evaluationRecords-0e0c631d-1743496079034.js";import{s as o}from"./index.module-e80d7fa2-1743496079034.js";import{a as ie,r as oe,b as de}from"./api-70305ea7-1743496079034.js";import{g as ce,c as me}from"./contants-fb27bec1-1743496079034.js";import{C as fe}from"./index-80138d53-1743496079034.js";import{P as pe}from"./index-2da90e33-1743496079034.js";import{C as ge}from"./index-17547037-1743496079034.js";import{g as U,a as G,b as ve}from"./icon-sort-asc-809a837a-1743496079034.js";import{t as he}from"./searchArray-fcbe278d-1743496079034.js";import{n as be,u as De,q as ye,W as Ie,C as Te}from"./index-e168b504-1743496079034.js";import{e as Ce}from"./contants-84ba384e-1743496079034.js";import{N as Fe}from"./Scrollbar-116ac88a-1743496079034.js";import{T as ke}from"./index-f645f05d-1743496079034.js";import{i as we,s as R,g as Ee,a as Be}from"./use-async-1a70e441-1743496079034.js";import"./useECharts-5af205b0-1743496079034.js";import"./index-e2ab6121-1743496079034.js";import"./urlUtils-b5855a3c-1743496079034.js";import"./catchData-e5072c59-1743496079034.js";import"./deep-clone-c0d00fc2-1743496079034.js";import"./index-f87b51ab-1743496079034.js";import"./index-1b97ce1c-1743496079034.js";import"./Slider-6d04791b-1743496079034.js";import"./index-f6cdd761-1743496079034.js";import"./icon_default-d1bcaf5f-1743496079034.js";import"./useSpeak-f0fad1e8-1743496079034.js";import"./api-a4f14706-1743496079034.js";import"./icon-pan-16e35a82-1743496079034.js";import"./Cascader-3026ed48-1743496079034.js";const Ne=A({name:"setting-personInfo",props:{studentInfo:{type:Object,default:()=>({nickname:"",currentGradeNum:"",gender:null,phone:"",id:"",currentClass:""})}},setup(a){const v=x(),f=_(),m=g(),i=k({sexs:[{label:"男",value:1,class:"option"},{label:"女",value:0,class:"option"}],areaList:[]}),u=g(),h=g(!1),D=g(ce()),c=g([]),t=g(a.studentInfo.historyClassStudent||""),r=()=>a.studentInfo.currentGradeNum?D.value.findIndex(F=>F.value===a.studentInfo.currentGradeNum)===-1?null:a.studentInfo.currentGradeNum:null,b=s=>{c.value.findIndex(O=>O.value===s)===-1&&s&&c.value.push({label:s,value:s})},l=k({upgradeFlag:v.query.upgradeFlag==0?1:0,nickname:a.studentInfo.nickname,phone:a.studentInfo.phone,gender:a.studentInfo.gender,id:a.studentInfo.id,currentGradeNum:r(),gradeYear:a.studentInfo.gradeYear,currentClass:a.studentInfo.currentClass}),H=g([...me]),p=k({disabled:!0,openChangePwd:!1,uploadShow:!0});Q(()=>a.studentInfo,s=>{l.nickname=s.nickname,l.phone=s.phone,l.gender=s.gender,l.id=s.id,l.currentGradeNum=r(),l.currentClass=s.currentClass,l.gradeYear=s.gradeYear,console.log(a.studentInfo,"props.studentInfo"),b(s.gradeYear)}),S(async()=>{await V(),b(a.studentInfo.gradeYear)});const $=()=>{m.value=!0,u.value.validate(async s=>{if(!s)try{await oe({...a.studentInfo,...l}),p.disabled=!0,f.success("修改成功"),m.value=!1,h.value=!1}catch(F){m.value=!1}})},j=()=>{l.nickname=a.studentInfo.nickname,l.phone=a.studentInfo.phone,l.gender=a.studentInfo.gender,l.currentGradeNum=r(),l.currentClass=a.studentInfo.currentClass,l.gradeYear=a.studentInfo.gradeYear,p.disabled=!0},V=async()=>{try{const{data:s}=await ie({}),F=[{label:s+1,value:s+1},{label:s,value:s}];c.value=F}catch(s){}},P=s=>!s||/^\d+$/.test(s);return()=>e("div",{class:o.infoWrap},[e("div",{class:o.setInfo},[e(q,{ref:u,model:l,disabled:p.disabled},{default:()=>[e(X,{cols:4,"x-gap":"100"},{default:()=>[e(T,null,{default:()=>[e(y,{label:"姓名",path:"nickname",rule:{required:!0,message:"请填写学生姓名",trigger:"blur"}},{default:()=>[e(M,{maxlength:15,bordered:!p.disabled,placeholder:"请填写学生姓名",value:l.nickname,"onUpdate:value":s=>l.nickname=s},null)]})]}),e(T,null,{default:()=>[e(y,{label:"手机号",path:"phone",rule:[{required:!0,message:"请填写学生手机号",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"手机号格式不正确",trigger:"blur"}]},{default:()=>[e(M,{maxlength:11,allowInput:P,bordered:!p.disabled,placeholder:"请填写学生手机号",value:l.phone,"onUpdate:value":s=>l.phone=s},null)]})]}),e(T,null,{default:()=>[e(y,{label:"性别",path:"sex"},{default:()=>[e(E,{bordered:!p.disabled,class:o.select,showArrow:!p.disabled,placeholder:"请选择性别",options:i.sexs,value:l.gender,"onUpdate:value":s=>l.gender=s},null)]})]}),e(T,null,{default:()=>[e(y,{label:"学年",path:""},{default:()=>[e(E,{bordered:!p.disabled,class:o.select,showArrow:!p.disabled,placeholder:"请选择学年",options:c.value,value:l.gradeYear,"onUpdate:value":s=>l.gradeYear=s},null)]})]}),e(T,null,{default:()=>[e(y,{label:"年级",path:""},{default:()=>[e(E,{bordered:!p.disabled,class:o.select,showArrow:!p.disabled,placeholder:"请选择年级",options:D.value,value:l.currentGradeNum,"onUpdate:value":s=>l.currentGradeNum=s},null)]})]}),e(T,null,{default:()=>[e(y,{label:"班级",path:""},{default:()=>[e(E,{bordered:!p.disabled,class:o.select,showArrow:!p.disabled,placeholder:"请选择班级",options:H.value,value:l.currentClass,"onUpdate:value":s=>l.currentClass=s},null)]})]})]})]})]),p.disabled?!l.upgradeFlag&&e(N,{class:o.btnList,align:"center",justify:"end"},{default:()=>[e(I,{class:o.btn,strong:!0,color:"#f24433",disabled:!!t.value,onClick:()=>p.disabled=!1},{default:()=>[d("修改信息")]})]}):e(N,{class:o.btnList,align:"center",justify:"end"},{default:()=>[e(I,{class:o.btn,onClick:()=>j()},{default:()=>[d("取消")]}),e(I,{class:o.btn,type:"primary",onClick:()=>h.value=!0},{default:()=>[d("完成")]})]}),e(L,{maskClosable:Y,show:h.value,"onUpdate:show":s=>h.value=s,preset:"card",class:["modalTitle",o.removeVisiable],title:"确认修改"},{default:()=>[e("div",{class:o.studentRemove},[e("p",null,[d("是否确认修改学员信息")]),e(N,{class:o.btnGroup,justify:"center"},{default:()=>[e(I,{round:!0,type:"primary",onClick:$,loading:m.value},{default:()=>[d("确定")]}),e(I,{round:!0,onClick:()=>h.value=!1},{default:()=>[d("取消")]})]})])]})])}}),Ae=A({props:{activeRow:{type:Object,default:()=>({id:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"studentTraomomhDetails",emits:["close"],setup(a,{emit:v,expose:f}){const m=g(!1),i=g(!1),u=g({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]}),h=(c,t)=>{let r=[];return c==="EVALUATION"?r=["".concat(Ce[t.evaluateDifficult]),"".concat(t.practiceChapterBegin||0,"-").concat(t.practiceChapterEnd||0,"小节"),"速度".concat(t.evaluateSpeed||0),"".concat(t.trainingTimes,"分达标")]:r=["".concat(t.practiceChapterBegin,"-").concat(t.practiceChapterEnd,"小节"),"速度".concat(t.practiceSpeed||0),"".concat(t.trainingTimes,"分钟")],r},D=async c=>{i.value=!0;try{const t=await z({studentLessonTrainingId:c}),r=t.data.studentLessonTrainingDetails.map(b=>{const l=h(b.trainingType,JSON.parse(b.trainingContent));return{...b,coverImg:b.titleImg,fileList:b.fileJsonList&&b.fileJsonList[0]||{},allTimes:JSON.parse(b.trainingContent).trainingTimes,typeList:l||[]}});u.value={...t.data,studentLessonTrainingDetails:r},console.log(u.value," teacherInfo.value")}catch(t){console.log(t)}i.value=!1};return f({getTrainingDetail:D}),S(()=>{D(a.activeRow.id)}),()=>e("div",{class:[n.trainingDetails]},[e(Z,{show:i.value},{default:()=>[e("div",{class:n.studentList},[e("div",{class:n.studentHeaderWrap},[e("div",{class:n.studentHeader},[e("div",{class:n.studentHeaderBorder},[e(C,{class:n.studentHeaderImg,src:u.value.teacherAvatar?u.value.teacherAvatar:W,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",null,[u.value.teacherName," ",e("div",{class:[n.workafterInfoDot,n.workafterTeacherInfoDot]},[d("老师")])]),e("p",null,[d("开始时间:"),u.value.createTime?w(new Date(u.value.createTime)).format("YYYY-MM-DD HH:mm"):"--"," ",d("| 结束时间:"),u.value.expireDate?w(new Date(u.value.expireDate)).format("YYYY-MM-DD"):"--"])])]),u.value.trainingStatus=="UNSUBMITTED"?e(C,{previewDisabled:!0,class:n.workStatus,src:be},null):null,u.value.trainingStatus=="SUBMITTED"?e(C,{previewDisabled:!0,class:n.workStatus,src:De},null):null,u.value.trainingStatus=="TARGET"?e(C,{previewDisabled:!0,class:n.workStatus,src:ye},null):null]),(u.value.fileExpireDay||0)>0&&e("div",{class:n.expireDateTip},[e("i",{class:n.expireDateIcon},null),e("span",null,[d("作业截止"),u.value.fileExpireDay||0,d("天后,学生上传的文件将过期,请及时查看")])]),e(Fe,{style:"max-height:400px;min-height: 260px;",trigger:"none"},{default:()=>[e("div",{class:n.workList},[u.value.studentLessonTrainingDetails.map(c=>e(Ie,{style:{marginBottom:"20px"},item:{...c,studentName:u.value.studentName}},null))]),u.value.expireFlag?e("div",{class:n.commentSection},[e("div",{class:n.commentTitle},[e("h3",null,[e("i",{class:n.iconComment},null),e("i",{class:n.myText},null)]),e(I,{text:!0,onClick:()=>m.value=!0,class:n.commentBtnGroup},{default:()=>[e("div",{class:n.text},[e("i",null,null),u.value.comment?"修改点评":"点评作业"])]})]),u.value.comment?e("div",{class:n.commentContent},[u.value.comment]):e("div",{class:[n.commentContent,n.commentTip]},[d("您目前还没有点评该作业喔,快来写评语吧~")])]):null]})]}),e(L,{maskClosable:Y,show:m.value,"onUpdate:show":c=>m.value=c},{default:()=>[e(Te,{comment:u.value.comment,workInfo:{isLook:!!u.value.comment,studentAvatar:u.value.studentAvatar,studentName:u.value.studentName,submitTime:u.value.submitTime,studentLessonTrainingId:u.value.studentLessonTrainingId},onClose:()=>m.value=!1,onConfrim:()=>{D(a.activeRow.id),m.value=!1}},null)]})])}}),Se=A({name:"student-studentList",setup(){const a=k({searchForm:{keyword:"",trainingStatus:""},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],workInfo:{createTime:"",expireDate:"",teacherAvatar:"",teacherName:""},detailVisiable:!1,activeRow:null,index:0}),v=g([U(new Date().getTime()),G(new Date().getTime())]),f=g(),m=x(),i=()=>{a.pagination.page=1,h(),R({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork"})},u=()=>{a.searchForm={keyword:"",trainingStatus:""},v.value=[U(new Date().getTime()),G(new Date().getTime())],i(),R({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork"})};we({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork",callBack:t=>{a.searchForm=t,v.value=t.timer}});const h=async()=>{a.loading=!0;try{const t=await de({studentId:m.query.studentId,...a.searchForm,...a.pagination,...ve(v.value,["startTime","endTime"],"YYYY-MM-DD")});a.tableList=t.data.rows,a.pagination.pageTotal=t.data.total,a.loading=!1}catch(t){a.loading=!1,console.log(t)}},D=(t,r)=>{console.log(r,"index"),a.index=r+1,a.activeRow=t,a.detailVisiable=!0};S(()=>{h()});const c=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(t){return t.createTime?w(t.createTime).format("YYYY-MM-DD HH:mm"):"--"}},{title:"截止时间",key:"expireDate",render(t){return t.expireDate?w(t.expireDate).format("YYYY-MM-DD"):"--"}},{title:"最后提交时间",key:"submitTime",render(t){return t.submitTime?w(t.submitTime).format("YYYY-MM-DD"):"--"}},{title:"提交状态",key:"sex",render(t){return e("div",null,[t.trainingStatus=="UNSUBMITTED"?e("p",{class:o.nosub,style:{color:"#aaa"}},[d("未提交")]):null,t.trainingStatus=="SUBMITTED"?e("p",{style:{color:"#EA4132"},class:o.ison},[d("未达标")]):null,t.trainingStatus=="TARGET"?e("p",{class:o.isok},[d("达标")]):null])}},{title:"操作",key:"id",render(t,r){return e(I,{text:!0,type:"primary",onClick:()=>{D(t,r)}},{default:()=>[d("详情")]})}}];return()=>e("div",null,[e("div",null,[e("div",{class:o.searchList},[e(q,{"label-placement":"left",inline:!0},{default:()=>[e(y,null,{default:()=>[e(ge,{value:v.value,"onUpdate:value":t=>v.value=t,separator:"至",type:"daterange",timerValue:v.value},null)]}),e(y,null,{default:()=>[e(fe,J({options:[{label:"全部状态",value:""},...he],placeholder:"提交状态",clearable:!0,inline:!0},{value:a.searchForm.trainingStatus,"onUpdate:value":t=>a.searchForm.trainingStatus=t}),null)]}),e(y,null,{default:()=>[e(N,{justify:"end"},{default:()=>[e(I,{type:"primary",class:"searchBtn",onClick:i},{default:()=>[d("搜索")]}),e(I,{type:"primary",ghost:!0,class:"resetBtn",onClick:u},{default:()=>[d("重置")]})]})]})]})]),e("div",null,[e(ee,{class:o.classTable,loading:a.loading,columns:c(),data:a.tableList},{empty:()=>e(ke,null,null)}),e(pe,{page:a.pagination.page,"onUpdate:page":t=>a.pagination.page=t,pageSize:a.pagination.rows,"onUpdate:pageSize":t=>a.pagination.rows=t,pageTotal:a.pagination.pageTotal,"onUpdate:pageTotal":t=>a.pagination.pageTotal=t,onList:h,sync:!0},null)])]),e(L,{maskClosable:Y,show:a.detailVisiable,"onUpdate:show":t=>a.detailVisiable=t,preset:"card",class:["modalTitle background",o.wordDetailModel],title:"作业详情"},{default:()=>[e(Ae,{ref:f,onClose:()=>a.detailVisiable=!1,total:a.tableList.length,current:a.index,activeRow:a.activeRow},null)]})])}}),ca=A({name:"studentDetail",setup(a,{emit:v}){const f=k({studentInfo:{avatar:"",nickname:"",gender:null,subjectNames:"",classInstrumentName:"",classGroupName:""}}),m=g("baseInfo"),i=x();console.log(i.meta.isClass);const u=g(i.meta.isClass?[{name:"班级管理",path:"/classList"},{name:i.query.name,path:"/classDetail"},{name:i.query.studentName,path:"/classStudentRecode"}]:[{name:"学生管理",path:"/studentList"},{name:i.query.studentName,path:"/classStudentRecode"}]),h=async()=>{console.log(i.query,i.query.studentId,"route.query");try{const r=await K({id:i.query.studentId});f.studentInfo={...r.data}}catch(r){console.log(r)}};S(()=>{h()}),Ee(r=>{r.form.tabName&&(m.value=r.form.tabName)});const D=r=>{Be(r,"tabName",i)},c=g(!1);ae((r,b,l)=>{c.value&&i.query.times&&r.path==="/data-module"&&(r.query={times:i.query.times}),l()});const t=()=>{c.value=!0};return()=>e("div",null,[e(se,{list:u.value,onBack:t},null),e("div",{class:[n.listWrap,n.infoListWrap]},[e("div",{class:n.teacherList},[e("div",{class:n.teacherHeader},[e("div",{class:n.teacherHeaderBorder},[e(C,{class:n.teacherHeaderImg,src:f.studentInfo.avatar?f.studentInfo.avatar:W,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",{class:n.studentGender},[f.studentInfo.nickname," ",e(C,{previewDisabled:!0,src:f.studentInfo.gender?ue:ne},null)]),e("p",null,[f.studentInfo.classGroupName," ",f.studentInfo.classInstrumentName?"| "+f.studentInfo.classInstrumentName:" "])])]),e(te,{"onUpdate:value":[r=>D(r),r=>m.value=r],class:n.customTabs,value:m.value,size:"large",animated:!1,"pane-wrapper-style":"margin: 0 -4px","pane-style":"padding-left: 4px; padding-right: 4px; box-sizing: border-box;"},{default:()=>[e(B,{name:"baseInfo",tab:"基本信息"},{default:()=>[e(Ne,{studentInfo:f.studentInfo},null)]}),e(B,{name:"afterWork",tab:"课后作业"},{default:()=>[e(Se,null,null)]}),e(B,{name:"textRcode",tab:"练习记录"},{default:()=>[e(le,{studentId:i.query.studentId},null)]}),e(B,{name:"evaluatingRcode",tab:"评测记录"},{default:()=>[e(re,{studentId:i.query.studentId},null)]})]})])])}});export{ca as default};