1 |
- import{s as o}from"./index.module-18dca782-1716977058336.js";import{d as I,b as Q,a as _,u as V,e as M,z as X,p as k,f as e,N as R,g as y,x as w,w as C,j as f,k as u,aF as O,l as E,U as H,F,r as L,D as Z,v as re,O as T,aI as le,aJ as ne,c as ie,aK as oe,aL as ue,C as ce,K as de,az as pe,aA as q,A as me,q as ge,t as A}from"./index-70c8ab8f-1716977058336.js";import{C as he}from"./index-abed42a4-1716977058336.js";import{S as J}from"./index-b291caa1-1716977058336.js";import{C as N}from"./index-416ee6d1-1716977058336.js";import{P as G}from"./index-502e1a8f-1716977058336.js";import{h as fe,i as ye,j as ve,k as be,l as Te,m as De,n as Fe}from"./api-ca0eac7b-1716977058336.js";import{T as B}from"./index-32c8a13d-1716977058336.js";import{U as Ce}from"./index-6abeb51e-1716977058336.js";import{i as W,s as S,g as Se,a as we}from"./use-async-46582991-1716977058336.js";import{C as P}from"./index-13e9b31e-1716977058336.js";import{T as ee,a as Ie,S as ke}from"./index-7b7d2eef-1716977058336.js";import{d as te}from"./teacherIcon-b8e3946d-1716977058336.js";import{e as ae}from"./index-a5c2a8ef-1716977058336.js";import{N as se}from"./Scrollbar-dc599640-1716977058336.js";import{g as x,a as j,b as K,N as U,c as Y,d as $}from"./dateFormat-48c28bc9-1716977058336.js";import{o as Le,p as Ee}from"./api-01aa0f20-1716977058336.js";import{a as Ne}from"./api-1dd5909a-1716977058336.js";import"./api-812fd62f-1716977058336.js";import"./contants-0e55b6b3-1716977058336.js";import"./urlUtils-a03c114e-1716977058336.js";import"./index-ac3f97d9-1716977058336.js";import"./Slider-b7891db6-1716977058336.js";import"./index-7941bfe4-1716977058336.js";import"./catchData-cc91cb99-1716977058336.js";import"./index-04f2ff28-1716977058336.js";import"./index-1e0585d5-1716977058336.js";import"./icon_default-d1bcaf5f-1716977058336.js";import"./icon-plus-t-35f4cdeb-1716977058336.js";import"./api-41353e77-1716977058336.js";import"./icon-pan-16e35a82-1716977058336.js";import"./api-6161fdfd-1716977058336.js";import"./icon-collect-active-4272e308-1716977058336.js";const _e=I({name:"student-studentList",props:{upgradeFlag:{type:Number}},setup(d){const g=Q(),n=_(),t=V(),l=M({upgradeFlag:d.upgradeFlag==0,searchForm:{keyword:"",gender:"",membership:""},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],editStatus:!1,activeRow:{}});X(()=>d.upgradeFlag,()=>{l.upgradeFlag=d.upgradeFlag==0});const h=()=>{l.pagination.page=1,c(),S({current:l.searchForm,saveKey:"classDetailStudent"})},p=()=>{l.searchForm={keyword:"",gender:"",membership:""},h(),S({current:l.searchForm,saveKey:"classDetailStudent"})},c=async()=>{l.loading=!0;try{const s=await fe({classGroupId:n.query.id,...l.searchForm,...l.pagination});l.tableList=s.data.rows,l.pagination.pageTotal=s.data.total,l.loading=!1}catch(s){l.loading=!1,console.log(s)}};W({current:l.searchForm,saveKey:"classDetailStudent",callBack:s=>{l.searchForm=s}}),k(()=>{c()});const r=s=>{const v=document.createElement("input");v.value=s,document.body.appendChild(v),v.select(),v.setSelectionRange(0,v.value.length),document.execCommand("Copy"),document.body.removeChild(v),g.success("复制成功")},a=s=>{t.push({path:"/classStudentDetail",query:{...n.query,studentId:s.id,studentName:s.nickname,upgradeFlag:l.upgradeFlag?0:1}})},i=()=>[{title:"学生姓名",key:"nickname",render:s=>e(H,{showArrow:!1,placement:"top-start"},{trigger:()=>e("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>r(s.nickname)},[s.nickname]),default:"点击复制"})},{title:"手机号",key:"phone",render:s=>e(H,{showArrow:!1,placement:"top-start"},{trigger:()=>e("div",{style:{userSelect:"all",cursor:"pointer"},onClick:()=>r(s.phone)},[s.phone]),default:"点击复制"})},{title:"性别",key:"gender",render(s){return e(F,null,[s.gender+""!="null"?s.gender=="0"?"女":"男":"--"])}},{title:"学生类型",key:"vipMember",render(s){return e(F,null,[s.vipMember?"会员":"普通"])}},{title:"操作",key:"id",render(s){return e(C,null,{default:()=>[e(f,{text:!0,type:"primary",onClick:()=>a(s)},{default:()=>[u("详情")]}),e(f,{text:!0,type:"primary",onClick:()=>m(s),disabled:s.historyClassStudent},{default:()=>[u("修改")]})]})}}],m=s=>{l.editStatus=!0,l.activeRow=s};return()=>e("div",null,[e("div",{class:o.searchList},[e(R,{"label-placement":"left",inline:!0},{default:()=>[e(y,null,{default:()=>[e(J,w({placeholder:"请输入学生姓名"},{class:o.searchInput,searchWord:l.searchForm.keyword,onChangeValue:s=>l.searchForm.keyword=s}),null)]}),e(y,null,{default:()=>[e(N,w({options:[{label:"全部性别",value:""},{label:"男",value:"1"},{label:"女",value:"0"}],placeholder:"性别",clearable:!0,inline:!0},{value:l.searchForm.gender,"onUpdate:value":s=>l.searchForm.gender=s}),null)]}),e(y,null,{default:()=>[e(N,w({options:[{label:"全部类型",value:""},{label:"会员",value:!0},{label:"普通",value:!1}],placeholder:"学生类型",clearable:!0,inline:!0},{value:l.searchForm.membership,"onUpdate:value":s=>l.searchForm.membership=s}),null)]}),e(y,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(f,{type:"primary",class:"searchBtn",onClick:h},{default:()=>[u("搜索")]}),e(f,{type:"primary",ghost:!0,class:"resetBtn",onClick:p},{default:()=>[u("重置")]})]})]})]})]),e("div",{class:o.tableWrap},[e(O,{class:o.classTable,loading:l.loading,columns:i(),data:l.tableList},{empty:()=>e(B,null,null)}),e(G,{page:l.pagination.page,"onUpdate:page":s=>l.pagination.page=s,pageSize:l.pagination.rows,"onUpdate:pageSize":s=>l.pagination.rows=s,pageTotal:l.pagination.pageTotal,"onUpdate:pageTotal":s=>l.pagination.pageTotal=s,onList:c,sync:!0},null)]),e(E,{show:l.editStatus,"onUpdate:show":s=>l.editStatus=s,class:["modalTitle background",o.updateStudent],preset:"card",title:"修改信息"},{default:()=>[e(Ce,{onClose:()=>l.editStatus=!1,onConfirm:()=>c(),row:l.activeRow},null)]})])}}),Me=I({props:{activeRow:{type:Object,default:()=>({id:""})},total:{type:Number,default:0},current:{type:Number,default:0}},name:"classTrainingDetails",emits:["close"],setup(d,{emit:g,expose:n}){const t=L(!1),l=L({teacherName:"",createTime:"",expireDate:"",teacherAvatar:"",studentLessonTrainingDetails:[]}),h=(c,r)=>{let a=[];return c==="EVALUATION"?a=["".concat(ae[r.evaluateDifficult]),r.practiceChapterBegin||r.practiceChapterEnd?"".concat(r.practiceChapterBegin,"-").concat(r.practiceChapterEnd,"小节"):"全部小节","".concat(r.trainingTimes,"分合格")]:a=["".concat(r.practiceChapterBegin,"-").concat(r.practiceChapterEnd,"小节"),"速度".concat(r.practiceSpeed),"".concat(r.trainingTimes,"分钟")],a},p=async c=>{t.value=!0;try{const r=await ye({trainingId:c}),a=r.data.studentLessonTrainingDetails.map(i=>{const m=h(i.trainingType,JSON.parse(i.trainingContent));return{...i,coverImg:i.titleImg,allTimes:JSON.parse(i.trainingContent).trainingTimes,typeList:m||[]}});l.value={...r.data,studentLessonTrainingDetails:a}}catch(r){console.log(r)}t.value=!1};return n({getTrainingDetail:p}),k(()=>{p(d.activeRow.id)}),()=>e("div",{class:[o.trainingDetails]},[e(Z,{show:t.value},{default:()=>[e("div",{class:o.studentList},[e("div",{class:o.studentHeaderWrap},[e("div",{class:o.studentHeader},[e("div",{class:o.studentHeaderBorder},[e(re,{class:o.studentHeaderImg,src:l.value.teacherAvatar?l.value.teacherAvatar:te,previewDisabled:!0},null)])]),e("div",{class:o.workafterInfo},[e("h4",null,[l.value.teacherName," ",e("div",{class:[o.workafterInfoDot,o.workafterTeacherInfoDot]},[u("老师")])]),e("p",null,[u("开始时间:"),l.value.createTime?T(new Date(l.value.createTime)).format("YYYY-MM-DD"):"--"," ",u("| 结束时间:"),l.value.expireDate?T(new Date(l.value.expireDate)).format("YYYY-MM-DD"):"--"])])])]),e(se,{style:"max-height:400px",trigger:"none"},{default:()=>[e("div",{class:o.workList},[l.value.studentLessonTrainingDetails.map(c=>e(ee,{style:{marginBottom:"20px"},isDisabled:!0,isDelete:!1,isLarge:!0,isCLassWork:!0,item:c},null))])]})]})])}}),Be="_trainSettings_htbat_1",Ae="_trainBtnGroup_htbat_1",Ue="_searchGroup_htbat_9",Ye="_datetime_htbat_13",xe="_trainList_htbat_43",je="_listSection_htbat_48",Re="_emptySection_htbat_51",Ge="_list_htbat_48",We="_trainEditModal_htbat_69",qe="_selectMusicModal_htbat_72",D={trainSettings:Be,trainBtnGroup:Ae,searchGroup:Ue,datetime:Ye,trainList:xe,listSection:je,emptySection:Re,list:Ge,trainEditModal:We,selectMusicModal:qe},$e=I({name:"train-settings",props:{detailId:{type:String,default:""},subjectId:{type:String,default:""},classGroupId:{type:String,default:""},courseScheduleId:{type:String,default:""}},emits:["close","confirm"],setup(d,{emit:g}){const n=Q(),t=M({type:"add",btnLoading:!1,loadingStatus:!1,editStatus:!1,editItem:{},selectMusicStatus:!1,trainList:[],currentTime:T(T().format("YYYY-MM-DD")).valueOf(),expireDate:T().add(7,"day").format("YYYY-MM-DD")}),l=async()=>{t.loadingStatus=!0;try{const{data:r}=await Le({coursewareKnowledgeDetailId:d.detailId,subjectId:d.subjectId,page:1,rows:99}),a=r.rows||[],i=[];a.forEach(m=>{const s=h(m.trainingType,m.trainingConfigJson);i.push({typeList:s||[],...m})}),t.trainList=i||[]}catch(r){}t.loadingStatus=!1},h=(r,a)=>{let i=[];return r==="EVALUATION"?i=["".concat(ae[a.evaluateDifficult]),a.practiceChapterBegin||a.practiceChapterEnd?"".concat(a.practiceChapterBegin,"-").concat(a.practiceChapterEnd,"小节"):"全部小节","".concat(a.trainingTimes,"分合格")]:i=["".concat(a.practiceChapterBegin,"-").concat(a.practiceChapterEnd,"小节"),"速度".concat(a.practiceSpeed),"".concat(a.trainingTimes,"分钟")],i},p=async r=>{var m;let a="init",i=null;try{const s=await ne.get(r.xmlFileUrl,{mode:"cors"});i=(m=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("part")[0])==null?void 0:m.getElementsByTagName("measure"),a="success"}catch(s){a="error"}a=="success"?r.practiceChapterMax=i.length:r.practiceChapterMax=0,r.coursewareKnowledgeDetailId=d.detailId,r.subjectId=d.subjectId,t.editItem=r,t.editStatus=!0},c=async()=>{if(!t.expireDate){n.error("请选择截止日期");return}if(t.trainList.length<=0){n.error("训练内容不能为空");return}t.btnLoading=!0;try{const r=t.trainList||[],a=[];r.forEach(m=>{a.push({trainingType:m.trainingType,musicId:m.musicId,trainingConfigJsonObject:m.trainingConfigJson})});const i={lessonTrainingDetails:a,expireDate:t.expireDate+" 23:59:59",classGroupId:d.classGroupId,courseScheduleId:d.courseScheduleId||null};await Ee(i),n.success("布置成功"),g("close"),g("confirm")}catch(r){}t.btnLoading=!1};return k(()=>{d.detailId&&d.subjectId&&l()}),()=>e("div",{class:D.trainSettings},[e("div",{class:D.searchGroup},[e(f,{onClick:()=>{t.selectMusicStatus=!0,t.type="add"}},{default:()=>[u("添加作业")]}),e("div",{class:D.datetime},[e("label",null,[u("截止时间:")]),e(le,{style:{width:"200px"},placeholder:"请选择截止日期","formatted-value":t.expireDate,"onUpdate:formatted-value":r=>t.expireDate=r,type:"date",valueFormat:"yyyy-MM-dd",isDateDisabled:r=>r<t.currentTime},null)])]),e(se,{class:D.trainList},{default:()=>[e(Z,{show:t.loadingStatus},{default:()=>[e("div",{class:[D.listSection,!t.loadingStatus&&t.trainList.length<=0?D.emptySection:""]},[t.trainList.length>0&&e("div",{class:D.list},[t.trainList.map((r,a)=>e(ee,{item:r,type:"homework",onEdit:i=>{const{trainingConfigJson:m,id:s,musicId:v,...z}=i;t.editItem={...z,id:v,trainId:s,...m},console.log(t.editItem),t.type="update",t.editStatus=!0},onDelete:()=>{t.trainList.splice(a,1)}},null))]),!t.loadingStatus&&t.trainList.length<=0&&e(B,{description:"暂无作业"},null)])]})]}),e(C,{class:D.trainBtnGroup},{default:()=>[e(f,{strong:!0,type:"default",round:!0,onClick:()=>g("close")},{default:()=>[u("取消布置")]}),e(f,{strong:!0,type:"primary",round:!0,disabled:t.trainList.length<=0,onClick:c},{default:()=>[u("立即布置")]})]}),e(E,{show:t.editStatus,"onUpdate:show":r=>t.editStatus=r,class:["modalTitle background",D.trainEditModal],preset:"card",title:"作业设置"},{default:()=>[e(Ie,{item:t.editItem,type:"homework",onClose:()=>t.editStatus=!1,onConfirm:r=>{console.log(r,"update",t);const a=h(r.trainingType,r.trainingConfigJson);t.type==="update"?t.trainList.forEach(i=>{i.id===r.id&&(i.trainingType=r.trainingType,i.trainingConfigJson=r.trainingConfigJson,i.typeList=a)}):t.trainList.push({...r,id:+new Date,musicName:t.editItem.title,typeList:a}),t.editItem={}}},null)]}),e(E,{show:t.selectMusicStatus,"onUpdate:show":r=>t.selectMusicStatus=r,class:["modalTitle",D.selectMusicModal],preset:"card",title:"选择曲目"},{default:()=>[e(ke,{type:"homework",onAdd:r=>{t.selectMusicStatus=!1,p(r)}},null)]})])}}),Ke=I({name:"afterWork",props:{upgradeFlag:{type:Number}},setup(d){const g=V(),n=_(),t=M({upgradeFlag:d.upgradeFlag==0,searchForm:{status:"",timer:[x(new Date().getTime()),j(new Date().getTime())]},loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],addWorkVisible:!1,activeRow:null,detailVisiable:!1});X(()=>d.upgradeFlag,()=>{t.upgradeFlag=d.upgradeFlag==0});const l=()=>{t.pagination.page=1,p(),S({current:t.searchForm,saveKey:"classDetailAfterWork"})},h=()=>{t.searchForm={status:"",timer:[x(new Date().getTime()),j(new Date().getTime())]},l(),S({current:t.searchForm,saveKey:"classDetailAfterWork"})};W({current:t.searchForm,saveKey:"classDetailAfterWork",callBack:a=>{t.searchForm=a}});const p=async()=>{t.loading=!0;try{const{timer:a,...i}=t.searchForm,m=await ve({classGroupId:n.query.id,...i,...t.pagination,...K(a,["startTime","endTime"],"YYYY-MM-DD")});t.tableList=m.data.rows,t.pagination.pageTotal=m.data.total,t.loading=!1}catch(a){t.loading=!1,console.log(a)}};k(()=>{p()});const c=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(a){return e(F,null,[a.createTime])}},{title:"截止时间",key:"expireDate",render(a){return e(F,null,[a.expireDate])}},{title:"作业状态",key:"status",render(a){return a.status?e("div",{class:o.endDot},[e("span",null,null),u("已结束")]):e("div",{class:o.indDot},[e("span",null,null),u(" 进行中")])}},{title:"布置人数",key:"expectNum"},{title:"提交人数",key:"trainingNum"},{title:"合格人数",key:"standardNum"},{title:"提交率",key:"trainingRate",render(a){return e(F,null,[a.trainingRate,u("%")])}},{title:"合格率",key:"qualifiedRate",render(a){return e(F,null,[a.qualifiedRate,u("%")])}},{title:"操作",key:"id",render(a){return e(C,null,{default:()=>[e(f,{text:!0,type:"primary",onClick:()=>r(a)},{default:()=>[u("详情")]})]})}}],r=a=>{g.push({path:"/afterWorkDetail",query:{...n.query,classGroupId:n.query.id,teacherName:a.teacherName,trainingId:a.id}})};return()=>e("div",null,[e("div",{class:o.searchList},[e(R,{"label-placement":"left",inline:!0},{default:()=>[e(y,null,{default:()=>[e(P,{value:t.searchForm.timer,"onUpdate:value":a=>t.searchForm.timer=a,separator:"至",type:"daterange",timerValue:t.searchForm.timer},null)]}),e(y,null,{default:()=>[e(N,w({options:[{label:"全部状态",value:""},{label:"已结束",value:1},{label:"进行中",value:0}],placeholder:"作业状态",clearable:!0,inline:!0},{value:t.searchForm.status,"onUpdate:value":a=>t.searchForm.status=a}),null)]}),e(y,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(f,{type:"primary",class:"searchBtn",onClick:l},{default:()=>[u("搜索")]}),e(f,{type:"primary",ghost:!0,class:"resetBtn",onClick:h},{default:()=>[u("重置")]})]})]})]})]),e("div",{class:o.tableWrap},[e(O,{class:o.classTable,loading:t.loading,columns:c(),data:t.tableList},{empty:()=>e(B,null,null)}),e(G,{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:p,sync:!0},null)]),e(E,{show:t.addWorkVisible,"onUpdate:show":a=>t.addWorkVisible=a,preset:"card",class:[o.attendClassModal,o.trainClassModal],title:"作业设置"},{default:()=>[e($e,{classGroupId:n.query.id,onClose:()=>{p(),t.addWorkVisible=!1}},null)]}),e(E,{show:t.detailVisiable,"onUpdate:show":a=>t.detailVisiable=a,preset:"card",class:["modalTitle background",o.wordDetailModel],title:"作业详情"},{default:()=>[e(Me,{onClose:()=>t.detailVisiable=!1,activeRow:t.activeRow},null)]})])}}),Ve="_tableSpace_18j6c_1",Oe="_tableContainer_18j6c_4",Pe="_header_18j6c_10",ze="_time_18j6c_20",He="_ntag_18j6c_25",Qe="_content_18j6c_33",Xe="_navatar_18j6c_38",Ze="_userInfo_18j6c_51",Je="_subjectName_18j6c_65",et="_nowEmpty_18j6c_74",b={tableSpace:Ve,tableContainer:Oe,header:Pe,time:ze,ntag:He,content:Qe,navatar:Xe,userInfo:Ze,subjectName:Je,nowEmpty:et};function tt(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!ce(d)}const at=I({name:"class-record",setup(){const d=ie(),g=_(),n=()=>{const r=g.query.gradeYear;if(r){const a="".concat(r,"-9-1"),i="".concat(Number(r)+1,"-8-31");return[T(a).valueOf(),T(i).valueOf()]}else{const a=T().format("YYYY-MM-DD");return[T(a).subtract(1,"month").valueOf(),T(a).valueOf()]}},t=M({searchForm:{teacherId:"",createTimer:n()},teacherList:[],loading:!1,pagination:{page:1,rows:12,pageTotal:0},tableList:[]}),l=()=>{t.pagination.page=1,p(),S({current:t.searchForm,saveKey:"classDetailRecord"})},h=()=>{t.searchForm={teacherId:"",createTimer:n()},l(),S({current:t.searchForm,saveKey:"classDetailRecord"})};W({current:t.searchForm,saveKey:"classDetailRecord",callBack:r=>{t.searchForm=r}});const p=async()=>{t.loading=!0;try{const{data:r}=await be({classGroupId:g.query.id,teacherId:t.searchForm.teacherId,...de(t.searchForm.createTimer,["startTime","endTime"],"YYYY-MM-DD"),...t.pagination}),a=r.rows||[];a.forEach(i=>{i.lessonCourseware=i.lessonCoursewareJson?JSON.parse(i.lessonCoursewareJson):{}}),t.tableList=a,t.pagination.pageTotal=r.total,t.loading=!1}catch(r){t.loading=!1}},c=async()=>{var r,a;try{const{data:i}=await Ne({schoolId:(a=(r=d.info.schoolInfos)==null?void 0:r[0])==null?void 0:a.id,page:1,rows:1e3}),m=i.rows||[],s=[];m.forEach(v=>{s.push({label:v.nickname,value:v.id})}),t.teacherList=s}catch(i){}};return k(()=>{c(),p()}),()=>{let r;return e("div",null,[e("div",{class:b.searchList},[e(R,{"label-placement":"left",inline:!0},{default:()=>[e(y,null,{default:()=>[e(N,w({options:[{label:"全部老师",value:""},...t.teacherList],placeholder:"全部老师",clearable:!0,inline:!0},{value:t.searchForm.teacherId,"onUpdate:value":a=>t.searchForm.teacherId=a}),null)]}),e(y,null,{default:()=>[e(P,{value:t.searchForm.createTimer,"onUpdate:value":a=>t.searchForm.createTimer=a,timerValue:t.searchForm.createTimer,separator:"至",type:"daterange"},null)]}),e(y,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(f,{type:"primary",class:"searchBtn",onClick:l},{default:()=>[u("搜索")]}),e(f,{type:"primary",ghost:!0,class:"resetBtn",onClick:h},{default:()=>[u("重置")]})]})]})]})]),e("div",{class:b.tableWrap},[e(C,{class:b.tableSpace},tt(r=t.tableList.map(a=>e("div",{class:b.tableContainer},[e("div",{class:b.header},[e("div",{class:b.time},[T(a.startTime).format("YYYY-MM-DD HH:mm")]),g.query.name&&e(oe,{type:"primary",class:b.ntag,strong:!0},{default:()=>[g.query.name]})]),e("div",{class:b.content},[e(ue,{class:b.navatar,round:!0,src:a.teacherAvatar||te},null),e("div",{class:b.userInfo},[e("h2",null,[a.teacherName]),e("p",null,[a.subjectName&&e("span",{class:b.subjectName},[a.subjectName]),a.lessonCourseware.lessonCoursewareName,u(" |")," ",a.lessonCourseware.lessonCoursewareDetailName,u("|")," ",a.lessonCourseware.lessonCoursewareKnowledgeDetailName,u("| "),a.useChapterLessonCoursewareName])])])])))?r:{default:()=>[r]}),t.tableList.length>0&&e(G,{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:p,pageSizes:[12,24,36,48],sync:!0,saveKey:"classRecord-key"},null),t.tableList.length<=0&&e(B,{class:b.nowEmpty},null)])])}}}),st=I({name:"student-studentList",setup(d,{emit:g}){const n=M({searchForm:{keyword:"",trainingStatus:null,vipFlag:""},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}),t=_(),l=V(),h=()=>{n.pagination.page=1,a(),r(),S({current:{...n.searchForm,timer:p.value},saveKey:"classDetailTestRecord"})},p=L([x(new Date().getTime()),j(new Date().getTime())]),c=()=>{p.value=[x(new Date().getTime()),j(new Date().getTime())],n.searchForm={keyword:"",trainingStatus:null,vipFlag:""},h(),S({current:{...n.searchForm,timer:p.value},saveKey:"classDetailTestRecord"})};W({current:{...n.searchForm,timer:p.value},saveKey:"classDetailTestRecord",callBack:s=>{n.searchForm=s,p.value=s.timer}});const r=async()=>{n.loading=!0;try{const s=await Te({classGroupId:t.query.id,...n.searchForm,...n.pagination,...K(p.value,["startTime","endTime"],"YYYY-MM-DD")});n.tableList=s.data.rows,n.pagination.pageTotal=s.data.total,n.loading=!1}catch(s){n.loading=!1,console.log(s)}},a=async()=>{try{const s=await De({classGroupId:t.query.id,...K(p.value,["startTime","endTime"],"YYYY-MM-DD")});n.testInfo.practiceDurationAvg=s.data.practiceDurationAvg,n.testInfo.practiceUserCount=s.data.practiceUserCount,n.testInfo.vipUserCount=s.data.vipUserCount}catch(s){console.log(s)}};k(()=>{a(),r()});const i=s=>{l.push({path:"/classStudentRecode",query:{...t.query,studentId:s.studentId,studentName:s.studentName}})},m=()=>[{title:"学生姓名",key:"studentName"},{title:"手机号",key:"studentPhone"},{title:"性别",key:"sex",render(s){return e(F,null,[s.gender+""!="null"?s.gender=="0"?"女":"男":"--"])}},{title:"学生类型",key:"studentType",render(s){return e(F,null,[s.vipFlag?"会员":"普通"])}},{title:"练习天数",key:"practiceDays",render(s){return e(F,null,[s.practiceDays?s.practiceDays:0,u("天")])}},{title:"学练时长",key:"studentType",render(s){return e(F,null,[s.practiceDuration?Y(s.practiceDuration)>0?Y(s.practiceDuration)+"分"+$(s.practiceDuration)+"秒":$(s.practiceDuration)+"秒":"0秒"])}},{title:"操作",key:"id",render(s){return e(f,{text:!0,type:"primary",onClick:()=>{i(s)}},{default:()=>[u("详情")]})}}];return()=>e("div",null,[e("div",{class:o.searchList},[e(R,{"label-placement":"left",inline:!0},{default:()=>[e(y,null,{default:()=>[e(J,w({placeholder:"请输入学生姓名"},{class:o.searchInput,searchWord:n.searchForm.keyword,onChangeValue:s=>n.searchForm.keyword=s}),null)]}),e(y,null,{default:()=>[e(N,w({options:[{label:"全部类型",value:""},{label:"会员",value:!0},{label:"普通",value:!1}],placeholder:"学生类型",clearable:!0,inline:!0},{value:n.searchForm.vipFlag,"onUpdate:value":s=>n.searchForm.vipFlag=s}),null)]}),e(y,null,{default:()=>[e(P,{value:p.value,"onUpdate:value":s=>p.value=s,separator:"至",type:"daterange",timerValue:p.value},null)]}),e(y,null,{default:()=>[e(C,{justify:"end"},{default:()=>[e(f,{type:"primary",class:"searchBtn",onClick:h},{default:()=>[u("搜索")]}),e(f,{type:"primary",ghost:!0,class:"resetBtn",onClick:c},{default:()=>[u("重置")]})]})]})]})]),e("div",{class:["section-container"]},[e(pe,{"x-gap":"12",cols:8},{default:()=>[e(q,null,{default:()=>[e("div",{class:o.TrainDataItem},[e("div",null,[e("p",{class:o.TrainDataItemTitle},[e("div",null,[e("span",null,[e(U,{from:0,to:n.testInfo.practiceUserCount},null)])," ",u("人")])])]),e("p",{class:o.TrainDataItemsubTitle},[u("练习人数")])])]}),e(q,null,{default:()=>[e("div",{class:o.TrainDataItem},[e("p",{class:o.TrainDataItemTitle},[e("div",null,[e("span",null,[e(U,{from:0,to:n.testInfo.vipUserCount},null)])," ",u("人")])]),e("p",{class:o.TrainDataItemsubTitle},[u("会员人数")])])]}),e(q,null,{default:()=>[e("div",{class:o.TrainDataItem},[e("p",{class:o.TrainDataItemTitle},[Y(n.testInfo.practiceDurationAvg)>0?e("div",null,[e("span",null,[e(U,{from:0,to:Y(n.testInfo.practiceDurationAvg)},null)])," ",u("分")]):null,e("div",null,[e("span",null,[e(U,{from:0,to:$(n.testInfo.practiceDurationAvg)},null)])," ",u("秒")])]),e("p",{class:o.TrainDataItemsubTitle},[u("平均每天练习时长")])])]})]})]),e("div",{class:o.tableWrap},[e(O,{class:o.classTable,loading:n.loading,columns:m(),data:n.tableList},{empty:()=>e(B,null,null)}),e(G,{page:n.pagination.page,"onUpdate:page":s=>n.pagination.page=s,pageSize:n.pagination.rows,"onUpdate:pageSize":s=>n.pagination.rows=s,pageTotal:n.pagination.pageTotal,"onUpdate:pageTotal":s=>n.pagination.pageTotal=s,onList:r,sync:!0},null)])])}}),xt=I({name:"base-setting",setup(){const d=sessionStorage.getItem("classDetailTabs"),g=L(d||"student");sessionStorage.removeItem("classDetailTabs");const n=_(),t=L([{name:"班级管理",path:"/classList"},{name:n.query.name,path:"/classDetail"}]);Se(c=>{c.form.tabName&&(g.value=c.form.tabName)});const l=c=>{we(c,"tabName",n)},h=L();return(async()=>{try{const c=n.query.id,{data:r}=await Fe({id:c});h.value=r.upgradeFlag?1:0}catch(c){}})(),k(()=>{d&&(g.value=d)}),me(()=>{const c=sessionStorage.getItem("classDetailTabs");c&&(g.value=c)}),()=>e("div",null,[e(he,{list:t.value},null),e("div",{class:[o.listWrap,o.infoListWrap]},[e(ge,{class:o.customTabs,value:g.value,"onUpdate:value":[c=>g.value=c,c=>l(c)],size:"large",animated:!1,"pane-wrapper-style":"margin: 0 -4px","pane-style":"padding-left: 4px; padding-right: 4px; box-sizing: border-box;"},{default:()=>[e(A,{name:"student",tab:"学员名单"},{default:()=>[e(_e,{upgradeFlag:h.value},null)]}),e(A,{name:"afterWork",tab:"课后作业"},{default:()=>[e(Ke,{upgradeFlag:h.value},null)]}),e(A,{name:"practice",tab:"练习记录"},{default:()=>[e(st,null,null)]}),e(A,{name:"attendclass",tab:"上课记录"},{default:()=>[e(at,null,null)]})]})])])}});export{xt as default};
|