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