afterWorkDetail-d644650f-1706107518515.js 7.4 KB

1
  1. import{s as n}from"./index.module-d1ab12c4-1706107518515.js";import{S as B}from"./index-1bef9b8b-1706107518515.js";import{C as M}from"./index-c6880faf-1706107518515.js";import{P as Y}from"./index-59887fdc-1706107518515.js";import{o as R,q as U,s as q}from"./api-335a4374-1706107518515.js";import{d as S,e as L,r as m,b as V,p as N,f as e,v as g,k as i,K as v,w as y,j as f,a as W,N as H,g as h,x as b,cc as $,l as j}from"./index-18b8b0d9-1706107518515.js";import{C as P}from"./index-8c7a15dc-1706107518515.js";import{d as F}from"./teacherIcon-b8e3946d-1706107518515.js";import{g as k,a as I}from"./dateFormat-1d18260e-1706107518515.js";import{t as O}from"./searchArray-45783419-1706107518515.js";import{T as G}from"./index-d4104e6e-1706107518515.js";import{n as z,u as K,q as Q}from"./unqualified-8d139e02-1706107518515.js";import{N as X,j as Z}from"./api-2baae04f-1706107518515.js";import{T as _}from"./index-1aaceba7-1706107518515.js";import"./urlUtils-880ab4ad-1706107518515.js";import"./Slider-c3c0528e-1706107518515.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(o,{emit:D,expose:t}){L({uploading:!1});const r=m({studentName:"",submitTime:"",trainingStatus:"",studentAvatar:"",studentLessonTrainingDetails:[]});V(),m();const p=(d,s)=>{let c=[];return d==="EVALUATION"?c=["".concat(Z[s.evaluateDifficult]),s.practiceChapterBegin||s.practiceChapterEnd?"".concat(s.practiceChapterBegin,"-").concat(s.practiceChapterEnd,"小节"):"全部小节","".concat(s.trainingTimes,"分合格")]:c=["".concat(s.practiceChapterBegin,"-").concat(s.practiceChapterEnd,"小节"),"速度".concat(s.practiceSpeed),"".concat(s.trainingTimes,"分钟")],c},u=async d=>{try{const s=await R({studentLessonTrainingId:d}),c=s.data.studentLessonTrainingDetails.map(l=>{const w=p(l.trainingType,JSON.parse(l.trainingContent));return{...l,coverImg:l.titleImg,allTimes:JSON.parse(l.trainingContent).trainingTimes,typeList:w||[]}});r.value={...s.data,studentLessonTrainingDetails:c}}catch(s){console.log(s)}};return t({getTrainingDetail:u}),N(()=>{u(o.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(g,{class:n.studentHeaderImg,src:r.value.studentAvatar?r.value.studentAvatar:F,previewDisabled:!0},null)])]),e("div",{class:n.workafterInfo},[e("h4",null,[r.value.studentName," ",e("div",{class:n.workafterInfoDot},[i("学生")])]),e("p",null,[i("提交时间:"),r.value.submitTime?v(new Date(r.value.submitTime)).format("YYYY-MM-DD"):"--"])])]),r.value.trainingStatus=="UNSUBMITTED"?e(g,{previewDisabled:!0,class:n.workStatus,src:z},null):null,r.value.trainingStatus=="SUBMITTED"?e(g,{previewDisabled:!0,class:n.workStatus,src:K},null):null,r.value.trainingStatus=="TARGET"?e(g,{previewDisabled:!0,class:n.workStatus,src:Q},null):null]),e(X,{style:"max-height:400px",trigger:"none"},{default:()=>[e("div",{class:n.workList},[r.value.studentLessonTrainingDetails.map(d=>e(G,{style:{marginBottom:"20px"},isDisabled:!0,isDelete:!1,item:d},null))])]}),e(y,{class:[n.btnGroups,n.nextWrap],justify:"space-between"},{default:()=>[e("div",{class:n.allTotal},[o.current,i("/"),o.total,i("名学生")]),e("div",null,[e(y,null,{default:()=>[e(f,{disabled:o.current<=1,round:!0,type:"primary",onClick:()=>{D("pre")}},{default:()=>[i("上一名")]}),e(f,{disabled:o.current>=o.total,round:!0,type:"primary",onClick:()=>{D("next")}},{default:()=>[i("下一名")]})]})])]})])}}),Te=S({name:"student-studentList",setup(o,{emit:D}){const t=L({searchForm:{keyword:"",trainingStatus:""},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],workInfo:{createTime:"",expireDate:"",teacherAvatar:"",teacherName:""},detailVisiable:!1,activeRow:null,index:0}),r=m([k(new Date().getTime()),I(new Date().getTime())]),p=m(),u=W(),d=m([{name:"班级管理",path:"/classList"},{name:u.query.name,path:"/classDetail"},{name:u.query.teacherName,path:"/afterWorkDetail"}]),s=()=>{t.pagination.page=1,l(),console.log("search",t)},c=()=>{t.searchForm={keyword:"",trainingStatus:""},r.value=[k(new Date().getTime()),I(new Date().getTime())],s()},l=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 q({trainingId:u.query.trainingId});t.workInfo={...a.data}}catch(a){console.log(a)}},C=(a,T)=>{console.log(T,"index"),t.index=T+1,t.activeRow=a,t.detailVisiable=!0};N(()=>{w(),l()});const x=()=>[{title:"学生姓名",key:"studentName"},{title:"最后提交时间",key:"submitTime",render(a){return a.submitTime?v(a.submitTime).format("YYYY-MM-DD"):"--"}},{title:"作业状态",key:"sex",render(a){return e("div",null,[a.trainingStatus=="UNSUBMITTED"?e("p",{class:n.nosub},[i("未提交")]):null,a.trainingStatus=="SUBMITTED"?e("p",{class:n.ison},[i("不合格")]):null,a.trainingStatus=="TARGET"?e("p",{class:n.isok},[i("合格")]):null])}},{title:"操作",key:"id",render(a,T){return e(f,{text:!0,type:"primary",onClick:()=>{C(a,T)}},{default:()=>[i("详情")]})}}],E=()=>{++t.index,t.activeRow=t.tableList[t.index-1],p.value.getTrainingDetail(t.activeRow.studentLessonTrainingId)},A=()=>{--t.index,t.activeRow=t.tableList[t.index-1],p.value.getTrainingDetail(t.activeRow.studentLessonTrainingId)};return()=>e("div",null,[e(P,{list:d.value},null),e("div",{class:n.listWrap},[e("div",{class:n.teacherList},[e("div",{class:n.teacherHeader},[e("div",{class:n.teacherHeaderBorder},[e(g,{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,[i("布置时间:"),v(t.workInfo.createTime).format("YYYY-MM-DD"),i(" |")," ",e("span",null,[i("截止时间:"),v(t.workInfo.expireDate).format("YYYY-MM-DD")])])])]),e("div",{class:n.searchList},[e(H,{"label-placement":"left",inline:!0},{default:()=>[e(h,null,{default:()=>[e(B,b({placeholder:"请输入学生姓名"},{class:n.searchInput,searchWord:t.searchForm.keyword,onChangeValue:a=>t.searchForm.keyword=a}),null)]}),e(h,null,{default:()=>[e(M,b({options:[{label:"全部状态",value:""},...O],placeholder:"作业状态",clearable:!0,inline:!0},{value:t.searchForm.trainingStatus,"onUpdate:value":a=>t.searchForm.trainingStatus=a}),null)]}),e(h,null,{default:()=>[e(y,{justify:"end"},{default:()=>[e(f,{type:"primary",class:"searchBtn",onClick:s},{default:()=>[i("搜索")]}),e(f,{type:"primary",ghost:!0,class:"resetBtn",onClick:c},{default:()=>[i("重置")]})]})]})]})]),e("div",{class:n.tableWrap},[e($,{class:n.classTable,loading:t.loading,columns:x(),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:l,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:()=>E(),onPre:()=>A(),ref:p,onClose:()=>t.detailVisiable=!1,total:t.tableList.length,current:t.index,activeRow:t.activeRow},null)]})])}});export{Te as default};