TrainingDetails-68ff3b5a-1715743749367.js 4.3 KB

1
  1. import{o as F}from"./api-5c72bf8d-1715743749367.js";import{s as t}from"./index.module-636d5073-1715743749367.js";import{d as N}from"./teacherIcon-b8e3946d-1715743749367.js";import{n as L,u as h,q as E,W as I,C as b}from"./index-3ce4457c-1715743749367.js";import{e as S}from"./index-951804e3-1715743749367.js";import{d as k,r as d,p as x,f as e,C as B,v as c,k as n,M as A,j as v,w as T,l as M,E as $}from"./index-1a13cb99-1715743749367.js";import{N as q}from"./Scrollbar-b2d8779c-1715743749367.js";const V=k({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:D}){const m=d(!1),a=d({studentName:"",submitTime:"",trainingStatus:"",studentAvatar:"",studentLessonTrainingDetails:[]}),r=d(!1),g=d(null),C=(u,s)=>{let o=[];return u==="EVALUATION"?o=["".concat(S[s.evaluateDifficult]),s.practiceChapterBegin||s.practiceChapterEnd?"".concat(s.practiceChapterBegin,"-").concat(s.practiceChapterEnd,"小节"):"全部小节","".concat(s.trainingTimes,"分合格")]:o=["".concat(s.practiceChapterBegin,"-").concat(s.practiceChapterEnd,"小节"),"速度".concat(s.practiceSpeed),"".concat(s.trainingTimes,"分钟")],o},p=async u=>{m.value=!0;try{const s=await F({studentLessonTrainingId:u}),o=s.data.studentLessonTrainingDetails.map(i=>{const y=C(i.trainingType,JSON.parse(i.trainingContent));return{...i,coverImg:i.titleImg,fileList:i.fileJsonList&&i.fileJsonList[0]||{},allTimes:JSON.parse(i.trainingContent).trainingTimes,typeList:y||[]}});a.value={...s.data,studentLessonTrainingDetails:o}}catch(s){console.log(s)}m.value=!1};D({getTrainingDetail:p});const w=async()=>{try{const{data:u}=await $.get("/edu-app/open/paramConfig/queryByParamName",{params:{paramName:"homework_file_expire_time"}});g.value=u.paramValue||0}catch(u){}};return x(()=>{w(),p(l.activeRow.studentLessonTrainingId)}),()=>e("div",{class:[t.trainingDetails]},[e(B,{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(c,{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},[n("学生")])]),e("p",null,[n("提交时间:"),a.value.submitTime?A(new Date(a.value.submitTime)).format("YYYY-MM-DD"):"--"])]),a.value.trainingStatus=="UNSUBMITTED"?e(c,{previewDisabled:!0,class:t.workStatus,src:L},null):null,a.value.trainingStatus=="SUBMITTED"?e(c,{previewDisabled:!0,class:t.workStatus,src:h},null):null,a.value.trainingStatus=="TARGET"?e(c,{previewDisabled:!0,class:t.workStatus,src:E},null):null]),a.value.expireFlag&&e(v,{onClick:()=>r.value=!0,class:t.commentBtnGroup},{default:()=>[e("div",{class:t.text},[e("i",{class:a.value.comment&&t.look},null),a.value.comment?"修改点评":"点评作业"])]})]),!a.value.fileExpireFlag&&e("div",{class:t.expireDateTip},[e("i",{class:t.expireDateIcon},null),e("span",null,[n("作业截止"),g.value,n("天后,学生上传的文件将过期,请及时查看")])]),e(q,{style:"max-height:400px;min-height: 300px",trigger:"none"},{default:()=>[e("div",{class:t.workList},[a.value.studentLessonTrainingDetails.map(u=>e(I,{style:{marginBottom:"20px"},item:u},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,n("/"),l.total,n("名学生")]),e("div",null,[e(T,null,{default:()=>[e(v,{disabled:l.current<=1,round:!0,type:"primary",onClick:()=>{f("pre")}},{default:()=>[n("上一名")]}),e(v,{disabled:l.current>=l.total,round:!0,type:"primary",onClick:()=>{f("next")}},{default:()=>[n("下一名")]})]})])]})]}),e(M,{show:r.value,"onUpdate:show":u=>r.value=u},{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:()=>{p(l.activeRow.studentLessonTrainingId),r.value=!1}},null)]})])}});export{V as T};