studentDetail-18b434e5-1740736449183.js 15 KB

1
  1. import{s as n}from"./index.module-f6e6cc97-1740736449183.js";import{o as z,p as K}from"./api-39f0c289-1740736449183.js";import{d as A,a as x,b as _,r as g,e as w,a5 as Q,q as S,f as e,N as H,aO as X,aP as T,g as I,h as M,ac as N,x as B,j as y,k as d,l as L,m as Y,a9 as Z,w as C,aj as k,y as J,aU as ee,t as ae,v as E}from"./index-fc4c818c-1740736449183.js";import{C as te}from"./index-09d79948-1740736449183.js";import{d as q}from"./teacherIcon-b8e3946d-1740736449183.js";import{m as se,f as le,P as ne,E as ue}from"./evaluationRecords-363feb9e-1740736449183.js";import{s as i}from"./index.module-622ebf5e-1740736449183.js";import{a as re,r as ie,b as oe}from"./api-5a4ee54e-1740736449183.js";import{g as de,c as ce}from"./contants-2900284d-1740736449183.js";import{C as me}from"./index-b4fca47c-1740736449183.js";import{P as pe}from"./index-ce359b32-1740736449183.js";import{C as fe}from"./index-942144ea-1740736449183.js";import{g as U,a as G,b as ge}from"./icon-sort-asc-bd08a47f-1740736449183.js";import{t as ve}from"./searchArray-0015b208-1740736449183.js";import{n as be,u as he,q as De,W as Ie,C as ye}from"./index-9b21d611-1740736449183.js";import{e as Te}from"./contants-84ba384e-1740736449183.js";import{N as Ce}from"./Scrollbar-e2d8d626-1740736449183.js";import{T as Fe}from"./index-636bf432-1740736449183.js";import{i as we,s as R,g as ke,a as Ne}from"./use-async-95ba1cdb-1740736449183.js";import"./useECharts-dfa65227-1740736449183.js";import"./index-ff417b55-1740736449183.js";import"./urlUtils-b5855a3c-1740736449183.js";import"./catchData-45bdcc01-1740736449183.js";import"./index-ed00e9f7-1740736449183.js";import"./index-1d0c2246-1740736449183.js";import"./Slider-a97d5b57-1740736449183.js";import"./index-5f647f19-1740736449183.js";import"./icon_default-d1bcaf5f-1740736449183.js";import"./useSpeak-2f7d8696-1740736449183.js";import"./api-97e7e193-1740736449183.js";import"./icon-pan-16e35a82-1740736449183.js";import"./Cascader-3642e9ed-1740736449183.js";const Ee=A({name:"setting-personInfo",props:{studentInfo:{type:Object,default:()=>({nickname:"",currentGradeNum:"",gender:null,phone:"",id:"",currentClass:""})}},setup(a){const v=x(),m=_(),c=g(),o=w({sexs:[{label:"男",value:1,class:"option"},{label:"女",value:0,class:"option"}],areaList:[]}),l=g(),b=g(!1),h=g(de()),r=g([]),t=g(a.studentInfo.historyClassStudent||""),f=()=>a.studentInfo.currentGradeNum?h.value.findIndex(F=>F.value===a.studentInfo.currentGradeNum)===-1?null:a.studentInfo.currentGradeNum:null,D=s=>{r.value.findIndex(O=>O.value===s)===-1&&s&&r.value.push({label:s,value:s})},u=w({upgradeFlag:v.query.upgradeFlag==0?1:0,nickname:a.studentInfo.nickname,phone:a.studentInfo.phone,gender:a.studentInfo.gender,id:a.studentInfo.id,currentGradeNum:f(),gradeYear:a.studentInfo.gradeYear,currentClass:a.studentInfo.currentClass}),W=g([...ce]),p=w({disabled:!0,openChangePwd:!1,uploadShow:!0});Q(()=>a.studentInfo,s=>{u.nickname=s.nickname,u.phone=s.phone,u.gender=s.gender,u.id=s.id,u.currentGradeNum=f(),u.currentClass=s.currentClass,u.gradeYear=s.gradeYear,console.log(a.studentInfo,"props.studentInfo"),D(s.gradeYear)}),S(async()=>{await V(),D(a.studentInfo.gradeYear)});const $=()=>{c.value=!0,l.value.validate(async s=>{if(!s)try{await ie({...a.studentInfo,...u}),p.disabled=!0,m.success("修改成功"),c.value=!1,b.value=!1}catch(F){c.value=!1}})},j=()=>{u.nickname=a.studentInfo.nickname,u.phone=a.studentInfo.phone,u.gender=a.studentInfo.gender,u.currentGradeNum=f(),u.currentClass=a.studentInfo.currentClass,u.gradeYear=a.studentInfo.gradeYear,p.disabled=!0},V=async()=>{try{const{data:s}=await re({}),F=[{label:s+1,value:s+1},{label:s,value:s}];r.value=F}catch(s){}},P=s=>!s||/^\d+$/.test(s);return()=>e("div",{class:i.infoWrap},[e("div",{class:i.setInfo},[e(H,{ref:l,model:u,disabled:p.disabled},{default:()=>[e(X,{cols:4,"x-gap":"100"},{default:()=>[e(T,null,{default:()=>[e(I,{label:"姓名",path:"nickname",rule:{required:!0,message:"请填写学生姓名",trigger:"blur"}},{default:()=>[e(M,{maxlength:15,bordered:!p.disabled,placeholder:"请填写学生姓名",value:u.nickname,"onUpdate:value":s=>u.nickname=s},null)]})]}),e(T,null,{default:()=>[e(I,{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:u.phone,"onUpdate:value":s=>u.phone=s},null)]})]}),e(T,null,{default:()=>[e(I,{label:"性别",path:"sex"},{default:()=>[e(N,{bordered:!p.disabled,class:i.select,showArrow:!p.disabled,placeholder:"请选择性别",options:o.sexs,value:u.gender,"onUpdate:value":s=>u.gender=s},null)]})]}),e(T,null,{default:()=>[e(I,{label:"学年",path:""},{default:()=>[e(N,{bordered:!p.disabled,class:i.select,showArrow:!p.disabled,placeholder:"请选择学年",options:r.value,value:u.gradeYear,"onUpdate:value":s=>u.gradeYear=s},null)]})]}),e(T,null,{default:()=>[e(I,{label:"年级",path:""},{default:()=>[e(N,{bordered:!p.disabled,class:i.select,showArrow:!p.disabled,placeholder:"请选择年级",options:h.value,value:u.currentGradeNum,"onUpdate:value":s=>u.currentGradeNum=s},null)]})]}),e(T,null,{default:()=>[e(I,{label:"班级",path:""},{default:()=>[e(N,{bordered:!p.disabled,class:i.select,showArrow:!p.disabled,placeholder:"请选择班级",options:W.value,value:u.currentClass,"onUpdate:value":s=>u.currentClass=s},null)]})]})]})]})]),p.disabled?!u.upgradeFlag&&e(B,{class:i.btnList,align:"center",justify:"end"},{default:()=>[e(y,{class:i.btn,strong:!0,color:"#f24433",disabled:!!t.value,onClick:()=>p.disabled=!1},{default:()=>[d("修改信息")]})]}):e(B,{class:i.btnList,align:"center",justify:"end"},{default:()=>[e(y,{class:i.btn,onClick:()=>j()},{default:()=>[d("取消")]}),e(y,{class:i.btn,type:"primary",onClick:()=>b.value=!0},{default:()=>[d("完成")]})]}),e(L,{maskClosable:Y,show:b.value,"onUpdate:show":s=>b.value=s,preset:"card",class:["modalTitle",i.removeVisiable],title:"确认修改"},{default:()=>[e("div",{class:i.studentRemove},[e("p",null,[d("是否确认修改学员信息")]),e(B,{class:i.btnGroup,justify:"center"},{default:()=>[e(y,{round:!0,type:"primary",onClick:$,loading:c.value},{default:()=>[d("确定")]}),e(y,{round:!0,onClick:()=>b.value=!1},{default:()=>[d("取消")]})]})])]})])}}),Be=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:m}){const c=g(!1),o=g(!1),l=g({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]}),b=(r,t)=>{let f=[];return r==="EVALUATION"?f=["".concat(Te[t.evaluateDifficult]),"".concat(t.practiceChapterBegin||0,"-").concat(t.practiceChapterEnd||0,"小节"),"速度".concat(t.evaluateSpeed||0),"".concat(t.trainingTimes,"分达标")]:f=["".concat(t.practiceChapterBegin,"-").concat(t.practiceChapterEnd,"小节"),"速度".concat(t.practiceSpeed||0),"".concat(t.trainingTimes,"分钟")],f},h=async r=>{o.value=!0;try{const t=await z({studentLessonTrainingId:r}),f=t.data.studentLessonTrainingDetails.map(D=>{const u=b(D.trainingType,JSON.parse(D.trainingContent));return{...D,coverImg:D.titleImg,fileList:D.fileJsonList&&D.fileJsonList[0]||{},allTimes:JSON.parse(D.trainingContent).trainingTimes,typeList:u||[]}});l.value={...t.data,studentLessonTrainingDetails:f},console.log(l.value," teacherInfo.value")}catch(t){console.log(t)}o.value=!1};return m({getTrainingDetail:h}),S(()=>{h(a.activeRow.id)}),()=>e("div",{class:[n.trainingDetails]},[e(Z,{show:o.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:l.value.teacherAvatar?l.value.teacherAvatar:q,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",null,[l.value.teacherName," ",e("div",{class:[n.workafterInfoDot,n.workafterTeacherInfoDot]},[d("老师")])]),e("p",null,[d("开始时间:"),l.value.createTime?k(new Date(l.value.createTime)).format("YYYY-MM-DD HH:mm"):"--"," ",d("| 结束时间:"),l.value.expireDate?k(new Date(l.value.expireDate)).format("YYYY-MM-DD HH:mm"):"--"])]),l.value.trainingStatus=="UNSUBMITTED"?e(C,{previewDisabled:!0,class:n.workStatus,src:be},null):null,l.value.trainingStatus=="SUBMITTED"?e(C,{previewDisabled:!0,class:n.workStatus,src:he},null):null,l.value.trainingStatus=="TARGET"?e(C,{previewDisabled:!0,class:n.workStatus,src:De},null):null]),l.value.expireFlag&&e(y,{onClick:()=>c.value=!0,class:n.commentBtnGroup},{default:()=>[e("div",{class:n.text},[e("i",{class:l.value.comment&&n.look},null),l.value.comment?"修改点评":"点评作业"])]})]),(l.value.fileExpireDay||0)>0&&e("div",{class:n.expireDateTip},[e("i",{class:n.expireDateIcon},null),e("span",null,[d("作业截止"),l.value.fileExpireDay||0,d("天后,学生上传的文件将过期,请及时查看")])]),e(Ce,{style:"max-height:400px;min-height: 260px;",trigger:"none"},{default:()=>[e("div",{class:n.workList},[l.value.studentLessonTrainingDetails.map(r=>e(Ie,{style:{marginBottom:"20px"},item:{...r,studentName:l.value.studentName}},null))]),l.value.comment&&e("div",{class:n.commentSection},[e("h3",null,[e("i",{class:n.iconComment},null),e("i",{class:n.myText},null)]),e("div",{class:n.commentContent},[l.value.comment])])]})]}),e(L,{maskClosable:Y,show:c.value,"onUpdate:show":r=>c.value=r},{default:()=>[e(ye,{comment:l.value.comment,workInfo:{isLook:!!l.value.comment,studentAvatar:l.value.studentAvatar,studentName:l.value.studentName,submitTime:l.value.submitTime,studentLessonTrainingId:l.value.studentLessonTrainingId},onClose:()=>c.value=!1,onConfrim:()=>{h(a.activeRow.id),c.value=!1}},null)]})])}}),Ae=A({name:"student-studentList",setup(){const a=w({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())]),m=g(),c=x(),o=()=>{a.pagination.page=1,b(),R({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork"})},l=()=>{a.searchForm={keyword:"",trainingStatus:""},v.value=[U(new Date().getTime()),G(new Date().getTime())],o(),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 b=async()=>{a.loading=!0;try{const t=await oe({studentId:c.query.studentId,...a.searchForm,...a.pagination,...ge(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)}},h=(t,f)=>{console.log(f,"index"),a.index=f+1,a.activeRow=t,a.detailVisiable=!0};S(()=>{b()});const r=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(t){return t.createTime?k(t.createTime).format("YYYY-MM-DD HH:mm"):"--"}},{title:"截止时间",key:"expireDate",render(t){return t.expireDate?k(t.expireDate).format("YYYY-MM-DD HH:mm"):"--"}},{title:"最后提交时间",key:"submitTime",render(t){return t.submitTime?k(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"}},[d("未提交")]):null,t.trainingStatus=="SUBMITTED"?e("p",{style:{color:"#EA4132"},class:i.ison},[d("未达标")]):null,t.trainingStatus=="TARGET"?e("p",{class:i.isok},[d("达标")]):null])}},{title:"操作",key:"id",render(t,f){return e(y,{text:!0,type:"primary",onClick:()=>{h(t,f)}},{default:()=>[d("详情")]})}}];return()=>e("div",null,[e("div",null,[e("div",{class:i.searchList},[e(H,{"label-placement":"left",inline:!0},{default:()=>[e(I,null,{default:()=>[e(fe,{value:v.value,"onUpdate:value":t=>v.value=t,separator:"至",type:"daterange",timerValue:v.value},null)]}),e(I,null,{default:()=>[e(me,J({options:[{label:"全部状态",value:""},...ve],placeholder:"提交状态",clearable:!0,inline:!0},{value:a.searchForm.trainingStatus,"onUpdate:value":t=>a.searchForm.trainingStatus=t}),null)]}),e(I,null,{default:()=>[e(B,{justify:"end"},{default:()=>[e(y,{type:"primary",class:"searchBtn",onClick:o},{default:()=>[d("搜索")]}),e(y,{type:"primary",ghost:!0,class:"resetBtn",onClick:l},{default:()=>[d("重置")]})]})]})]})]),e("div",null,[e(ee,{class:i.classTable,loading:a.loading,columns:r(),data:a.tableList},{empty:()=>e(Fe,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:b,sync:!0},null)])]),e(L,{maskClosable:Y,show:a.detailVisiable,"onUpdate:show":t=>a.detailVisiable=t,preset:"card",class:["modalTitle background",i.wordDetailModel],title:"作业详情"},{default:()=>[e(Be,{ref:m,onClose:()=>a.detailVisiable=!1,total:a.tableList.length,current:a.index,activeRow:a.activeRow},null)]})])}}),oa=A({name:"studentDetail",setup(a,{emit:v}){const m=w({studentInfo:{avatar:"",nickname:"",gender:null,subjectNames:"",classInstrumentName:"",classGroupName:""}}),c=g("baseInfo"),o=x();console.log(o.meta.isClass);const l=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"}]),b=async()=>{console.log(o.query.studentId);try{const r=await K({id:o.query.studentId});m.studentInfo={...r.data}}catch(r){console.log(r)}};S(()=>{b()}),ke(r=>{r.form.tabName&&(c.value=r.form.tabName)});const h=r=>{Ne(r,"tabName",o)};return()=>e("div",null,[e(te,{list:l.value},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:m.studentInfo.avatar?m.studentInfo.avatar:q,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",{class:n.studentGender},[m.studentInfo.nickname," ",e(C,{previewDisabled:!0,src:m.studentInfo.gender?se:le},null)]),e("p",null,[m.studentInfo.classGroupName," ",m.studentInfo.classInstrumentName?"| "+m.studentInfo.classInstrumentName:" "])])]),e(ae,{"onUpdate:value":[r=>h(r),r=>c.value=r],class:n.customTabs,value:c.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(E,{name:"baseInfo",tab:"基本信息"},{default:()=>[e(Ee,{studentInfo:m.studentInfo},null)]}),e(E,{name:"afterWork",tab:"课后作业"},{default:()=>[e(Ae,null,null)]}),e(E,{name:"textRcode",tab:"练习记录"},{default:()=>[e(ne,{studentId:o.query.studentId},null)]}),e(E,{name:"evaluatingRcode",tab:"评测记录"},{default:()=>[e(ue,{studentId:o.query.studentId},null)]})]})])])}});export{oa as default};