import{s}from"./index.module-42c945ce.js";import{d as F,b as z,a as N,u as W,e as I,y as $,n as L,f as e,N as U,g as f,x as w,w as C,j as p,k as i,c9 as V,F as v,r as D,t as J,V as T,v as O,cd as K,ce as Q,aU as X,cf as Z,cg as ee,ch as x,p as ae,q as E}from"./index-779ffae6.js";import{C as te}from"./index-4c9f70b2.js";import{S as H}from"./index-6ea567b8.js";import{C as j}from"./index-55d5d283.js";import{P as A}from"./index-a4dbbe5a.js";import{h as le,i as ne,j as se,k as re,l as ie,m as ue,n as oe}from"./api-609cb155.js";import{T as M}from"./index-69b7c198.js";import{C as G,N as S}from"./index-6a9abf92.js";import{T as ce}from"./index-1defd428.js";import{d as P}from"./teacherIcon-b8e3946d.js";import{N as de,e as pe}from"./contants-23f7842f.js";import{g as B,a as _,b as R,c as Y,d as q}from"./dateFormat-8ea96630.js";import{a as ge}from"./index-4774a390.js";import"./Slider-c00697bd.js";import"./isCollaose-5d4ce76f.js";import"./index-5bd6453a.js";import"./index-00760a35.js";import"./catchData-713ebeee.js";import"./index-29eeffc7.js";const me=F({name:"student-studentList",props:{upgradeFlag:{type:Number}},setup(c,{emit:y}){const l=z(),o=N(),d=W(),t=I({upgradeFlag:c.upgradeFlag==0,searchForm:{keyword:"",gender:null},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[]});$(()=>c.upgradeFlag,()=>{t.upgradeFlag=c.upgradeFlag==0});const r=()=>{t.pagination.page=1,u(),console.log("search",t)},n=()=>{t.searchForm={keyword:"",gender:null},r()},u=async()=>{t.loading=!0;try{const a=await le({classGroupId:o.query.id,...t.searchForm,...t.pagination});t.tableList=a.data.rows,t.pagination.pageTotal=a.data.total,t.loading=!1}catch(a){t.loading=!1,console.log(a)}};L(()=>{u()});const g=a=>{const b=document.createElement("input");b.value=a,document.body.appendChild(b),b.select(),b.setSelectionRange(0,b.value.length),document.execCommand("Copy"),document.body.removeChild(b),l.success("复制成功")},h=a=>{d.push({path:"/classStudentDetail",query:{...o.query,studentId:a.id,studentName:a.nickname,upgradeFlag:t.upgradeFlag?0:1}})},k=()=>[{title:"学生姓名",key:"nickname",render:a=>e("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>g(a.nickname)},[a.nickname])},{title:"手机号",key:"phone",render:a=>e("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>g(a.phone)},[a.phone])},{title:"性别",key:"gender",render(a){return e(v,null,[a.gender+""!="null"?a.gender=="0"?"女":"男":"--"])}},{title:"操作",key:"id",render(a){return e(p,{text:!0,type:"primary",onClick:()=>h(a)},{default:()=>[i("详情")]})}}];return()=>e("div",null,[e("div",{class:s.searchList},[e(U,{"label-placement":"left",inline:!0},{default:()=>[e(f,null,{default:()=>[e(H,w({placeholder:"请输入学生姓名"},{class:s.searchInput,searchWord:t.searchForm.keyword,onChangeValue:a=>t.searchForm.keyword=a}),null)]}),e(f,null,{default:()=>[e(j,w({options:[{label:"选择性别",value:null},{label:"男",value:"1"},{label:"女",value:"0"}],placeholder:"性别",clearable:!0,inline:!0},{value:t.searchForm.gender,"onUpdate:value":a=>t.searchForm.gender=a}),null)]}),e(f,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(p,{type:"primary",class:"searchBtn",onClick:r},{default:()=>[i("搜索")]}),e(p,{type:"primary",ghost:!0,class:"resetBtn",onClick:n},{default:()=>[i("重置")]})]})]})]})]),e("div",{class:s.tableWrap},[e(V,{class:s.classTable,loading:t.loading,columns:k(),data:t.tableList},{empty:()=>e(M,null,null)}),e(A,{page:t.pagination.page,"onUpdate:page":a=>t.pagination.page=a,pageSize:t.pagination.rows,"onUpdate:pageSize":a=>t.pagination.rows=a,pageTotal:t.pagination.pageTotal,"onUpdate:pageTotal":a=>t.pagination.pageTotal=a,onList:u,sync:!0},null)])])}}),fe=F({props:{activeRow:{type:Object,default:()=>({id:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"classTrainingDetails",emits:["close"],setup(c,{emit:y,expose:l}){I({uploading:!1});const o=D({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]});z(),D();const d=(r,n)=>{let u=[];return r==="EVALUATION"?(u=["".concat(pe[n.evaluateDifficult]),"全部小节","".concat(n.trainingTimes,"分合格")],console.log("configJson.evaluateDifficult--",u)):(u=["".concat(n.practiceChapterBegin,"-").concat(n.practiceChapterEnd,"小节"),"速度".concat(n.practiceSpeed),"".concat(n.trainingTimes,"分钟")],console.log("configJson.evaluateDifficult",u)),u},t=async r=>{try{const n=await ne({trainingId:r}),u=n.data.studentLessonTrainingDetails.map(g=>{const h=d(g.trainingType,JSON.parse(g.trainingContent));return{...g,coverImg:g.titleImg,allTimes:JSON.parse(g.trainingContent).trainingTimes,typeList:h||[]}});o.value={...n.data,studentLessonTrainingDetails:u}}catch(n){console.log(n)}};return l({getTrainingDetail:t}),L(()=>{t(c.activeRow.id)}),()=>e("div",{class:[s.trainingDetails]},[e("div",{class:s.studentList},[e("div",{class:s.studentHeaderWrap},[e("div",{class:s.studentHeader},[e("div",{class:s.studentHeaderBorder},[e(J,{class:s.studentHeaderImg,src:o.value.teacherAvatar?o.value.teacherAvatar:P,previewDisabled:!0},null)])]),e("div",{class:s.workafterInfo},[e("h4",null,[o.value.teacherName," ",e("div",{class:[s.workafterInfoDot,s.workafterTeacherInfoDot]},[i("老师")])]),e("p",null,[i("开始时间:"),o.value.createTime?T(new Date(o.value.createTime)).format("YYYY-MM-DD"):"--"," ",i("| 结束时间:"),T(new Date(o.value.expireDate)).format("YYYY-MM-DD")])])])]),e(de,{style:"max-height:400px",trigger:"none"},{default:()=>[e("div",{class:s.workList},[o.value.studentLessonTrainingDetails.map(r=>e(ce,{style:{marginBottom:"20px"},isDisabled:!0,isDelete:!1,isCLassWork:!0,item:r},null))])]})])}}),ye=F({name:"afterWork",props:{upgradeFlag:{type:Number}},setup(c,{emit:y}){const l=W(),o=N(),d=D([B(new Date().getTime()),_(new Date().getTime())]);console.log(o.query,"query");const t=I({upgradeFlag:c.upgradeFlag==0,searchForm:{status:null},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],addWorkVisible:!1,activeRow:null,detailVisiable:!1});$(()=>c.upgradeFlag,()=>{t.upgradeFlag=c.upgradeFlag==0});const r=()=>{t.pagination.page=1,u()},n=()=>{d.value=[B(new Date().getTime()),_(new Date().getTime())],t.searchForm={status:null},r()},u=async()=>{t.loading=!0;try{const a=await se({classGroupId:o.query.id,...t.searchForm,...t.pagination,...R(d.value,["startTime","endTime"],"YYYY-MM-DD")});t.tableList=a.data.rows,t.pagination.pageTotal=a.data.total,t.loading=!1}catch(a){t.loading=!1,console.log(a)}};L(()=>{u()});const g=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(a){return e(v,null,[a.createTime])}},{title:"截止时间",key:"expireDate",render(a){return e(v,null,[a.expireDate])}},{title:"训练状态",key:"status",render(a){return a.status==0?e("div",{class:s.indDot},[" ",e("span",null,null),i(" 进行中")]):e("div",{class:s.endDot},[e("span",null,null),i("已结束")])}},{title:"布置人数",key:"expectNum"},{title:"提交人数",key:"trainingNum"},{title:"合格人数",key:"standardNum"},{title:"提交率",key:"trainingRate",render(a){return e(v,null,[a.trainingRate,i("%")])}},{title:"合格率",key:"qualifiedRate",render(a){return e(v,null,[a.qualifiedRate,i("%")])}},{title:"操作",key:"id",render(a){return e(C,null,{default:()=>[e(p,{text:!0,type:"primary",onClick:()=>h(a)},{default:()=>[i("详情")]}),e(p,{text:!0,type:"primary",onClick:()=>k(a)},{default:()=>[i("训练详情")]})]})}}],h=a=>{console.log(a),l.push({path:"/afterWorkDetail",query:{...o.query,teacherName:a.teacherName,trainingId:a.id}})},k=a=>{t.activeRow=a,t.detailVisiable=!0};return()=>e("div",null,[e("div",{class:s.searchList},[e(U,{"label-placement":"left",inline:!0},{default:()=>[e(f,null,{default:()=>[e(G,{value:d.value,"onUpdate:value":a=>d.value=a,separator:"至",type:"daterange",timerValue:d.value},null)]}),e(f,null,{default:()=>[e(j,w({options:[{label:"训练状态",value:null},{label:"已结束",value:1},{label:"进行中",value:0}],placeholder:"训练状态",clearable:!0,inline:!0},{value:t.searchForm.status,"onUpdate:value":a=>t.searchForm.status=a}),null)]}),e(f,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(p,{type:"primary",class:"searchBtn",onClick:r},{default:()=>[i("搜索")]}),e(p,{type:"primary",ghost:!0,class:"resetBtn",onClick:n},{default:()=>[i("重置")]})]})]})]})]),!t.upgradeFlag&&e(p,{class:s.addBtn,type:"primary",onClick:()=>t.addWorkVisible=!0},{default:()=>[i("布置作业")]}),e("div",{class:s.tableWrap},[e(V,{class:s.classTable,loading:t.loading,columns:g(),data:t.tableList},{empty:()=>e(M,null,null)}),e(A,{page:t.pagination.page,"onUpdate:page":a=>t.pagination.page=a,pageSize:t.pagination.rows,"onUpdate:pageSize":a=>t.pagination.rows=a,pageTotal:t.pagination.pageTotal,"onUpdate:pageTotal":a=>t.pagination.pageTotal=a,onList:u,sync:!0},null)]),e(O,{show:t.addWorkVisible,"onUpdate:show":a=>t.addWorkVisible=a,preset:"card",class:[s.attendClassModal,s.trainClassModal],title:"作业设置"},{default:()=>[e(ge,{classGroupId:o.query.id,onClose:()=>{u(),t.addWorkVisible=!1}},null)]}),e(O,{show:t.detailVisiable,"onUpdate:show":a=>t.detailVisiable=a,preset:"card",class:["modalTitle background",s.wordDetailModel],title:"训练详情"},{default:()=>[e(fe,{onClose:()=>t.detailVisiable=!1,activeRow:t.activeRow},null)]})])}}),ve="_tableSpace_gafsc_1",Te="_tableContainer_gafsc_4",he="_header_gafsc_10",De="_time_gafsc_20",be="_ntag_gafsc_25",Ce="_content_gafsc_32",Fe="_navatar_gafsc_37",ke="_userInfo_gafsc_47",we="_subjectName_gafsc_58",Ne="_nowEmpty_gafsc_67",m={tableSpace:ve,tableContainer:Te,header:he,time:De,ntag:be,content:Ce,navatar:Fe,userInfo:ke,subjectName:we,nowEmpty:Ne};function Ie(c){return typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!X(c)}const Le=F({name:"class-record",setup(){const c=N(),y=()=>{const r=c.query.gradeYear;if(r){const n="".concat(r,"-9-1"),u="".concat(Number(r)+1,"-8-31");return[T(n).valueOf(),T(u).valueOf()]}else{const n=T().format("YYYY-MM-DD");return[T(n).subtract(1,"month").valueOf(),T(n).valueOf()]}},l=I({searchForm:{createTimer:y()},loading:!1,pagination:{page:1,rows:10,pageTotal:0},tableList:[]}),o=()=>{l.pagination.page=1,t()},d=()=>{l.searchForm={createTimer:y()},o()},t=async()=>{l.loading=!0;try{const{data:r}=await re({classGroupId:c.query.id,...Z(l.searchForm.createTimer,["startTime","endTime"],"YYYY-MM-DD"),...l.pagination}),n=r.rows||[];n.forEach(u=>{u.lessonCourseware=u.lessonCoursewareJson?JSON.parse(u.lessonCoursewareJson):{}}),l.tableList=n,l.pagination.pageTotal=r.total,l.loading=!1}catch(r){l.loading=!1}};return L(()=>{t()}),()=>{let r;return e("div",null,[e("div",{class:m.searchList},[e(U,{"label-placement":"left",inline:!0},{default:()=>[e(f,null,{default:()=>[e(G,{value:l.searchForm.createTimer,"onUpdate:value":n=>l.searchForm.createTimer=n,timerValue:l.searchForm.createTimer,separator:"至",type:"daterange"},null)]}),e(f,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(p,{type:"primary",class:"searchBtn",onClick:o},{default:()=>[i("搜索")]}),e(p,{type:"primary",ghost:!0,class:"resetBtn",onClick:d},{default:()=>[i("重置")]})]})]})]})]),e("div",{class:m.tableWrap},[e(C,{class:m.tableSpace},Ie(r=l.tableList.map(n=>e("div",{class:m.tableContainer},[e("div",{class:m.header},[e("div",{class:m.time},[T(n.startTime).format("YYYY-MM-DD HH:mm")]),c.query.name&&e(K,{type:"primary",class:m.ntag,strong:!0},{default:()=>[c.query.name]})]),e("div",{class:m.content},[e(Q,{class:m.navatar,round:!0,src:n.teacherAvatar||P},null),e("div",{class:m.userInfo},[e("h2",null,[n.teacherName]),e("p",null,[n.subjectName&&e("span",{class:m.subjectName},[n.subjectName]),n.lessonCourseware.lessonCoursewareName,i(" |")," ",n.lessonCourseware.lessonCoursewareDetailName,i("|")," ",n.lessonCourseware.lessonCoursewareKnowledgeDetailName])])])])))?r:{default:()=>[r]}),l.tableList.length>0&&e(A,{page:l.pagination.page,"onUpdate:page":n=>l.pagination.page=n,pageSize:l.pagination.rows,"onUpdate:pageSize":n=>l.pagination.rows=n,pageTotal:l.pagination.pageTotal,"onUpdate:pageTotal":n=>l.pagination.pageTotal=n,onList:t,sync:!0,saveKey:"classRecord-key"},null),l.tableList.length<=0&&e(M,{class:m.nowEmpty},null)])])}}}),Ee=F({name:"student-studentList",setup(c,{emit:y}){const l=I({searchForm:{keyword:"",trainingStatus:null,vipFlag:null},searchWord:"",orchestraType:null,courseTypeCode:null,subjectId:null,classId:null,studentType:null,loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],memberNumber:0,testInfo:{practiceDurationAvg:0,vipUserCount:0,practiceUserCount:0},activeRow:null}),o=N(),d=W(),t=()=>{l.pagination.page=1,u()},r=D([B(new Date().getTime()),_(new Date().getTime())]),n=()=>{r.value=[B(new Date().getTime()),_(new Date().getTime())],l.searchForm={keyword:"",trainingStatus:null,vipFlag:null},t()},u=async()=>{l.loading=!0;try{const a=await ie({classGroupId:o.query.id,...l.searchForm,...l.pagination,...R(r.value,["startTime","endTime"],"YYYY-MM-DD")});l.tableList=a.data.rows,l.pagination.pageTotal=a.data.total,l.loading=!1}catch(a){l.loading=!1,console.log(a)}},g=async()=>{try{const a=await ue({classGroupId:o.query.id,...R(r.value,["startTime","endTime"],"YYYY-MM-DD")});l.testInfo.practiceDurationAvg=a.data.practiceDurationAvg,l.testInfo.practiceUserCount=a.data.practiceUserCount,l.testInfo.vipUserCount=a.data.vipUserCount}catch(a){console.log(a)}};L(()=>{g(),u()});const h=a=>{d.push({path:"/classStudentRecode",query:{...o.query,studentId:a.studentId,studentName:a.studentName}})},k=()=>[{title:"姓名",key:"studentName"},{title:"手机号",key:"studentPhone"},{title:"性别",key:"sex",render(a){return e(v,null,[a.gender+""!="null"?a.gender=="0"?"女":"男":"--"])}},{title:"学生类型",key:"studentType",render(a){return e(v,null,[a.vipFlag?"会员":"普通"])}},{title:"练习天数",key:"practiceDays",render(a){return e(v,null,[a.practiceDays?a.practiceDays:0,i("天")])}},{title:"练习时长",key:"studentType",render(a){return e(v,null,[a.practiceDuration?Y(a.practiceDuration)>0?Y(a.practiceDuration)+"分"+q(a.practiceDuration)+"秒":q(a.practiceDuration)+"秒":0])}},{title:"操作",key:"id",render(a){return e(p,{text:!0,type:"primary",onClick:()=>{h(a)}},{default:()=>[i("详情")]})}}];return()=>e("div",null,[e("div",{class:s.searchList},[e(U,{"label-placement":"left",inline:!0},{default:()=>[e(f,null,{default:()=>[e(H,w({placeholder:"请输入学生姓名"},{class:s.searchInput,searchWord:l.searchForm.keyword,onChangeValue:a=>l.searchForm.keyword=a}),null)]}),e(f,null,{default:()=>[e(j,w({options:[{label:"学生类型",value:null},{label:"会员",value:!0},{label:"普通",value:!1}],placeholder:"学生类型",clearable:!0,inline:!0},{value:l.searchForm.vipFlag,"onUpdate:value":a=>l.searchForm.vipFlag=a}),null)]}),e(f,null,{default:()=>[e(G,{value:r.value,"onUpdate:value":a=>r.value=a,separator:"至",type:"daterange",timerValue:r.value},null)]}),e(f,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(p,{type:"primary",class:"searchBtn",onClick:t},{default:()=>[i("搜索")]}),e(p,{type:"primary",ghost:!0,class:"resetBtn",onClick:n},{default:()=>[i("重置")]})]})]})]})]),e("div",{class:["section-container"]},[e(ee,{"x-gap":"12",cols:8},{default:()=>[e(x,null,{default:()=>[e("div",{class:s.TrainDataItem},[e("div",null,[e("p",{class:s.TrainDataItemTitle},[e("span",null,[e(S,{from:0,to:l.testInfo.practiceUserCount},null)])," ",i("人")])]),e("p",{class:s.TrainDataItemsubTitle},[i("练习人数")])])]}),e(x,null,{default:()=>[e("div",{class:s.TrainDataItem},[e("p",{class:s.TrainDataItemTitle},[e("span",null,[e(S,{from:0,to:l.testInfo.vipUserCount},null)])," ",i("人")]),e("p",{class:s.TrainDataItemsubTitle},[i("会员人数")])])]}),e(x,null,{default:()=>[e("div",{class:s.TrainDataItem},[e("p",{class:s.TrainDataItemTitle},[Y(l.testInfo.practiceDurationAvg)>0?e("div",null,[e("span",null,[e(S,{from:0,to:Y(l.testInfo.practiceDurationAvg)},null)])," ",i("分")]):null,e("div",null,[e("span",null,[e(S,{from:0,to:q(l.testInfo.practiceDurationAvg)},null)])," ",i("秒")])]),e("p",{class:s.TrainDataItemsubTitle},[i("平均练习时长")])])]})]})]),e("div",{class:s.tableWrap},[e(V,{class:s.classTable,loading:l.loading,columns:k(),data:l.tableList},{empty:()=>e(M,null,null)}),e(A,{page:l.pagination.page,"onUpdate:page":a=>l.pagination.page=a,pageSize:l.pagination.rows,"onUpdate:pageSize":a=>l.pagination.rows=a,pageTotal:l.pagination.pageTotal,"onUpdate:pageTotal":a=>l.pagination.pageTotal=a,onList:u,sync:!0},null)])])}}),Ke=F({name:"base-setting",setup(){const c=sessionStorage.getItem("classDetailTabs"),y=D(c||"student");sessionStorage.removeItem("classDetailTabs");const l=N(),o=D([{name:"班级管理",path:"/classList"},{name:l.query.name,path:"/classDetail"}]),d=D();return(async()=>{try{const r=l.query.id,{data:n}=await oe({id:r});d.value=n.upgradeFlag?1:0}catch(r){}})(),()=>e("div",null,[e(te,{list:o.value},null),e("div",{class:[s.listWrap,s.infoListWrap]},[e(ae,{class:s.customTabs,value:y.value,"onUpdate:value":r=>y.value=r,size:"large",animated:!1,"pane-wrapper-style":"margin: 0 -4px","pane-style":"padding-left: 4px; padding-right: 4px; box-sizing: border-box;"},{default:()=>[e(E,{name:"student",tab:"学员名单"},{default:()=>[e(me,{upgradeFlag:d.value},null)]}),e(E,{name:"afterWork",tab:"课后作业"},{default:()=>[e(ye,{upgradeFlag:d.value},null)]}),e(E,{name:"practice",tab:"练习记录"},{default:()=>[e(Ee,null,null)]}),e(E,{name:"attendclass",tab:"上课记录"},{default:()=>[e(Le,null,null)]})]})])])}});export{Ke as default};