TrainingDetails-a0e4132a-1716977058336.js 4.3 KB

1
  1. import{o as w}from"./api-ca0eac7b-1716977058336.js";import{s as t}from"./index.module-18dca782-1716977058336.js";import{d as N}from"./teacherIcon-b8e3946d-1716977058336.js";import{n as F,u as L,q as b,W as y,C as E}from"./index-1963cb23-1716977058336.js";import{e as I}from"./index-a5c2a8ef-1716977058336.js";import{d as S,r as p,p as h,f as e,D as k,v as o,k as u,O as A,j as c,U as B,w as T,l as x}from"./index-70c8ab8f-1716977058336.js";import{N as M}from"./Scrollbar-dc599640-1716977058336.js";const R=S({props:{activeRow:{type:Object,default:()=>({studentLessonTrainingId:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"TrainingDetails",emits:["close","next","pre"],setup(l,{emit:f,expose:g}){const m=p(!1),a=p({studentName:"",submitTime:"",trainingStatus:"",studentAvatar:"",studentLessonTrainingDetails:[]}),r=p(!1),D=(n,s)=>{let d=[];return n==="EVALUATION"?d=["".concat(I[s.evaluateDifficult]),s.practiceChapterBegin||s.practiceChapterEnd?"".concat(s.practiceChapterBegin,"-").concat(s.practiceChapterEnd,"小节"):"全部小节","".concat(s.trainingTimes,"分合格")]:d=["".concat(s.practiceChapterBegin,"-").concat(s.practiceChapterEnd,"小节"),"速度".concat(s.practiceSpeed),"".concat(s.trainingTimes,"分钟")],d},v=async n=>{m.value=!0;try{const s=await w({studentLessonTrainingId:n}),d=s.data.studentLessonTrainingDetails.map(i=>{const C=D(i.trainingType,JSON.parse(i.trainingContent));return{...i,coverImg:i.titleImg,fileList:i.fileJsonList&&i.fileJsonList[0]||{},allTimes:JSON.parse(i.trainingContent).trainingTimes,typeList:C||[]}});a.value={...s.data,studentLessonTrainingDetails:d}}catch(s){console.log(s)}m.value=!1};return g({getTrainingDetail:v}),h(()=>{v(l.activeRow.studentLessonTrainingId)}),()=>e("div",{class:[t.trainingDetails]},[e(k,{show:m.value},{default:()=>[e("div",{class:t.studentList},[e("div",{class:t.studentHeaderWrap},[e("div",{class:t.studentHeader},[e("div",{class:t.studentHeaderBorder},[e(o,{class:t.studentHeaderImg,src:a.value.studentAvatar?a.value.studentAvatar:N,previewDisabled:!0},null)])]),e("div",{class:t.workafterInfo},[e("h4",null,[a.value.studentName," ",e("div",{class:t.workafterInfoDot},[u("学生")])]),e("p",null,[u("提交时间:"),a.value.submitTime?A(new Date(a.value.submitTime)).format("YYYY-MM-DD"):"--"])]),a.value.trainingStatus=="UNSUBMITTED"?e(o,{previewDisabled:!0,class:t.workStatus,src:F},null):null,a.value.trainingStatus=="SUBMITTED"?e(o,{previewDisabled:!0,class:t.workStatus,src:L},null):null,a.value.trainingStatus=="TARGET"?e(o,{previewDisabled:!0,class:t.workStatus,src:b},null):null]),a.value.expireFlag?e(c,{onClick:()=>r.value=!0,class:t.commentBtnGroup},{default:()=>[e("div",{class:t.text},[e("i",null,null),a.value.comment?"修改点评":"点评作业"])]}):e(B,{showArrow:!1},{trigger:()=>e(c,{disabled:!0,onClick:()=>r.value=!0,class:t.commentBtnGroup},{default:()=>[e("div",{class:t.text},[e("i",null,null),a.value.comment?"修改点评":"点评作业"])]}),default:"作业截止后可点评作业"})]),(a.value.fileExpireDay||0>0)&&e("div",{class:t.expireDateTip},[e("i",{class:t.expireDateIcon},null),e("span",null,[u("作业截止"),a.value.fileExpireDay||0,u("天后,学生上传的文件将过期,请及时查看")])]),e(M,{style:"max-height:400px;",trigger:"none"},{default:()=>[e("div",{class:t.workList},[a.value.studentLessonTrainingDetails.map(n=>e(y,{item:{...n,studentName:a.value.studentName}},null))]),a.value.comment&&e("div",{class:t.commentSection},[e("h3",null,[e("i",{class:t.iconComment},null),e("i",{class:t.myText},null)]),e("div",{class:t.commentContent},[a.value.comment])])]}),e(T,{class:[t.btnGroups,t.nextWrap],justify:"space-between"},{default:()=>[e("div",{class:t.allTotal},[l.current,u("/"),l.total,u("名学生")]),e("div",null,[e(T,null,{default:()=>[e(c,{disabled:l.current<=1,round:!0,type:"primary",onClick:()=>{f("pre")}},{default:()=>[u("上一名")]}),e(c,{disabled:l.current>=l.total,round:!0,type:"primary",onClick:()=>{f("next")}},{default:()=>[u("下一名")]})]})])]})]}),e(x,{show:r.value,"onUpdate:show":n=>r.value=n},{default:()=>[e(E,{comment:a.value.comment,workInfo:{isLook:!!a.value.comment,studentAvatar:a.value.studentAvatar,studentName:a.value.studentName,submitTime:a.value.submitTime,studentLessonTrainingId:a.value.studentLessonTrainingId},onClose:()=>r.value=!1,onConfrim:()=>{v(l.activeRow.studentLessonTrainingId),r.value=!1}},null)]})])}});export{R as T};