1 |
- import{s as r}from"./index.module-93293dfa-1709737149806.js";import{S as F}from"./index-ec2a0422-1709737149806.js";import{C as N}from"./index-1575b903-1709737149806.js";import{P as S}from"./index-69fe2f6b-1709737149806.js";import{q as x,s as L}from"./api-3beb8a25-1709737149806.js";import{d as C,e as A,r as u,a as M,p as R,f as a,v as Y,k as o,L as c,N as E,g as d,x as g,w as B,j as p,a0 as q,l as H}from"./index-49d0ad44-1709737149806.js";import{C as U}from"./index-d32af175-1709737149806.js";import{d as V}from"./teacherIcon-b8e3946d-1709737149806.js";import{g as f,a as h}from"./dateFormat-6450c2c9-1709737149806.js";import{t as W}from"./searchArray-dd2459b7-1709737149806.js";import{T as P}from"./TrainingDetails-74d74557-1709737149806.js";import{T as j}from"./index-77c1b1e0-1709737149806.js";import"./index-1227c705-1709737149806.js";import"./Slider-1c098860-1709737149806.js";import"./urlUtils-080cac35-1709737149806.js";import"./index-577d4a6d-1709737149806.js";import"./index-17fb9eeb-1709737149806.js";import"./api-35f49f07-1709737149806.js";import"./Scrollbar-8c2190bf-1709737149806.js";const de=C({name:"student-studentList",setup(G,{emit:z}){const e=A({searchForm:{keyword:"",trainingStatus:""},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],workInfo:{createTime:"",expireDate:"",teacherAvatar:"",teacherName:""},detailVisiable:!1,activeRow:null,index:0}),T=u([f(new Date().getTime()),h(new Date().getTime())]),s=u(),i=M(),w=u([{name:"班级管理",path:"/classList"},{name:i.query.name,path:"/classDetail"},{name:i.query.teacherName,path:"/afterWorkDetail"}]),m=()=>{e.pagination.page=1,l(),console.log("search",e)},y=()=>{e.searchForm={keyword:"",trainingStatus:""},T.value=[f(new Date().getTime()),h(new Date().getTime())],m()},l=async()=>{e.loading=!0;try{console.log(i.query,"route.query");const t=await x({classGroupId:i.query.classGroupId||"",trainingId:i.query.trainingId,...e.searchForm,...e.pagination});e.tableList=t.data.rows,e.pagination.pageTotal=t.data.total,e.loading=!1}catch(t){e.loading=!1,console.log(t)}},D=async()=>{try{const t=await L({trainingId:i.query.trainingId});e.workInfo={...t.data}}catch(t){console.log(t)}},v=(t,n)=>{console.log(n,"index"),e.index=n+1,e.activeRow=t,e.detailVisiable=!0};R(()=>{D(),l()});const k=()=>[{title:"学生姓名",key:"studentName"},{title:"最后提交时间",key:"submitTime",render(t){return t.submitTime?c(t.submitTime).format("YYYY-MM-DD"):"--"}},{title:"作业状态",key:"sex",render(t){return a("div",null,[t.trainingStatus=="UNSUBMITTED"?a("p",{class:r.nosub},[o("未提交")]):null,t.trainingStatus=="SUBMITTED"?a("p",{class:r.ison},[o("不合格")]):null,t.trainingStatus=="TARGET"?a("p",{class:r.isok},[o("合格")]):null])}},{title:"操作",key:"id",render(t,n){return a(p,{text:!0,type:"primary",onClick:()=>{v(t,n)}},{default:()=>[o("详情")]})}}],I=()=>{++e.index,e.activeRow=e.tableList[e.index-1],s.value.getTrainingDetail(e.activeRow.studentLessonTrainingId)},b=()=>{--e.index,e.activeRow=e.tableList[e.index-1],s.value.getTrainingDetail(e.activeRow.studentLessonTrainingId)};return()=>a("div",null,[a(U,{list:w.value},null),a("div",{class:r.listWrap},[a("div",{class:r.teacherList},[a("div",{class:r.teacherHeader},[a("div",{class:r.teacherHeaderBorder},[a(Y,{class:r.teacherHeaderImg,src:e.workInfo.teacherAvatar?e.workInfo.teacherAvatar:V,previewDisabled:!0},null)])]),a("div",{class:r.workafterInfo},[a("h4",null,[e.workInfo.teacherName]),a("p",null,[o("布置时间:"),e.workInfo.createTime?c(e.workInfo.createTime).format("YYYY-MM-DD HH:mm"):"--"," ",o("|")," ",a("span",null,[o("截止时间:"),e.workInfo.expireDate?c(e.workInfo.expireDate).format("YYYY-MM-DD HH:mm"):"--"])])])]),a("div",{class:r.searchList},[a(E,{"label-placement":"left",inline:!0},{default:()=>[a(d,null,{default:()=>[a(F,g({placeholder:"请输入学生姓名"},{class:r.searchInput,searchWord:e.searchForm.keyword,onChangeValue:t=>e.searchForm.keyword=t}),null)]}),a(d,null,{default:()=>[a(N,g({options:[{label:"全部状态",value:""},...W],placeholder:"作业状态",clearable:!0,inline:!0},{value:e.searchForm.trainingStatus,"onUpdate:value":t=>e.searchForm.trainingStatus=t}),null)]}),a(d,null,{default:()=>[a(B,{justify:"end"},{default:()=>[a(p,{type:"primary",class:"searchBtn",onClick:m},{default:()=>[o("搜索")]}),a(p,{type:"primary",ghost:!0,class:"resetBtn",onClick:y},{default:()=>[o("重置")]})]})]})]})]),a("div",{class:r.tableWrap},[a(q,{class:r.classTable,loading:e.loading,columns:k(),data:e.tableList},{empty:()=>a(j,null,null)}),a(S,{page:e.pagination.page,"onUpdate:page":t=>e.pagination.page=t,pageSize:e.pagination.rows,"onUpdate:pageSize":t=>e.pagination.rows=t,pageTotal:e.pagination.pageTotal,"onUpdate:pageTotal":t=>e.pagination.pageTotal=t,onList:l,sync:!0},null)])]),a(H,{show:e.detailVisiable,"onUpdate:show":t=>e.detailVisiable=t,preset:"card",class:["modalTitle background",r.wordDetailModel],title:"作业详情"},{default:()=>[a(P,{onNext:()=>I(),onPre:()=>b(),ref:s,onClose:()=>e.detailVisiable=!1,total:e.tableList.length,current:e.index,activeRow:e.activeRow},null)]})])}});export{de as default};
|