TrainingDetails-ac0265a9-1743496079034.js 4.3 KB

1
  1. import{o as F}from"./api-d57212df-1743496079034.js";import{s as t}from"./index.module-eed6ff4d-1743496079034.js";import{d as E}from"./teacherIcon-b8e3946d-1743496079034.js";import{n as w,u as N,q as B,W as L,C as b}from"./index-e168b504-1743496079034.js";import{e as y}from"./contants-84ba384e-1743496079034.js";import{d as I,r as v,q as S,f as e,a9 as k,w as d,k as s,aj as A,j as p,x as T,l as x,m as h}from"./index-32ff339b-1743496079034.js";import{N as M}from"./Scrollbar-116ac88a-1743496079034.js";const R=I({props:{activeRow:{type:Object,default:()=>({studentLessonTrainingId:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"TrainingDetails",emits:["close","next","pre"],setup(n,{emit:f,expose:D}){const c=v(!1),a=v({studentName:"",submitTime:"",trainingStatus:"",studentAvatar:"",studentLessonTrainingDetails:[]}),r=v(!1),g=(l,u)=>{let o=[];return l==="EVALUATION"?o=["".concat(y[u.evaluateDifficult]),"".concat(u.practiceChapterBegin||0,"-").concat(u.practiceChapterEnd||0,"小节"),"速度".concat(u.evaluateSpeed||0),"".concat(u.trainingTimes,"分达标")]:o=["".concat(u.practiceChapterBegin,"-").concat(u.practiceChapterEnd,"小节"),"速度".concat(u.practiceSpeed||0),"".concat(u.trainingTimes,"分钟")],o},m=async l=>{c.value=!0;try{const u=await F({studentLessonTrainingId:l}),o=u.data.studentLessonTrainingDetails.map(i=>{const C=g(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={...u.data,studentLessonTrainingDetails:o}}catch(u){console.log(u)}c.value=!1};return D({getTrainingDetail:m}),S(()=>{m(n.activeRow.studentLessonTrainingId)}),()=>e("div",{class:[t.trainingDetails]},[e(k,{show:c.value},{default:()=>[e("div",{class:t.studentList},[e("div",{class:t.studentHeaderWrap},[e("div",{class:t.studentHeader},[e("div",{class:t.studentHeaderBorder},[e(d,{class:t.studentHeaderImg,src:a.value.studentAvatar?a.value.studentAvatar:E,previewDisabled:!0},null)])]),e("div",{class:t.workafterInfo},[e("h4",null,[a.value.studentName," ",e("div",{class:t.workafterInfoDot},[s("学生")])]),e("p",null,[s("提交时间:"),a.value.submitTime?A(new Date(a.value.submitTime)).format("YYYY-MM-DD"):"--"])])]),a.value.trainingStatus=="UNSUBMITTED"?e(d,{previewDisabled:!0,class:t.workStatus,src:w},null):null,a.value.trainingStatus=="SUBMITTED"?e(d,{previewDisabled:!0,class:t.workStatus,src:N},null):null,a.value.trainingStatus=="TARGET"?e(d,{previewDisabled:!0,class:t.workStatus,src:B},null):null]),(a.value.fileExpireDay||0>0)&&e("div",{class:t.expireDateTip},[e("i",{class:t.expireDateIcon},null),e("span",null,[s("作业截止"),a.value.fileExpireDay||0,s("天后,学生上传的文件将过期,请及时查看")])]),e(M,{style:"max-height:400px;",trigger:"none"},{default:()=>[e("div",{class:t.workList},[a.value.studentLessonTrainingDetails.map(l=>e(L,{item:{...l,studentName:a.value.studentName}},null))])]}),a.value.expireFlag?e("div",{class:t.commentSection},[e("div",{class:t.commentTitle},[e("h3",null,[e("i",{class:t.iconComment},null),e("i",{class:t.myText},null)]),e(p,{text:!0,onClick:()=>r.value=!0,class:t.commentBtnGroup},{default:()=>[e("div",{class:t.text},[e("i",null,null),a.value.comment?"修改点评":"点评作业"])]})]),a.value.comment?e("div",{class:t.commentContent},[a.value.comment]):e("div",{class:[t.commentContent,t.commentTip]},[s("您目前还没有点评该作业喔,快来写评语吧~")])]):null,e(T,{class:[t.btnGroups,t.nextWrap],justify:"space-between"},{default:()=>[e("div",{class:t.allTotal},[n.current,s("/"),n.total,s("名学生")]),e("div",null,[e(T,null,{default:()=>[e(p,{disabled:n.current<=1,round:!0,type:"primary",onClick:()=>{f("pre")}},{default:()=>[s("上一名")]}),e(p,{disabled:n.current>=n.total,round:!0,type:"primary",onClick:()=>{f("next")}},{default:()=>[s("下一名")]})]})])]})]}),e(x,{maskClosable:h,show:r.value,"onUpdate:show":l=>r.value=l},{default:()=>[e(b,{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:()=>{m(n.activeRow.studentLessonTrainingId),r.value=!1}},null)]})])}});export{R as T};