afterWorkDetail-c4526041-1694078809672.js 7.3 KB

1
  1. import{s as n}from"./index.module-c55c31aa-1694078809672.js";import{S as B}from"./index-e67d25d4-1694078809672.js";import{C as M}from"./index-61124a6f-1694078809672.js";import{P as Y}from"./index-1a2d0654-1694078809672.js";import{n as R,p as U,q as V}from"./api-89d51472-1694078809672.js";import{d as S,e as L,r as m,b as q,n as N,f as e,t as p,k as s,V as T,w as h,j as f,a as W,N as H,g as y,x as b,c9 as $,v as j}from"./index-ce8959eb-1694078809672.js";import{C as P}from"./index-a9360116-1694078809672.js";import{d as F}from"./teacherIcon-b8e3946d-1694078809672.js";import{g as k,a as I}from"./dateFormat-d2ac9a16-1694078809672.js";import{t as O}from"./searchArray-59dcc700-1694078809672.js";import{T as G}from"./index-a771a6b5-1694078809672.js";import{n as z,u as K,q as Q}from"./unqualified-8d139e02-1694078809672.js";import{N as X,e as Z}from"./contants-ee65eda7-1694078809672.js";import{T as _}from"./index-b4d77148-1694078809672.js";import"./Slider-0c64af90-1694078809672.js";const J=S({props:{activeRow:{type:Object,default:()=>({studentLessonTrainingId:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"TrainingDetails",emits:["close","next","pre"],setup(d,{emit:D,expose:t}){L({uploading:!1});const l=m({studentName:"",submitTime:"",trainingStatus:"",studentAvatar:"",studentLessonTrainingDetails:[]});q(),m();const g=(c,i)=>{let r=[];return c==="EVALUATION"?(r=[`${Z[i.evaluateDifficult]}`,"全部小节",`${i.trainingTimes}分合格`],console.log("configJson.evaluateDifficult--",r)):(r=[`${i.practiceChapterBegin}-${i.practiceChapterEnd}小节`,`速度${i.practiceSpeed}`,`${i.trainingTimes}分钟`],console.log("configJson.evaluateDifficult",r)),r},u=async c=>{try{const i=await R({studentLessonTrainingId:c}),r=i.data.studentLessonTrainingDetails.map(o=>{const w=g(o.trainingType,JSON.parse(o.trainingContent));return{...o,coverImg:o.titleImg,allTimes:JSON.parse(o.trainingContent).trainingTimes,typeList:w||[]}});l.value={...i.data,studentLessonTrainingDetails:r}}catch(i){console.log(i)}};return t({getTrainingDetail:u}),N(()=>{u(d.activeRow.studentLessonTrainingId)}),()=>e("div",{class:[n.trainingDetails]},[e("div",{class:n.studentList},[e("div",{class:n.studentHeaderWrap},[e("div",{class:n.studentHeader},[e("div",{class:n.studentHeaderBorder},[e(p,{class:n.studentHeaderImg,src:l.value.studentAvatar?l.value.studentAvatar:F,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",null,[l.value.studentName," ",e("div",{class:n.workafterInfoDot},[s("学生")])]),e("p",null,[s("提交时间:"),l.value.submitTime?T(new Date(l.value.submitTime)).format("YYYY-MM-DD"):"--"])])]),l.value.trainingStatus=="UNSUBMITTED"?e(p,{previewDisabled:!0,class:n.workStatus,src:z},null):null,l.value.trainingStatus=="SUBMITTED"?e(p,{previewDisabled:!0,class:n.workStatus,src:K},null):null,l.value.trainingStatus=="TARGET"?e(p,{previewDisabled:!0,class:n.workStatus,src:Q},null):null]),e(X,{style:"max-height:400px",trigger:"none"},{default:()=>[e("div",{class:n.workList},[l.value.studentLessonTrainingDetails.map(c=>e(G,{style:{marginBottom:"20px"},isDisabled:!0,isDelete:!1,item:c},null))])]}),e(h,{class:[n.btnGroups,n.nextWrap],justify:"space-between"},{default:()=>[e("div",{class:n.allTotal},[d.current,s("/"),d.total,s("名学生")]),e("div",null,[e(h,null,{default:()=>[e(f,{disabled:d.current<=1,round:!0,type:"primary",onClick:()=>{D("pre")}},{default:()=>[s("上一名")]}),e(f,{disabled:d.current>=d.total,round:!0,type:"primary",onClick:()=>{D("next")}},{default:()=>[s("下一名")]})]})])]})])}}),fe=S({name:"student-studentList",setup(d,{emit:D}){const t=L({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=m([k(new Date().getTime()),I(new Date().getTime())]),g=m(),u=W(),c=m([{name:"班级管理",path:"/classList"},{name:u.query.name,path:"/classDetail"},{name:u.query.teacherName,path:"/afterWorkDetail"}]),i=()=>{t.pagination.page=1,o(),console.log("search",t)},r=()=>{t.searchForm={keyword:"",trainingStatus:null},l.value=[k(new Date().getTime()),I(new Date().getTime())],i()},o=async()=>{t.loading=!0;try{const a=await U({trainingId:u.query.trainingId,...t.searchForm,...t.pagination});t.tableList=a.data.rows,t.pagination.pageTotal=a.data.total,t.loading=!1}catch(a){t.loading=!1,console.log(a)}},w=async()=>{console.log(u.query);try{const a=await V({trainingId:u.query.trainingId});t.workInfo={...a.data}}catch(a){console.log(a)}},x=(a,v)=>{console.log(v,"index"),t.index=v+1,t.activeRow=a,t.detailVisiable=!0};N(()=>{w(),o()});const A=()=>[{title:"学生姓名",key:"studentName"},{title:"最后提交时间",key:"submitTime",render(a){return a.submitTime?T(a.submitTime).format("YYYY-MM-DD"):"--"}},{title:"训练状态",key:"sex",render(a){return e("div",null,[a.trainingStatus=="UNSUBMITTED"?e("p",{class:n.nosub},[s("未提交")]):null,a.trainingStatus=="SUBMITTED"?e("p",{class:n.ison},[s("不合格")]):null,a.trainingStatus=="TARGET"?e("p",{class:n.isok},[s("合格")]):null])}},{title:"操作",key:"id",render(a,v){return e(f,{text:!0,type:"primary",onClick:()=>{x(a,v)}},{default:()=>[s("详情")]})}}],C=()=>{++t.index,t.activeRow=t.tableList[t.index-1],g.value.getTrainingDetail(t.activeRow.studentLessonTrainingId)},E=()=>{--t.index,t.activeRow=t.tableList[t.index-1],g.value.getTrainingDetail(t.activeRow.studentLessonTrainingId)};return()=>e("div",null,[e(P,{list:c.value},null),e("div",{class:n.listWrap},[e("div",{class:n.teacherList},[e("div",{class:n.teacherHeader},[e("div",{class:n.teacherHeaderBorder},[e(p,{class:n.teacherHeaderImg,src:t.workInfo.teacherAvatar?t.workInfo.teacherAvatar:F,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",null,[t.workInfo.teacherName]),e("p",null,[s("布置时间:"),T(t.workInfo.createTime).format("YYYY-MM-DD"),s(" |")," ",e("span",null,[s("截止时间:"),T(t.workInfo.expireDate).format("YYYY-MM-DD")])])])]),e("div",{class:n.searchList},[e(H,{"label-placement":"left",inline:!0},{default:()=>[e(y,null,{default:()=>[e(B,b({placeholder:"请输入学生姓名"},{class:n.searchInput,searchWord:t.searchForm.keyword,onChangeValue:a=>t.searchForm.keyword=a}),null)]}),e(y,null,{default:()=>[e(M,b({options:[{label:"训练状态",value:null},...O],placeholder:"训练状态",clearable:!0,inline:!0},{value:t.searchForm.trainingStatus,"onUpdate:value":a=>t.searchForm.trainingStatus=a}),null)]}),e(y,null,{default:()=>[e(h,{justify:"end"},{default:()=>[e(f,{type:"primary",class:"searchBtn",onClick:i},{default:()=>[s("搜索")]}),e(f,{type:"primary",ghost:!0,class:"resetBtn",onClick:r},{default:()=>[s("重置")]})]})]})]})]),e("div",{class:n.tableWrap},[e($,{class:n.classTable,loading:t.loading,columns:A(),data:t.tableList},{empty:()=>e(_,null,null)}),e(Y,{page:t.pagination.page,"onUpdate:page":a=>t.pagination.page=a,pageSize:t.pagination.rows,"onUpdate:pageSize":a=>t.pagination.rows=a,pageTotal:t.pagination.pageTotal,"onUpdate:pageTotal":a=>t.pagination.pageTotal=a,onList:o,sync:!0},null)])]),e(j,{show:t.detailVisiable,"onUpdate:show":a=>t.detailVisiable=a,preset:"card",class:["modalTitle background",n.wordDetailModel],title:"训练详情"},{default:()=>[e(J,{onNext:()=>C(),onPre:()=>E(),ref:g,onClose:()=>t.detailVisiable=!1,total:t.tableList.length,current:t.index,activeRow:t.activeRow},null)]})])}});export{fe as default};