1 |
- import{s as r}from"./index.module-2dcd19b9-1714059328110.js";import{S as F}from"./index-cbbbf616-1714059328110.js";import{C as N}from"./index-34f50227-1714059328110.js";import{P as S}from"./index-a3f57777-1714059328110.js";import{q as x,r as L}from"./api-144130e5-1714059328110.js";import{d as C,e as M,r as u,a as A,p as R,f as a,v as Y,k as o,M as c,N as E,g as d,x as g,w as B,j as p,aE as q,l as H}from"./index-e9eb06c1-1714059328110.js";import{C as U}from"./index-b421cd26-1714059328110.js";import{d as V}from"./teacherIcon-b8e3946d-1714059328110.js";import{g as f,a as h}from"./dateFormat-a306282d-1714059328110.js";import{t as W}from"./searchArray-cc351603-1714059328110.js";import{T as P}from"./TrainingDetails-534eaa88-1714059328110.js";import{T as j}from"./index-3a6c73b8-1714059328110.js";import"./index-8639da96-1714059328110.js";import"./Slider-277716a1-1714059328110.js";import"./urlUtils-ae95598a-1714059328110.js";import"./index-d932246e-1714059328110.js";import"./icon_default-d1bcaf5f-1714059328110.js";import"./icon-plus-t-35f4cdeb-1714059328110.js";import"./api-091f72ac-1714059328110.js";import"./icon-pan-16e35a82-1714059328110.js";import"./index-e64de2d0-1714059328110.js";import"./index-f29d87b5-1714059328110.js";import"./api-cc34a933-1714059328110.js";import"./Scrollbar-6abf08b7-1714059328110.js";const he=C({name:"student-studentList",setup(G,{emit:z}){const e=M({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=A(),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{he as default};
|