studentDetail-8b0ea7f1-1724872791500.js 15 KB

1
  1. import{s as l}from"./index.module-7d86a2ea-1724872791500.js";import{o as z,p as K}from"./api-f59ea4cf-1724872791500.js";import{d as A,a as x,b as Q,r as g,e as w,A as _,q as S,f as e,N as H,aA as X,aB as T,g as I,h as G,I as N,x as B,j as y,k as d,l as L,m as Y,E as Z,w as C,Q as k,y as J,aG as ee,t as ae,v as E}from"./index-d5898469-1724872791500.js";import{C as te}from"./index-a2b71fe1-1724872791500.js";import{d as q}from"./teacherIcon-b8e3946d-1724872791500.js";import{m as se,f as ne,P as le,E as ue}from"./evaluationRecords-2bf65e70-1724872791500.js";import{s as i}from"./index.module-c328a753-1724872791500.js";import{a as re,r as ie,b as oe}from"./api-a584700f-1724872791500.js";import{g as de,c as ce}from"./contants-deea6c4d-1724872791500.js";import{C as me}from"./index-8351aa81-1724872791500.js";import{P as pe}from"./index-7c3a1a20-1724872791500.js";import{C as fe}from"./index-5094973b-1724872791500.js";import{g as M,a as U,b as ge}from"./dateFormat-2b5ecfd9-1724872791500.js";import{t as ve}from"./searchArray-7d27a5ef-1724872791500.js";import{n as he,u as be,q as De,W as Ie,C as ye}from"./index-323ee661-1724872791500.js";import{e as Te}from"./contants-81f70019-1724872791500.js";import{N as Ce}from"./Scrollbar-d9cfeed6-1724872791500.js";import{T as Fe}from"./index-81f77935-1724872791500.js";import{i as we,s as R,g as ke,a as Ne}from"./use-async-be187add-1724872791500.js";import"./useECharts-6965a22e-1724872791500.js";import"./index-feb53cac-1724872791500.js";import"./urlUtils-72ef455d-1724872791500.js";import"./index-ba618019-1724872791500.js";import"./Slider-a3783332-1724872791500.js";import"./index-8eefb3e6-1724872791500.js";import"./icon_default-d1bcaf5f-1724872791500.js";import"./useSpeak-6168804b-1724872791500.js";import"./api-06cc7b3f-1724872791500.js";import"./icon-pan-16e35a82-1724872791500.js";import"./api-8001726c-1724872791500.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=Q(),c=g(),o=w({sexs:[{label:"男",value:1,class:"option"},{label:"女",value:0,class:"option"}],areaList:[]}),n=g(),h=g(!1),b=g(de()),r=g([]),t=g(a.studentInfo.historyClassStudent||""),f=()=>a.studentInfo.currentGradeNum?b.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});_(()=>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 j(),D(a.studentInfo.gradeYear)});const $=()=>{c.value=!0,n.value.validate(async s=>{if(!s)try{await ie({...a.studentInfo,...u}),p.disabled=!0,m.success("修改成功"),c.value=!1,h.value=!1}catch(F){c.value=!1}})},V=()=>{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},j=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:n,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(G,{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(G,{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:b.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:()=>V()},{default:()=>[d("取消")]}),e(y,{class:i.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",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:()=>h.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),n=g({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]}),h=(r,t)=>{let f=[];return r==="EVALUATION"?f=["".concat(Te[t.evaluateDifficult]),t.practiceChapterBegin||t.practiceChapterEnd?"".concat(t.practiceChapterBegin,"-").concat(t.practiceChapterEnd,"小节"):"全部小节","".concat(t.trainingTimes,"分合格")]:f=["".concat(t.practiceChapterBegin,"-").concat(t.practiceChapterEnd,"小节"),"速度".concat(t.practiceSpeed),"".concat(t.trainingTimes,"分钟")],f},b=async r=>{o.value=!0;try{const t=await z({studentLessonTrainingId:r}),f=t.data.studentLessonTrainingDetails.map(D=>{const u=h(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||[]}});n.value={...t.data,studentLessonTrainingDetails:f},console.log(n.value," teacherInfo.value")}catch(t){console.log(t)}o.value=!1};return m({getTrainingDetail:b}),S(()=>{b(a.activeRow.id)}),()=>e("div",{class:[l.trainingDetails]},[e(Z,{show:o.value},{default:()=>[e("div",{class:l.studentList},[e("div",{class:l.studentHeaderWrap},[e("div",{class:l.studentHeader},[e("div",{class:l.studentHeaderBorder},[e(C,{class:l.studentHeaderImg,src:n.value.teacherAvatar?n.value.teacherAvatar:q,previewDisabled:!0},null)])]),e("div",{class:l.workafterInfo},[e("h4",null,[n.value.teacherName," ",e("div",{class:[l.workafterInfoDot,l.workafterTeacherInfoDot]},[d("老师")])]),e("p",null,[d("开始时间:"),n.value.createTime?k(new Date(n.value.createTime)).format("YYYY-MM-DD HH:mm"):"--"," ",d("| 结束时间:"),n.value.expireDate?k(new Date(n.value.expireDate)).format("YYYY-MM-DD HH:mm"):"--"])]),n.value.trainingStatus=="UNSUBMITTED"?e(C,{previewDisabled:!0,class:l.workStatus,src:he},null):null,n.value.trainingStatus=="SUBMITTED"?e(C,{previewDisabled:!0,class:l.workStatus,src:be},null):null,n.value.trainingStatus=="TARGET"?e(C,{previewDisabled:!0,class:l.workStatus,src:De},null):null]),n.value.expireFlag&&e(y,{onClick:()=>c.value=!0,class:l.commentBtnGroup},{default:()=>[e("div",{class:l.text},[e("i",{class:n.value.comment&&l.look},null),n.value.comment?"修改点评":"点评作业"])]})]),(n.value.fileExpireDay||0)>0&&e("div",{class:l.expireDateTip},[e("i",{class:l.expireDateIcon},null),e("span",null,[d("作业截止"),n.value.fileExpireDay||0,d("天后,学生上传的文件将过期,请及时查看")])]),e(Ce,{style:"max-height:400px;min-height: 260px;",trigger:"none"},{default:()=>[e("div",{class:l.workList},[n.value.studentLessonTrainingDetails.map(r=>e(Ie,{style:{marginBottom:"20px"},item:{...r,studentName:n.value.studentName}},null))]),n.value.comment&&e("div",{class:l.commentSection},[e("h3",null,[e("i",{class:l.iconComment},null),e("i",{class:l.myText},null)]),e("div",{class:l.commentContent},[n.value.comment])])]})]}),e(L,{maskClosable:Y,show:c.value,"onUpdate:show":r=>c.value=r},{default:()=>[e(ye,{comment:n.value.comment,workInfo:{isLook:!!n.value.comment,studentAvatar:n.value.studentAvatar,studentName:n.value.studentName,submitTime:n.value.submitTime,studentLessonTrainingId:n.value.studentLessonTrainingId},onClose:()=>c.value=!1,onConfrim:()=>{b(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([M(new Date().getTime()),U(new Date().getTime())]),m=g(),c=x(),o=()=>{a.pagination.page=1,h(),R({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork"})},n=()=>{a.searchForm={keyword:"",trainingStatus:""},v.value=[M(new Date().getTime()),U(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 h=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)}},b=(t,f)=>{console.log(f,"index"),a.index=f+1,a.activeRow=t,a.detailVisiable=!0};S(()=>{h()});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:()=>{b(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:n},{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:h,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)]})])}}),ra=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 n=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"}]),h=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(()=>{h()}),ke(r=>{r.form.tabName&&(c.value=r.form.tabName)});const b=r=>{Ne(r,"tabName",o)};return()=>e("div",null,[e(te,{list:n.value},null),e("div",{class:[l.listWrap,l.infoListWrap]},[e("div",{class:l.teacherList},[e("div",{class:l.teacherHeader},[e("div",{class:l.teacherHeaderBorder},[e(C,{class:l.teacherHeaderImg,src:m.studentInfo.avatar?m.studentInfo.avatar:q,previewDisabled:!0},null)])]),e("div",{class:l.workafterInfo},[e("h4",{class:l.studentGender},[m.studentInfo.nickname," ",e(C,{previewDisabled:!0,src:m.studentInfo.gender?se:ne},null)]),e("p",null,[m.studentInfo.classGroupName," ",m.studentInfo.classInstrumentName?"| "+m.studentInfo.classInstrumentName:" "])])]),e(ae,{"onUpdate:value":[r=>b(r),r=>c.value=r],class:l.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(le,{studentId:o.query.studentId},null)]}),e(E,{name:"evaluatingRcode",tab:"评测记录"},{default:()=>[e(ue,{studentId:o.query.studentId},null)]})]})])])}});export{ra as default};