1 |
- import{s as i}from"./index.module-aaab646c-1708220053196.js";import{S as F}from"./index-a5a930f9-1708220053196.js";import{C as N}from"./index-fed94f46-1708220053196.js";import{P as S}from"./index-4b731141-1708220053196.js";import{q as x,s as L}from"./api-abf09dee-1708220053196.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 n,K as c,N as E,g as d,x as g,w as B,j as p,$ as U,l as V}from"./index-9bb5784d-1708220053196.js";import{C as W}from"./index-3ac1bd89-1708220053196.js";import{d as q}from"./teacherIcon-b8e3946d-1708220053196.js";import{g as f,a as h}from"./dateFormat-e11a8fcf-1708220053196.js";import{t as P}from"./searchArray-c15f315b-1708220053196.js";import{T as H}from"./TrainingDetails-d1a9df84-1708220053196.js";import{T as j}from"./index-0ad8ff6b-1708220053196.js";import"./index-343185d0-1708220053196.js";import"./Slider-bc98d7ef-1708220053196.js";import"./urlUtils-080cac35-1708220053196.js";import"./index-7345054c-1708220053196.js";import"./index-3be0f72d-1708220053196.js";import"./api-ff130d5b-1708220053196.js";const ce=C({name:"student-studentList",setup(z,{emit:G}){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(),r=M(),w=u([{name:"班级管理",path:"/classList"},{name:r.query.name,path:"/classDetail"},{name:r.query.teacherName,path:"/afterWorkDetail"}]),m=()=>{e.pagination.page=1,l(),console.log("search",e)},D=()=>{e.searchForm={keyword:"",trainingStatus:""},T.value=[f(new Date().getTime()),h(new Date().getTime())],m()},l=async()=>{e.loading=!0;try{const t=await x({trainingId:r.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)}},y=async()=>{try{const t=await L({trainingId:r.query.trainingId});e.workInfo={...t.data}}catch(t){console.log(t)}},v=(t,o)=>{console.log(o,"index"),e.index=o+1,e.activeRow=t,e.detailVisiable=!0};R(()=>{y(),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:i.nosub},[n("未提交")]):null,t.trainingStatus=="SUBMITTED"?a("p",{class:i.ison},[n("不合格")]):null,t.trainingStatus=="TARGET"?a("p",{class:i.isok},[n("合格")]):null])}},{title:"操作",key:"id",render(t,o){return a(p,{text:!0,type:"primary",onClick:()=>{v(t,o)}},{default:()=>[n("详情")]})}}],b=()=>{++e.index,e.activeRow=e.tableList[e.index-1],s.value.getTrainingDetail(e.activeRow.studentLessonTrainingId)},I=()=>{--e.index,e.activeRow=e.tableList[e.index-1],s.value.getTrainingDetail(e.activeRow.studentLessonTrainingId)};return()=>a("div",null,[a(W,{list:w.value},null),a("div",{class:i.listWrap},[a("div",{class:i.teacherList},[a("div",{class:i.teacherHeader},[a("div",{class:i.teacherHeaderBorder},[a(Y,{class:i.teacherHeaderImg,src:e.workInfo.teacherAvatar?e.workInfo.teacherAvatar:q,previewDisabled:!0},null)])]),a("div",{class:i.workafterInfo},[a("h4",null,[e.workInfo.teacherName]),a("p",null,[n("布置时间:"),e.workInfo.createTime?c(e.workInfo.createTime).format("YYYY-MM-DD"):"--"," ",n("|")," ",a("span",null,[n("截止时间:"),e.workInfo.expireDate?c(e.workInfo.expireDate).format("YYYY-MM-DD"):"--"])])])]),a("div",{class:i.searchList},[a(E,{"label-placement":"left",inline:!0},{default:()=>[a(d,null,{default:()=>[a(F,g({placeholder:"请输入学生姓名"},{class:i.searchInput,searchWord:e.searchForm.keyword,onChangeValue:t=>e.searchForm.keyword=t}),null)]}),a(d,null,{default:()=>[a(N,g({options:[{label:"全部状态",value:""},...P],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:()=>[n("搜索")]}),a(p,{type:"primary",ghost:!0,class:"resetBtn",onClick:D},{default:()=>[n("重置")]})]})]})]})]),a("div",{class:i.tableWrap},[a(U,{class:i.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(V,{show:e.detailVisiable,"onUpdate:show":t=>e.detailVisiable=t,preset:"card",class:["modalTitle background",i.wordDetailModel],title:"作业详情"},{default:()=>[a(H,{onNext:()=>b(),onPre:()=>I(),ref:s,onClose:()=>e.detailVisiable=!1,total:e.tableList.length,current:e.index,activeRow:e.activeRow},null)]})])}});export{ce as default};
|