1 |
- import{o as w}from"./api-f59ea4cf-1724872791500.js";import{s as t}from"./index.module-7d86a2ea-1724872791500.js";import{d as N}from"./teacherIcon-b8e3946d-1724872791500.js";import{n as b,u as E,q as F,W as L,C as k}from"./index-323ee661-1724872791500.js";import{e as y}from"./contants-81f70019-1724872791500.js";import{d as I,r as p,q as S,f as e,E as h,w as o,k as u,Q as x,j as c,V as A,x as T,l as B,m as M}from"./index-d5898469-1724872791500.js";import{N as $}from"./Scrollbar-d9cfeed6-1724872791500.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(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(y[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}),S(()=>{v(l.activeRow.studentLessonTrainingId)}),()=>e("div",{class:[t.trainingDetails]},[e(h,{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?x(new Date(a.value.submitTime)).format("YYYY-MM-DD"):"--"])]),a.value.trainingStatus=="UNSUBMITTED"?e(o,{previewDisabled:!0,class:t.workStatus,src:b},null):null,a.value.trainingStatus=="SUBMITTED"?e(o,{previewDisabled:!0,class:t.workStatus,src:E},null):null,a.value.trainingStatus=="TARGET"?e(o,{previewDisabled:!0,class:t.workStatus,src:F},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(A,{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($,{style:"max-height:400px;",trigger:"none"},{default:()=>[e("div",{class:t.workList},[a.value.studentLessonTrainingDetails.map(n=>e(L,{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(B,{maskClosable:M,show:r.value,"onUpdate:show":n=>r.value=n},{default:()=>[e(k,{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};
|