1 |
- import{s as r}from"./index.module-2dcd19b9-1715235715601.js";import{o as O,p as z}from"./api-55aee601-1715235715601.js";import{d as S,a as Y,b as K,r as g,e as N,y as _,p as A,f as e,N as R,ay as Q,az as T,g as D,h as L,G as F,w as B,j as I,k as p,l as x,C as X,v as w,M as k,x as Z,aE as J,q as ee,t as E}from"./index-87f0ccd8-1715235715601.js";import{C as ae}from"./index-d2e27601-1715235715601.js";import{d as H}from"./teacherIcon-b8e3946d-1715235715601.js";import{m as te,f as se}from"./maleIcon-3fe0e51e-1715235715601.js";import{P as ne,E as le}from"./evaluationRecords-b1604316-1715235715601.js";import{s as i}from"./index.module-fd323afa-1715235715601.js";import{a as ue,r as re,b as ie}from"./api-d06a41d0-1715235715601.js";import{g as oe,c as de}from"./contants-0dd30099-1715235715601.js";import{C as ce}from"./index-0d13e876-1715235715601.js";import{P as me}from"./index-dfb57ae1-1715235715601.js";import{C as pe}from"./index-c3ad7647-1715235715601.js";import{g as M,a as U,b as fe}from"./dateFormat-0254bd54-1715235715601.js";import{t as ge}from"./searchArray-2151d9dd-1715235715601.js";import{T as ve}from"./index-f38970b6-1715235715601.js";import{n as he,u as be,q as De,C as Ie}from"./index-e2c84908-1715235715601.js";import{p as ye}from"./index-5b28f511-1715235715601.js";import{N as Te}from"./Scrollbar-9e37a29f-1715235715601.js";import{T as we}from"./index-d2b77ddd-1715235715601.js";import{i as Ce,s as G,g as Ne,a as ke}from"./use-async-545e8290-1715235715601.js";import"./useECharts-75af52e2-1715235715601.js";import"./index-a7d62168-1715235715601.js";import"./NumberAnimation-b7b6a6bc-1715235715601.js";import"./urlUtils-ae95598a-1715235715601.js";import"./index-4c0a6eac-1715235715601.js";import"./Slider-a113e213-1715235715601.js";import"./icon_default-d1bcaf5f-1715235715601.js";import"./icon-plus-t-35f4cdeb-1715235715601.js";import"./api-d1a4d565-1715235715601.js";import"./icon-pan-16e35a82-1715235715601.js";import"./api-86302a73-1715235715601.js";const Fe=S({name:"setting-personInfo",props:{studentInfo:{type:Object,default:()=>({nickname:"",currentGradeNum:"",gender:null,phone:"",id:"",currentClass:""})}},setup(a){const v=Y(),c=K(),d=g(),o=N({sexs:[{label:"男",value:1,class:"option"},{label:"女",value:0,class:"option"}],areaList:[]}),l=g(),h=g(!1),b=g(oe()),u=g([]),t=g(a.studentInfo.historyClassStudent||""),f=()=>a.studentInfo.currentGradeNum?b.value.findIndex(C=>C.value===a.studentInfo.currentGradeNum)===-1?null:a.studentInfo.currentGradeNum:null,y=s=>{u.value.findIndex(P=>P.value===s)===-1&&s&&u.value.push({label:s,value:s})},n=N({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}),q=g([...de]),m=N({disabled:!0,openChangePwd:!1,uploadShow:!0});_(()=>a.studentInfo,s=>{n.nickname=s.nickname,n.phone=s.phone,n.gender=s.gender,n.id=s.id,n.currentGradeNum=f(),n.currentClass=s.currentClass,n.gradeYear=s.gradeYear,console.log(a.studentInfo,"props.studentInfo"),y(s.gradeYear)}),A(async()=>{await V(),y(a.studentInfo.gradeYear)});const W=()=>{d.value=!0,l.value.validate(async s=>{if(!s)try{await re({...a.studentInfo,...n}),m.disabled=!0,c.success("修改成功"),d.value=!1,h.value=!1}catch(C){d.value=!1}})},$=()=>{n.nickname=a.studentInfo.nickname,n.phone=a.studentInfo.phone,n.gender=a.studentInfo.gender,n.currentGradeNum=f(),n.currentClass=a.studentInfo.currentClass,n.gradeYear=a.studentInfo.gradeYear,m.disabled=!0},V=async()=>{try{const{data:s}=await ue({}),C=[{label:s+1,value:s+1},{label:s,value:s}];u.value=C}catch(s){}},j=s=>!s||/^\d+$/.test(s);return()=>e("div",{class:i.infoWrap},[e("div",{class:i.setInfo},[e(R,{ref:l,model:n,disabled:m.disabled},{default:()=>[e(Q,{cols:4,"x-gap":"100"},{default:()=>[e(T,null,{default:()=>[e(D,{label:"姓名",path:"nickname",rule:{required:!0,message:"请填写学生姓名",trigger:"blur"}},{default:()=>[e(L,{maxlength:15,bordered:!m.disabled,placeholder:"请填写学生姓名",value:n.nickname,"onUpdate:value":s=>n.nickname=s},null)]})]}),e(T,null,{default:()=>[e(D,{label:"手机号",path:"phone",rule:[{required:!0,message:"请填写学生手机号",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"手机号格式不正确",trigger:"blur"}]},{default:()=>[e(L,{maxlength:11,allowInput:j,bordered:!m.disabled,placeholder:"请填写学生手机号",value:n.phone,"onUpdate:value":s=>n.phone=s},null)]})]}),e(T,null,{default:()=>[e(D,{label:"性别",path:"sex"},{default:()=>[e(F,{bordered:!m.disabled,class:i.select,showArrow:!m.disabled,placeholder:"请选择性别",options:o.sexs,value:n.gender,"onUpdate:value":s=>n.gender=s},null)]})]}),e(T,null,{default:()=>[e(D,{label:"学年",path:""},{default:()=>[e(F,{bordered:!m.disabled,class:i.select,showArrow:!m.disabled,placeholder:"请选择学年",options:u.value,value:n.gradeYear,"onUpdate:value":s=>n.gradeYear=s},null)]})]}),e(T,null,{default:()=>[e(D,{label:"年级",path:""},{default:()=>[e(F,{bordered:!m.disabled,class:i.select,showArrow:!m.disabled,placeholder:"请选择年级",options:b.value,value:n.currentGradeNum,"onUpdate:value":s=>n.currentGradeNum=s},null)]})]}),e(T,null,{default:()=>[e(D,{label:"班级",path:""},{default:()=>[e(F,{bordered:!m.disabled,class:i.select,showArrow:!m.disabled,placeholder:"请选择班级",options:q.value,value:n.currentClass,"onUpdate:value":s=>n.currentClass=s},null)]})]})]})]})]),m.disabled?!n.upgradeFlag&&e(B,{class:i.btnList,align:"center",justify:"end"},{default:()=>[e(I,{class:i.btn,strong:!0,color:"#f24433",disabled:!!t.value,onClick:()=>m.disabled=!1},{default:()=>[p("修改信息")]})]}):e(B,{class:i.btnList,align:"center",justify:"end"},{default:()=>[e(I,{class:i.btn,onClick:()=>$()},{default:()=>[p("取消")]}),e(I,{class:i.btn,type:"primary",onClick:()=>h.value=!0},{default:()=>[p("完成")]})]}),e(x,{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,[p("是否确认修改学员信息")]),e(B,{class:i.btnGroup,justify:"center"},{default:()=>[e(I,{round:!0,type:"primary",onClick:W,loading:d.value},{default:()=>[p("确定")]}),e(I,{round:!0,onClick:()=>h.value=!1},{default:()=>[p("取消")]})]})])]})])}}),Ee=S({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:c}){const d=g(!1),o=g(!1),l=g({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]}),h=(u,t)=>{let f=[];return u==="EVALUATION"?f=["".concat(ye[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 u=>{o.value=!0;try{const t=await O({studentLessonTrainingId:u}),f=t.data.studentLessonTrainingDetails.map(y=>{const n=h(y.trainingType,JSON.parse(y.trainingContent));return{...y,coverImg:y.titleImg,allTimes:JSON.parse(y.trainingContent).trainingTimes,typeList:n||[]}});l.value={...t.data,studentLessonTrainingDetails:f},console.log(l.value," teacherInfo.value")}catch(t){console.log(t)}o.value=!1};return c({getTrainingDetail:b}),A(()=>{b(a.activeRow.id)}),()=>e("div",{class:[r.trainingDetails]},[e(X,{show:o.value},{default:()=>[e("div",{class:r.studentList},[e("div",{class:r.studentHeaderWrap},[e("div",{class:r.studentHeader},[e("div",{class:r.studentHeaderBorder},[e(w,{class:r.studentHeaderImg,src:l.value.teacherAvatar?l.value.teacherAvatar:H,previewDisabled:!0},null)])]),e("div",{class:r.workafterInfo},[e("h4",null,[l.value.teacherName," ",e("div",{class:[r.workafterInfoDot,r.workafterTeacherInfoDot]},[p("老师")])]),e("p",null,[p("开始时间:"),l.value.createTime?k(new Date(l.value.createTime)).format("YYYY-MM-DD HH:mm"):"--"," ",p("| 结束时间:"),l.value.expireDate?k(new Date(l.value.expireDate)).format("YYYY-MM-DD HH:mm"):"--"])])]),l.value.trainingStatus=="UNSUBMITTED"?e(w,{previewDisabled:!0,class:r.workStatus,src:he},null):null,l.value.trainingStatus=="SUBMITTED"?e(w,{previewDisabled:!0,class:r.workStatus,src:be},null):null,l.value.trainingStatus=="TARGET"?e(w,{previewDisabled:!0,class:r.workStatus,src:De},null):null]),l.value.trainingStatus!=="UNSUBMITTED"&&e(I,{onClick:()=>d.value=!0,class:r.commentBtnGroup},{default:()=>[e("div",{class:r.text},[e("i",{class:l.value.comment&&r.look},null),l.value.comment?"查看评语":"点评作业"])]}),e(Te,{style:"max-height:400px",trigger:"none"},{default:()=>[e("div",{class:r.workList},[l.value.studentLessonTrainingDetails.map(u=>e(ve,{style:{marginBottom:"20px"},isDisabled:!0,isDelete:!1,isCLassWork:!1,item:u},null))])]})]}),e(x,{show:d.value,"onUpdate:show":u=>d.value=u},{default:()=>[e(Ie,{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:()=>d.value=!1,onConfrim:()=>{b(a.activeRow.id),d.value=!1}},null)]})])}}),Be=S({name:"student-studentList",setup(){const a=N({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())]),c=g(),d=Y(),o=()=>{a.pagination.page=1,h(),G({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork"})},l=()=>{a.searchForm={keyword:"",trainingStatus:""},v.value=[M(new Date().getTime()),U(new Date().getTime())],o(),G({current:{...a.searchForm,timer:v.value},saveKey:"studentDetailAfterWork"})};Ce({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 ie({studentId:d.query.studentId,...a.searchForm,...a.pagination,...fe(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};A(()=>{h()});const u=()=>[{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"}},[p("未提交")]):null,t.trainingStatus=="SUBMITTED"?e("p",{style:{color:"#EA4132"},class:i.ison},[p("不合格")]):null,t.trainingStatus=="TARGET"?e("p",{class:i.isok},[p("合格")]):null])}},{title:"操作",key:"id",render(t,f){return e(I,{text:!0,type:"primary",onClick:()=>{b(t,f)}},{default:()=>[p("详情")]})}}];return()=>e("div",null,[e("div",null,[e("div",{class:i.searchList},[e(R,{"label-placement":"left",inline:!0},{default:()=>[e(D,null,{default:()=>[e(pe,{value:v.value,"onUpdate:value":t=>v.value=t,separator:"至",type:"daterange",timerValue:v.value},null)]}),e(D,null,{default:()=>[e(ce,Z({options:[{label:"全部状态",value:""},...ge],placeholder:"提交状态",clearable:!0,inline:!0},{value:a.searchForm.trainingStatus,"onUpdate:value":t=>a.searchForm.trainingStatus=t}),null)]}),e(D,null,{default:()=>[e(B,{justify:"end"},{default:()=>[e(I,{type:"primary",class:"searchBtn",onClick:o},{default:()=>[p("搜索")]}),e(I,{type:"primary",ghost:!0,class:"resetBtn",onClick:l},{default:()=>[p("重置")]})]})]})]})]),e("div",null,[e(J,{class:i.classTable,loading:a.loading,columns:u(),data:a.tableList},{empty:()=>e(we,null,null)}),e(me,{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(x,{show:a.detailVisiable,"onUpdate:show":t=>a.detailVisiable=t,preset:"card",class:["modalTitle background",i.wordDetailModel],title:"作业详情"},{default:()=>[e(Ee,{ref:c,onClose:()=>a.detailVisiable=!1,total:a.tableList.length,current:a.index,activeRow:a.activeRow},null)]})])}}),ia=S({name:"studentDetail",setup(a,{emit:v}){const c=N({studentInfo:{avatar:"",nickname:"",gender:null,subjectNames:"",classInstrumentName:"",classGroupName:""}}),d=g("baseInfo"),o=Y();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"}]),h=async()=>{console.log(o.query.studentId);try{const u=await z({id:o.query.studentId});c.studentInfo={...u.data}}catch(u){console.log(u)}};A(()=>{h()}),Ne(u=>{u.form.tabName&&(d.value=u.form.tabName)});const b=u=>{ke(u,"tabName",o)};return()=>e("div",null,[e(ae,{list:l.value},null),e("div",{class:[r.listWrap,r.infoListWrap]},[e("div",{class:r.teacherList},[e("div",{class:r.teacherHeader},[e("div",{class:r.teacherHeaderBorder},[e(w,{class:r.teacherHeaderImg,src:c.studentInfo.avatar?c.studentInfo.avatar:H,previewDisabled:!0},null)])]),e("div",{class:r.workafterInfo},[e("h4",{class:r.studentGender},[c.studentInfo.nickname," ",e(w,{previewDisabled:!0,src:c.studentInfo.gender?te:se},null)]),e("p",null,[c.studentInfo.classGroupName," ",c.studentInfo.classInstrumentName?"| "+c.studentInfo.classInstrumentName:" "])])]),e(ee,{"onUpdate:value":[u=>b(u),u=>d.value=u],class:r.customTabs,value:d.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(Fe,{studentInfo:c.studentInfo},null)]}),e(E,{name:"afterWork",tab:"课后作业"},{default:()=>[e(Be,null,null)]}),e(E,{name:"textRcode",tab:"练习记录"},{default:()=>[e(ne,{studentId:o.query.studentId},null)]}),e(E,{name:"evaluatingRcode",tab:"评测记录"},{default:()=>[e(le,{studentId:o.query.studentId},null)]})]})])])}});export{ia as default};
|