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