import{S as Y}from"./index-4013b5e1-1728525661307.js";import{C as M}from"./index-122fe044-1728525661307.js";import{C as p}from"./index-754185f1-1728525661307.js";import{a as R}from"./add-efe8238e-1728525661307.js";import{d as V,Q as h,e as x,r as j,b as W,u as P,a as U,q as K,f as e,N as H,g as u,y as c,x as v,j as d,k as s,F as $,w as G,E as z,aN as J,V as k,bd as F,l as L,m as y,L as Q,z as X,aD as Z}from"./index-324a91a1-1728525661307.js";import{g as ee,b as ae}from"./api-929c568b-1728525661307.js";import{i as te,s as E}from"./use-async-adf97bdc-1728525661307.js";import{g as re,c as se}from"./contants-fe50eacb-1728525661307.js";import{d as oe}from"./teacherIcon-b8e3946d-1728525661307.js";import{P as ne}from"./index-e00e25f7-1728525661307.js";import{a as le,b as ie}from"./api-b284be2b-1728525661307.js";import{T as ue}from"./index-e4dbb426-1728525661307.js";import{b as ce,R as pe}from"./index-cf57836f-1728525661307.js";import{u as de}from"./index-da106294-1728525661307.js";import{b as me}from"./browser-504037ee-1728525661307.js";import{P as he}from"./index-974f5f6f-1728525661307.js";import{e as ge}from"./contants-32f8b17d-1728525661307.js";import"./urlUtils-72ef455d-1728525661307.js";import"./index-df2d52b9-1728525661307.js";import"./Slider-63b34f2d-1728525661307.js";import"./index-4e5d834b-1728525661307.js";import"./icon_default-d1bcaf5f-1728525661307.js";import"./useSpeak-8c9b83a5-1728525661307.js";import"./api-77ea9366-1728525661307.js";import"./icon-pan-16e35a82-1728525661307.js";import"./api-14a9206b-1728525661307.js";import"./api-4f96d229-1728525661307.js";import"./ding-8e9054d5-1728525661307.js";import"./catchData-7b56150c-1728525661307.js";import"./Scrollbar-26dcbbee-1728525661307.js";import"./searchArray-5457e010-1728525661307.js";import"./index-234002d0-1728525661307.js";import"./index-a5039825-1728525661307.js";import"./index-791965d8-1728525661307.js";import"./api-759580be-1728525661307.js";import"./api-1a36072a-1728525661307.js";import"./Cascader-38d28280-1728525661307.js";import"./index-5ded45d7-1728525661307.js";import"./index-3a73a98d-1728525661307.js";const fe="_listWrap_18rpq_1",_e="_searchList_18rpq_6",we="_searchInput_18rpq_6",ve="_infoListWrap_18rpq_15",Fe="_addBtnIcon_18rpq_18",Ce="_addBtn_18rpq_18",be="_btnGroup_18rpq_29",Te="_addClass_18rpq_36",ke="_workVisiable_18rpq_48",Le="_workContainer_18rpq_54",ye="_workTrain_18rpq_58",Ee="_resourceMain_18rpq_71",Ie="_removeVisiable_18rpq_77",Ne="_studentRemove_18rpq_83",Se="_listSection_18rpq_101",qe="_theTooltip_18rpq_111",Ae="_item_18rpq_114",Be="_header_18rpq_123",De="_navatar_18rpq_128",Oe="_userInfo_18rpq_141",Ye="_ing_18rpq_156",Me="_over_18rpq_157",Re="_content_18rpq_173",Ve="_homeTitle_18rpq_179",xe="_CLASSWORK_18rpq_196",je="_HOMEWORK_18rpq_197",We="_homeContent_18rpq_212",Pe="_homeworkText_18rpq_215",Ue="_pSection_18rpq_219",Ke="_p1_18rpq_222",He="_p2_18rpq_223",$e="_title_18rpq_246",Ge="_text_18rpq_251",ze="_errorBtn_18rpq_261",r={listWrap:fe,searchList:_e,searchInput:we,infoListWrap:ve,addBtnIcon:Fe,addBtn:Ce,btnGroup:be,addClass:Te,workVisiable:ke,workContainer:Le,workTrain:ye,resourceMain:Ee,removeVisiable:Ie,studentRemove:Ne,listSection:Se,theTooltip:qe,item:Ae,header:Be,navatar:De,userInfo:Oe,ing:Ye,over:Me,content:Re,homeTitle:Ve,CLASSWORK:xe,HOMEWORK:je,homeContent:We,homeworkText:Pe,pSection:Ue,p1:Ke,p2:He,title:$e,text:Ge,errorBtn:ze},Oa=()=>[h().startOf("month").valueOf(),h().endOf("month").valueOf()],Ya=V({name:"homework-record",setup(){const t=x({workVisiable:!1,resetVisiable:!1,resetItem:{},searchForm:{keyword:null,currentClass:"",homeworkType:"",currentGradeNum:"",subjectId:"",gradeYear:"",gradeLevel:"",homeworkObj:"",status:"",timer:null,selfFlag:!0},loading:!1,pagination:{page:1,rows:10,pageTotal:6},gradeNumList:[],tableList:[],studentVisible:!1,activeRow:null,showaddClass:!1,popSelectYearList:[],popSelectLevelList:[],previewModal:!1,previewParams:{type:"",courseId:"",subjectId:"",detailId:""}}),I=j(),N=W(),C=P(),b=U(),T=()=>{t.pagination.page=1,m(),E({current:t.searchForm,saveKey:b.path})};t.gradeNumList=re();const S=()=>{t.searchForm={keyword:null,homeworkType:"",currentClass:"",currentGradeNum:"",subjectId:"",gradeYear:"",gradeLevel:"",homeworkObj:"",status:"",timer:null,selfFlag:!0},t.popSelectYearList.length>0&&(t.searchForm.gradeYear=t.popSelectYearList[2].id),E({current:t.searchForm,saveKey:b.path}),t.pagination.page=1,m()},q=()=>{de(document.querySelector("#model-homework-height"),a=>{const o=a[0],{height:n}=o.contentRect;document.documentElement.style.setProperty("--window-page-lesson-height",n+"px")})},m=async()=>{t.loading=!0;try{const a=await le({...t.searchForm,...t.pagination,...Q(t.searchForm.timer,["startTime","endTime"],"YYYY-MM-DD")});(a.data.rows||[]).forEach(n=>{let g="",f="";n.studentLessonTrainingDetails&&n.studentLessonTrainingDetails.length>0&&n.studentLessonTrainingDetails.forEach(l=>{const i=l.trainingContent?JSON.parse(l.trainingContent):null;if(l.trainingType==="PRACTICE"&&l.musicName&&(g+=g?"《"+l.musicName+"》":"练习曲目:《"+l.musicName+"》",i)){const w=["".concat(i.practiceChapterBegin,"-").concat(i.practiceChapterEnd,"小节"),"速度".concat(i.practiceSpeed),"".concat(i.trainingTimes,"分钟")];g+=w.join(" | ")+";"}if(l.trainingType==="EVALUATION"&&l.musicName&&(f+=f?"《"+l.musicName+"》":"评测曲目:《"+l.musicName+"》",i)){const w=["".concat(ge[i.evaluateDifficult]),i.practiceChapterBegin||i.practiceChapterEnd?"".concat(i.practiceChapterBegin,"-").concat(i.practiceChapterEnd,"小节"):"全部小节","".concat(i.trainingTimes,"分合格")];f+=w.join(" | ")+";"}}),n.pTitle=g,n.eTitle=f;let _=n.homeworkObjName;if(n.homeworkObjName){const l=n.homeworkObjName.split(",");l.length>5?_=l.slice(0,5).join("、")+"...等".concat(l.length).concat(n.homeworkObj==="CLASS"?"个班级":"人"):_=l.join("、")}n.studentName=_}),t.tableList=a.data.rows,t.pagination.pageTotal=a.data.total,t.loading=!1}catch(a){t.loading=!1,console.log(a)}},A=async()=>{try{const{data:a}=await ee(),o=a||[];o.forEach(n=>{n.name=n.name+"学年"}),o.unshift({id:"",name:"全部学年"}),t.popSelectYearList=o||[],o.length>0&&!t.searchForm.gradeYear&&(t.searchForm.gradeYear=o[2].id)}catch(a){}},B=async()=>{try{const{data:a}=await ae(),o=a||[];o.forEach(n=>{n.name=n.name+"级"}),o.unshift({id:"",name:"全部学级"}),t.popSelectLevelList=o||[],o.length>0&&!t.searchForm.gradeLevel&&(t.searchForm.gradeLevel=o[0].id)}catch(a){}};te({current:t.searchForm,callBack:a=>{t.searchForm=a}});const D=async()=>{try{await ie({lessonTrainingId:t.resetItem.id}),N.success("撤回成功"),t.resetVisiable=!1,T()}catch(a){}},O=a=>{if(window.matchMedia("(display-mode: standalone)").matches)X.application=window.matchMedia("(display-mode: standalone)").matches,t.previewModal=!0,Z(),t.previewParams={type:"preview",courseId:a.chapterLessonCoursewareId,subjectId:null,detailId:a.lessonCoursewareKnowledgeDetailId,lessonCourseId:a.lessonCoursewareId};else{const{href:o}=C.resolve({path:"/attend-class",query:{type:"preview",courseId:a.chapterLessonCoursewareId,instrumentId:null,detailId:a.lessonCoursewareKnowledgeDetailId,lessonCourseId:a.lessonCoursewareId}});window.open(o,+new Date+"")}};return K(async()=>{t.loading=!0,await A(),await B(),await m(),t.loading=!1}),()=>e("div",{class:r.listWrap},[e("div",{class:r.searchList},[e(H,{"label-placement":"left",inline:!0,ref:I},{default:()=>[e(u,null,{default:()=>[e(Y,c({placeholder:"请输入作业标题关键词"},{class:r.searchInput,searchWord:t.searchForm.keyword,onChangeValue:a=>t.searchForm.keyword=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:[{id:"",name:"全部类型"},{id:"CLASSWORK",name:"课外作业"},{id:"HOMEWORK",name:"课后作业"}],placeholder:"选择类型",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:t.searchForm.homeworkType,"onUpdate:value":a=>t.searchForm.homeworkType=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:[{id:"",name:"作业对象"},{id:"PERSON",name:"个人"},{id:"CLASS",name:"班级"}],placeholder:"选择作业对象",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:t.searchForm.homeworkObj,"onUpdate:value":a=>t.searchForm.homeworkObj=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:t.popSelectYearList,placeholder:"选择学年",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:t.searchForm.gradeYear,"onUpdate:value":a=>t.searchForm.gradeYear=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:t.popSelectLevelList,placeholder:"选择学级",clearable:!0,inline:!0,labelField:"name",valueField:"id"},{value:t.searchForm.gradeLevel,"onUpdate:value":a=>t.searchForm.gradeLevel=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:t.gradeNumList,placeholder:"选择年级",clearable:!0,inline:!0},{value:t.searchForm.currentGradeNum,"onUpdate:value":a=>t.searchForm.currentGradeNum=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:se,placeholder:"选择班级",clearable:!0,inline:!0},{value:t.searchForm.currentClass,"onUpdate:value":a=>t.searchForm.currentClass=a}),null)]}),e(u,null,{default:()=>[e(p,c({options:[{value:"",label:"全部状态"},{value:0,label:"进行中"},{value:1,label:"已结束"}],placeholder:"选择状态",clearable:!0,inline:!0},{value:t.searchForm.status,"onUpdate:value":a=>t.searchForm.status=a}),null)]}),e(u,null,{default:()=>[e(M,{class:r.CDatePickerItem,separator:"-",type:"daterange",value:t.searchForm.timer,"onUpdate:value":a=>t.searchForm.timer=a,timerValue:t.searchForm.timer},null)]}),e(u,null,{default:()=>[e(v,{justify:"end"},{default:()=>[e(d,{type:"primary",class:"searchBtn",onClick:T},{default:()=>[s("搜索")]}),e(d,{type:"primary",ghost:!0,class:"resetBtn",onClick:S},{default:()=>[s("重置")]})]})]})]})]),e(d,{class:r.addBtn,type:"primary",onClick:()=>{t.workVisiable=!0,me.nextTick(()=>{q()})}},{default:()=>[s("布置作业")],icon:()=>e($,null,[e(G,{class:r.addBtnIcon,previewDisabled:!0,src:R},null)])}),e("div",{class:r.tableWrap},[e(z,{show:t.loading},{default:()=>[e("div",{style:{minHeight:"40vh"}},[e("div",{class:r.listSection},[t.tableList.map(a=>e("div",{class:r.item,onClick:()=>{C.push({path:"/homework-record-detail",query:{id:a.id,name:a.name}})}},[e("div",{class:r.header},[e(J,{class:r.navatar,round:!0,src:a.teacherAvatar||oe},null),e("div",{class:r.userInfo},[e("h2",null,[a.teacherName]),e("p",null,[s("布置时间:"),h(a.createTime).format("YYYY-MM-DD HH:mm"),e("span",null,[s(" | ")]),e("span",null,[s("截止时间:"),h(a.expireDate).format("YYYY-MM-DD HH:mm")])])]),e("div",{class:a.status?r.over:r.ing},null)]),e("div",{class:r.content},[e("div",{class:r.homeTitle},[e("p",null,[e("span",{class:r[a.homeworkType]},[a.homeworkType==="CLASSWORK"?"课外":"课后"]),a.name]),e(v,null,{default:()=>[a.chapterLessonCoursewareId&&e(d,{class:r.errorBtn,text:!0,color:"#1677FF",onClick:o=>{o.stopPropagation(),O(a)}},{default:()=>[s("查看课件")]}),!a.status&&e(d,{class:r.errorBtn,text:!0,color:"#1677FF",onClick:o=>{o.stopPropagation(),t.resetVisiable=!0,t.resetItem=a}},{default:()=>[s("撤回")]})]})]),e("div",{class:r.homeContent},[e("span",{class:r.title},[s("作业对象:")]),e("span",{class:r.text},[a.studentName])]),e("div",{class:[r.homeContent,r.homeworkText]},[e("span",{class:r.title},[s("作业内容:")]),e("div",{class:r.pSection},[a.pTitle&&e(k,{trigger:"hover",class:r.theTooltip,delay:500},{trigger:()=>e("p",{class:[r.text,r.p1,r.theTooltip]},[a.pTitle]),default:()=>a.pTitle}),a.eTitle&&e(k,{trigger:"hover",class:r.theTooltip,delay:500},{trigger:()=>e("p",{class:[r.text,r.p2,r.theTooltip]},[a.eTitle]),default:()=>a.eTitle})])]),e("div",{class:r.homeSubmit},[e("span",{class:r.title},[s("已提交:")]),e("span",{class:r.text},[a.trainingNum||0,s("/"),a.expectNum||0,s("人")]),e(F,{vertical:!0},null),e("span",{class:r.title},[s("提交率:")]),e("span",{class:r.text},[a.trainingRate||0,s("%")]),e(F,{vertical:!0},null),e("span",{class:r.title},[s("合格人数:")]),e("span",{class:r.text},[a.standardNum||0,s("人")]),e(F,{vertical:!0},null),e("span",{class:r.title},[s("合格率:")]),e("span",{class:r.text},[a.qualifiedRate||0,s("%")])])])]))]),t.tableList.length<=0&&!t.loading&&e(ue,{class:r.nowEmpty},null)])]}),t.tableList.length>0&&e(ne,{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:m},null)]),e(L,{maskClosable:y,show:t.resetVisiable,"onUpdate:show":a=>t.resetVisiable=a,preset:"card",class:["modalTitle",r.removeVisiable],title:"撤回作业"},{default:()=>[e("div",{class:r.studentRemove},[e("p",null,[s("撤回作业后,此条作业将被删除,是否确认撤回【"),t.resetItem.name,s("】?")]),e(v,{class:r.btnGroup,justify:"center"},{default:()=>[e(d,{round:!0,onClick:()=>t.resetVisiable=!1},{default:()=>[s("取消")]}),e(d,{round:!0,type:"primary",onClick:D},{default:()=>[s("确定")]})]})])]}),e(L,{maskClosable:y,show:t.workVisiable,"onUpdate:show":a=>t.workVisiable=a,preset:"card",class:["modalTitle background",r.workVisiable],title:"作业详情"},{default:()=>[e("div",{id:"model-homework-height",class:r.workContainer},[e("div",{class:r.workTrain},[e(ce,{lessonPreTraining:{title:h().format("YYYY年MM月DD日")+"-课外作业"},cardType:"homeworkRecord",onChange:a=>{t.workVisiable=a.status,m()}},null)]),e("div",{class:r.resourceMain},[e(pe,{cardType:"homerowk-record"},null)])])]}),e(he,{show:t.previewModal,"onUpdate:show":a=>t.previewModal=a,type:"attend",params:t.previewParams},null)])}});export{Ya as default,Oa as getCurrentMonth};