studentDetail-88ec99c6-1706107518515.js 13 KB

1
  1. import{s as u}from"./index.module-d1ab12c4-1706107518515.js";import{o as W,p as $}from"./api-335a4374-1706107518515.js";import{d as k,a as E,b as V,c as H,r as g,e as I,y as P,f as e,N as U,ci as O,cj as T,g as h,h as A,C as F,w as C,j as D,k as m,l as M,p as B,v as y,K as N,x as z,cc as K,q as Q,t as w}from"./index-18b8b0d9-1706107518515.js";import{C as X}from"./index-8c7a15dc-1706107518515.js";import{d as R}from"./teacherIcon-b8e3946d-1706107518515.js";import{m as Z,f as _}from"./maleIcon-3fe0e51e-1706107518515.js";import{P as J,E as ee}from"./evaluationRecords-8181e4ea-1706107518515.js";import{s as i}from"./index.module-cda1a757-1706107518515.js";import{r as te,a as ae}from"./api-11bede88-1706107518515.js";import{g as se,c as ne}from"./contants-8d89449c-1706107518515.js";import{C as le}from"./index-c6880faf-1706107518515.js";import{P as re}from"./index-59887fdc-1706107518515.js";import{C as ue}from"./index-d0e67d68-1706107518515.js";import{g as x,a as L,b as ie}from"./dateFormat-1d18260e-1706107518515.js";import{t as oe}from"./searchArray-45783419-1706107518515.js";import{T as de}from"./index-d4104e6e-1706107518515.js";import{n as ce,u as me,q as pe}from"./unqualified-8d139e02-1706107518515.js";import{N as fe,j as ge}from"./api-2baae04f-1706107518515.js";import{T as ve}from"./index-1aaceba7-1706107518515.js";import{i as be,s as Y,g as he,a as De}from"./use-async-ab04cc1e-1706107518515.js";import"./useECharts-d54f9ecb-1706107518515.js";import"./index-0e750973-1706107518515.js";import"./NumberAnimation-b9886be6-1706107518515.js";import"./urlUtils-880ab4ad-1706107518515.js";import"./Slider-c3c0528e-1706107518515.js";const ye=k({name:"setting-personInfo",props:{studentInfo:{type:Object,default:()=>({nickname:"",currentGradeNum:"",gender:null,phone:"",id:"",currentClass:""})}},setup(a){const p=E(),c=V();H();const l=g(),o=I({sexs:[{label:"男",value:1,class:"option"},{label:"女",value:0,class:"option"}],areaList:[]}),v=g(),d=g(!1),r=g(se()),s=()=>a.studentInfo.currentGradeNum?r.value.findIndex(S=>S.value===a.studentInfo.currentGradeNum)===-1?null:a.studentInfo.currentGradeNum:null,t=I({upgradeFlag:p.query.upgradeFlag==0?1:0,nickname:a.studentInfo.nickname,phone:a.studentInfo.phone,gender:a.studentInfo.gender,id:a.studentInfo.id,currentGradeNum:s(),currentClass:a.studentInfo.currentClass}),b=g([...ne]),f=I({disabled:!0,openChangePwd:!1,uploadShow:!0});P(()=>a.studentInfo,n=>{t.nickname=n.nickname,t.phone=n.phone,t.gender=n.gender,t.id=n.id,t.currentGradeNum=s(),t.currentClass=n.currentClass});const G=()=>{l.value=!0,v.value.validate(async n=>{if(!n)try{await te({...a.studentInfo,...t}),f.disabled=!0,c.success("修改成功"),l.value=!1,d.value=!1}catch(S){l.value=!1}})},q=()=>{t.nickname=a.studentInfo.nickname,t.phone=a.studentInfo.phone,t.gender=a.studentInfo.gender,t.currentGradeNum=s(),t.currentClass=a.studentInfo.currentClass,f.disabled=!0},j=n=>!n||/^\d+$/.test(n);return()=>e("div",{class:i.infoWrap},[e("div",{class:i.setInfo},[e(U,{ref:v,model:t,disabled:f.disabled},{default:()=>[e(O,{cols:4,"x-gap":"100"},{default:()=>[e(T,null,{default:()=>[e(h,{label:"姓名",path:"nickname",rule:{required:!0,message:"请填写学生姓名",trigger:"blur"}},{default:()=>[e(A,{maxlength:15,bordered:!f.disabled,placeholder:"请填写学生姓名",value:t.nickname,"onUpdate:value":n=>t.nickname=n},null)]})]}),e(T,null,{default:()=>[e(h,{label:"手机号",path:"phone",rule:[{required:!0,message:"请填写学生手机号",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"手机号格式不正确",trigger:"blur"}]},{default:()=>[e(A,{maxlength:11,allowInput:j,bordered:!f.disabled,placeholder:"请填写学生手机号",value:t.phone,"onUpdate:value":n=>t.phone=n},null)]})]}),e(T,null,{default:()=>[e(h,{label:"性别",path:"sex"},{default:()=>[e(F,{bordered:!f.disabled,class:i.select,showArrow:!f.disabled,placeholder:"请选择性别",options:o.sexs,value:t.gender,"onUpdate:value":n=>t.gender=n},null)]})]}),e(T,null,{default:()=>[e(h,{label:"年级",path:""},{default:()=>[e(F,{bordered:!f.disabled,class:i.select,showArrow:!f.disabled,placeholder:"请选择年级",options:r.value,value:t.currentGradeNum,"onUpdate:value":n=>t.currentGradeNum=n},null)]})]}),e(T,null,{default:()=>[e(h,{label:"班级",path:""},{default:()=>[e(F,{bordered:!f.disabled,class:i.select,showArrow:!f.disabled,placeholder:"请选择班级",options:b.value,value:t.currentClass,"onUpdate:value":n=>t.currentClass=n},null)]})]})]})]})]),f.disabled?!t.upgradeFlag&&e(C,{class:i.btnList,align:"center",justify:"end"},{default:()=>[e(D,{class:i.btn,strong:!0,color:"#f24433",onClick:()=>f.disabled=!1},{default:()=>[m("修改信息")]})]}):e(C,{class:i.btnList,align:"center",justify:"end"},{default:()=>[e(D,{class:i.btn,onClick:()=>q()},{default:()=>[m("取消")]}),e(D,{class:i.btn,type:"primary",onClick:()=>d.value=!0},{default:()=>[m("完成")]})]}),e(M,{show:d.value,"onUpdate:show":n=>d.value=n,preset:"card",class:["modalTitle",i.removeVisiable],title:"确认修改"},{default:()=>[e("div",{class:i.studentRemove},[e("p",null,[m("是否确认修改学员信息")]),e(C,{class:i.btnGroup,justify:"center"},{default:()=>[e(D,{round:!0,type:"primary",onClick:G,loading:l.value},{default:()=>[m("确定")]}),e(D,{round:!0,onClick:()=>d.value=!1},{default:()=>[m("取消")]})]})])]})])}}),Te=k({props:{activeRow:{type:Object,default:()=>({id:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"studentTraomomhDetails",emits:["close"],setup(a,{emit:p,expose:c}){const l=g({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]}),o=(d,r)=>{let s=[];return d==="EVALUATION"?s=["".concat(ge[r.evaluateDifficult]),r.practiceChapterBegin||r.practiceChapterEnd?"".concat(r.practiceChapterBegin,"-").concat(r.practiceChapterEnd,"小节"):"全部小节","".concat(r.trainingTimes,"分合格")]:s=["".concat(r.practiceChapterBegin,"-").concat(r.practiceChapterEnd,"小节"),"速度".concat(r.practiceSpeed),"".concat(r.trainingTimes,"分钟")],s},v=async d=>{try{const r=await W({studentLessonTrainingId:d}),s=r.data.studentLessonTrainingDetails.map(t=>{const b=o(t.trainingType,JSON.parse(t.trainingContent));return{...t,coverImg:t.titleImg,allTimes:JSON.parse(t.trainingContent).trainingTimes,typeList:b||[]}});console.log(s,"arr"),l.value={...r.data,studentLessonTrainingDetails:s}}catch(r){console.log(r)}};return c({getTrainingDetail:v}),B(()=>{v(a.activeRow.id)}),()=>e("div",{class:[u.trainingDetails]},[e("div",{class:u.studentList},[e("div",{class:u.studentHeaderWrap},[e("div",{class:u.studentHeader},[e("div",{class:u.studentHeaderBorder},[e(y,{class:u.studentHeaderImg,src:l.value.teacherAvatar?l.value.teacherAvatar:R,previewDisabled:!0},null)])]),e("div",{class:u.workafterInfo},[e("h4",null,[l.value.teacherName," ",e("div",{class:[u.workafterInfoDot,u.workafterTeacherInfoDot]},[m("老师")])]),e("p",null,[m("开始时间:"),l.value.createTime?N(new Date(l.value.createTime)).format("YYYY-MM-DD"):"--"," ",m("| 结束时间:"),N(new Date(l.value.expireDate)).format("YYYY-MM-DD")])])]),l.value.trainingStatus=="UNSUBMITTED"?e(y,{previewDisabled:!0,class:u.workStatus,src:ce},null):null,l.value.trainingStatus=="SUBMITTED"?e(y,{previewDisabled:!0,class:u.workStatus,src:me},null):null,l.value.trainingStatus=="TARGET"?e(y,{previewDisabled:!0,class:u.workStatus,src:pe},null):null]),e(fe,{style:"max-height:400px",trigger:"none"},{default:()=>[e("div",{class:u.workList},[l.value.studentLessonTrainingDetails.map(d=>e(de,{style:{marginBottom:"20px"},isDisabled:!0,isDelete:!1,isCLassWork:!1,item:d},null))])]})])}}),Ie=k({name:"student-studentList",setup(){const a=I({searchForm:{keyword:"",trainingStatus:""},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],workInfo:{createTime:"",expireDate:"",teacherAvatar:"",teacherName:""},detailVisiable:!1,activeRow:null,index:0}),p=g([x(new Date().getTime()),L(new Date().getTime())]),c=g(),l=E(),o=()=>{a.pagination.page=1,d(),Y({current:{...a.searchForm,timer:p.value},saveKey:"studentDetailAfterWork"})},v=()=>{a.searchForm={keyword:"",trainingStatus:""},p.value=[x(new Date().getTime()),L(new Date().getTime())],o(),Y({current:{...a.searchForm,timer:p.value},saveKey:"studentDetailAfterWork"})};be({current:{...a.searchForm,timer:p.value},saveKey:"studentDetailAfterWork",callBack:t=>{a.searchForm=t,p.value=t.timer}});const d=async()=>{a.loading=!0;try{const t=await ae({studentId:l.query.studentId,...a.searchForm,...a.pagination,...ie(p.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)}},r=(t,b)=>{console.log(b,"index"),a.index=b+1,a.activeRow=t,a.detailVisiable=!0};B(()=>{d()});const s=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(t){return t.createTime?N(t.createTime).format("YYYY-MM-DD"):"--"}},{title:"截止时间",key:"expireDate",render(t){return t.expireDate?N(t.expireDate).format("YYYY-MM-DD"):"--"}},{title:"最后提交时间",key:"submitTime",render(t){return t.submitTime?N(t.submitTime).format("YYYY-MM-DD"):"--"}},{title:"提交状态",key:"sex",render(t){return e("div",null,[t.trainingStatus=="UNSUBMITTED"?e("p",{class:i.nosub,style:{color:"#aaa"}},[m("未提交")]):null,t.trainingStatus=="SUBMITTED"?e("p",{style:{color:"#EA4132"},class:i.ison},[m("不合格")]):null,t.trainingStatus=="TARGET"?e("p",{class:i.isok},[m("合格")]):null])}},{title:"操作",key:"id",render(t,b){return e(D,{text:!0,type:"primary",onClick:()=>{r(t,b)}},{default:()=>[m("详情")]})}}];return()=>e("div",null,[e("div",null,[e("div",{class:i.searchList},[e(U,{"label-placement":"left",inline:!0},{default:()=>[e(h,null,{default:()=>[e(ue,{value:p.value,"onUpdate:value":t=>p.value=t,separator:"至",type:"daterange",timerValue:p.value},null)]}),e(h,null,{default:()=>[e(le,z({options:[{label:"全部状态",value:""},...oe],placeholder:"提交状态",clearable:!0,inline:!0},{value:a.searchForm.trainingStatus,"onUpdate:value":t=>a.searchForm.trainingStatus=t}),null)]}),e(h,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(D,{type:"primary",class:"searchBtn",onClick:o},{default:()=>[m("搜索")]}),e(D,{type:"primary",ghost:!0,class:"resetBtn",onClick:v},{default:()=>[m("重置")]})]})]})]})]),e("div",null,[e(K,{class:i.classTable,loading:a.loading,columns:s(),data:a.tableList},{empty:()=>e(ve,null,null)}),e(re,{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:d,sync:!0},null)])]),e(M,{show:a.detailVisiable,"onUpdate:show":t=>a.detailVisiable=t,preset:"card",class:["modalTitle background",i.wordDetailModel],title:"作业详情"},{default:()=>[e(Te,{ref:c,onClose:()=>a.detailVisiable=!1,total:a.tableList.length,current:a.index,activeRow:a.activeRow},null)]})])}}),Ke=k({name:"studentDetail",setup(a,{emit:p}){const c=I({studentInfo:{avatar:"",nickname:"",gender:null,subjectNames:"",classGroupName:""}}),l=g("baseInfo"),o=E();console.log(o.meta.isClass);const v=g(o.meta.isClass?[{name:"班级管理",path:"/classList"},{name:o.query.name,path:"/classDetail"},{name:o.query.studentName,path:"/classStudentRecode"}]:[{name:"学生管理",path:"/studentList"},{name:o.query.studentName,path:"/classStudentRecode"}]),d=async()=>{console.log(o.query.studentId);try{const s=await $({id:o.query.studentId});c.studentInfo={...s.data}}catch(s){console.log(s)}};B(()=>{d()}),he(s=>{s.form.tabName&&(l.value=s.form.tabName)});const r=s=>{De(s,"tabName",o)};return()=>e("div",null,[e(X,{list:v.value},null),e("div",{class:[u.listWrap,u.infoListWrap]},[e("div",{class:u.teacherList},[e("div",{class:u.teacherHeader},[e("div",{class:u.teacherHeaderBorder},[e(y,{class:u.teacherHeaderImg,src:c.studentInfo.avatar?c.studentInfo.avatar:R,previewDisabled:!0},null)])]),e("div",{class:u.workafterInfo},[e("h4",{class:u.studentGender},[c.studentInfo.nickname," ",e(y,{previewDisabled:!0,src:c.studentInfo.gender?Z:_},null)]),e("p",null,[c.studentInfo.classGroupName," ",c.studentInfo.subjectNames?"| "+c.studentInfo.subjectNames:" "])])]),e(Q,{"onUpdate:value":[s=>r(s),s=>l.value=s],class:u.customTabs,value:l.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(w,{name:"baseInfo",tab:"基本信息"},{default:()=>[e(ye,{studentInfo:c.studentInfo},null)]}),e(w,{name:"afterWork",tab:"课后作业"},{default:()=>[e(Ie,null,null)]}),e(w,{name:"textRcode",tab:"练习记录"},{default:()=>[e(J,{studentId:o.query.studentId},null)]}),e(w,{name:"evaluatingRcode",tab:"评测记录"},{default:()=>[e(ee,{studentId:o.query.studentId},null)]})]})])])}});export{Ke as default};