1 |
- import{s as i}from"./index.module-18dca782-1715840129614.js";import{S as F}from"./index-717042f2-1715840129614.js";import{C as N}from"./index-0c60b72d-1715840129614.js";import{P as L}from"./index-2abd505e-1715840129614.js";import{q as C,r as M}from"./api-ada3b0f5-1715840129614.js";import{d as A,e as R,r as p,a as Y,p as E,S as B,f as a,v as H,k as n,M as c,N as U,g as d,x as T,w as V,j as g,aE as W,l as q}from"./index-27f38392-1715840129614.js";import{C as P}from"./index-d619acc0-1715840129614.js";import{d as j}from"./teacherIcon-b8e3946d-1715840129614.js";import{g as w,a as v}from"./dateFormat-df60ec62-1715840129614.js";import{t as G}from"./searchArray-d5f42180-1715840129614.js";import{T as z}from"./TrainingDetails-27d331c4-1715840129614.js";import{T as J}from"./index-f592738f-1715840129614.js";import"./index-28769104-1715840129614.js";import"./Slider-17a69cd3-1715840129614.js";import"./urlUtils-a03c114e-1715840129614.js";import"./index-f4afcac5-1715840129614.js";import"./icon_default-d1bcaf5f-1715840129614.js";import"./icon-plus-t-35f4cdeb-1715840129614.js";import"./api-279396c0-1715840129614.js";import"./icon-pan-16e35a82-1715840129614.js";import"./api-642b417f-1715840129614.js";import"./index-9ce264f4-1715840129614.js";import"./api-0aa82bae-1715840129614.js";import"./Scrollbar-b72aeac2-1715840129614.js";const ve=A({name:"student-studentList",setup(K,{emit:O}){const e=R({searchForm:{keyword:"",trainingStatus:""},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],workInfo:{createTime:"",expireDate:"",teacherAvatar:"",teacherName:""},detailVisiable:!1,activeRow:null,index:0}),D=p([w(new Date().getTime()),v(new Date().getTime())]),u=p(),r=Y(),y=p([{name:"班级管理",path:"/classList"},{name:r.query.name,path:"/classDetail"},{name:r.query.teacherName,path:"/afterWorkDetail"}]),m=()=>{e.pagination.page=1,o(),console.log("search",e)},k=()=>{e.searchForm={keyword:"",trainingStatus:""},D.value=[w(new Date().getTime()),v(new Date().getTime())],m()},o=async(t,s)=>{e.loading=!0;try{const l=await C({classGroupId:r.query.classGroupId||"",trainingId:r.query.trainingId,...e.searchForm,...e.pagination,page:s||e.pagination.page});e.tableList=l.data.rows,e.pagination.page=l.data.current,e.pagination.pageTotal=l.data.total,e.loading=!1,t==="next"?(e.index=0,f()):t==="prev"&&(e.index=e.tableList.length+1,h())}catch(l){e.loading=!1,console.log(l)}},I=async()=>{try{const t=await M({trainingId:r.query.trainingId});e.workInfo={...t.data}}catch(t){console.log(t)}},b=(t,s)=>{e.index=s+1,e.activeRow=t,e.detailVisiable=!0};E(()=>{I(),o()});const x=()=>[{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,s){return a(g,{text:!0,type:"primary",onClick:()=>{b(t,s)}},{default:()=>[n("详情")]})}}],f=()=>{e.index>=e.tableList.length?o("next",e.pagination.page+1):(++e.index,e.activeRow=e.tableList[e.index-1],u.value.getTrainingDetail(e.activeRow.studentLessonTrainingId))},h=()=>{e.index===1&&e.pagination.page!==1?o("prev",e.pagination.page-1):(--e.index,e.activeRow=e.tableList[e.index-1],u.value.getTrainingDetail(e.activeRow.studentLessonTrainingId))},S=B(()=>e.index+(e.pagination.page-1)*e.pagination.rows);return()=>a("div",null,[a(P,{list:y.value},null),a("div",{class:i.listWrap},[a("div",{class:i.teacherList},[a("div",{class:i.teacherHeader},[a("div",{class:i.teacherHeaderBorder},[a(H,{class:i.teacherHeaderImg,src:e.workInfo.teacherAvatar?e.workInfo.teacherAvatar:j,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 HH:mm"):"--"," ",n("|")," ",a("span",null,[n("截止时间:"),e.workInfo.expireDate?c(e.workInfo.expireDate).format("YYYY-MM-DD HH:mm"):"--"])])])]),a("div",{class:i.searchList},[a(U,{"label-placement":"left",inline:!0},{default:()=>[a(d,null,{default:()=>[a(F,T({placeholder:"请输入学生姓名"},{class:i.searchInput,searchWord:e.searchForm.keyword,onChangeValue:t=>e.searchForm.keyword=t}),null)]}),a(d,null,{default:()=>[a(N,T({options:[{label:"全部状态",value:""},...G],placeholder:"作业状态",clearable:!0,inline:!0},{value:e.searchForm.trainingStatus,"onUpdate:value":t=>e.searchForm.trainingStatus=t}),null)]}),a(d,null,{default:()=>[a(V,{justify:"end"},{default:()=>[a(g,{type:"primary",class:"searchBtn",onClick:m},{default:()=>[n("搜索")]}),a(g,{type:"primary",ghost:!0,class:"resetBtn",onClick:k},{default:()=>[n("重置")]})]})]})]})]),a("div",{class:i.tableWrap},[a(W,{class:i.classTable,loading:e.loading,columns:x(),data:e.tableList},{empty:()=>a(J,null,null)}),a(L,{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:o,sync:!0},null)])]),a(q,{show:e.detailVisiable,"onUpdate:show":t=>e.detailVisiable=t,preset:"card",class:["modalTitle background",i.wordDetailModel],title:"作业详情"},{default:()=>[a(z,{onNext:()=>f(),onPre:()=>h(),ref:u,onClose:()=>e.detailVisiable=!1,total:e.pagination.pageTotal,current:S.value,activeRow:e.activeRow},null)]})])}});export{ve as default};
|