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