import{B as g}from"./index-fa3071ef-1742362401929.js";import{n as y,r as I}from"./index-b3dfb345-1742362401929.js";import{T as F}from"./index-ed5621e1-1742362401929.js";import{u as N}from"./index-2ccf049e-1742362401929.js";import{d as j,e as k,r as p,q as E,f as t,h as G,ac as h,a9 as R,ad as q,ai as A,k as v,l as x,m as T,z as D}from"./index-ab183db6-1742362401929.js";import{U as L}from"./updateSubject-43013594-1742362401929.js";import{a as U}from"./api-c54437f8-1742362401929.js";import{a as z}from"./index-46c00744-1742362401929.js";import{N as K}from"./Scrollbar-a8bb8073-1742362401929.js";const B="_attendClass_ev241_1",M="_attendClassSearch_ev241_4",Y="_iconSearch_ev241_16",O="_classList_ev241_20",P="_listSection_ev241_25",V="_emptySection_ev241_28",$="_thingItem_ev241_32",H="_title_ev241_55",J="_subjects_ev241_72",Q="_noSubjects_ev241_83",W="_content_ev241_88",l={attendClass:B,attendClassSearch:M,iconSearch:Y,classList:O,listSection:P,emptySection:V,thingItem:$,title:H,subjects:J,noSubjects:Q,content:W},w=[];for(let n=1;n<=40;n++)w.push({label:n+"班",value:n});const ue=j({name:"attend-class",props:{type:{type:String,default:"change"}},emits:["close","preview","confirm"],setup(n,{emit:r}){const c=N(),s=k({showSubjectClass:!1,activeRow:{},keyword:null,currentGradeNum:null,currentClass:null}),S=p(null),d=p([]),u=p(!1),C=async e=>{try{if(n.type=="change"){e.instrumentId?r("confirm",{lastUseCoursewareId:e.lessonCoursewareId,unit:e.lessonCoursewareKnowledgeDetailId,instrumentId:c.getInstrumentId,courseScheduleSubjectId:e.courseScheduleSubjectId,name:e.name,classGroupId:e.id,preStudentNum:e.preStudentNum}):(s.showSubjectClass=!0,s.activeRow=e);return}const a=await y({lessonCoursewareKnowledgeDetailId:c.selectKey,classGroupId:e.id,instrumentId:c.getInstrumentId});r("close"),r("preview",{type:"class",classId:a.data,classGroupId:e.id,instrumentId:c.getInstrumentId,detailId:c.getSelectKey,lessonCourseId:c.getBaseCourseware.id,preStudentNum:e.preStudentNum}),window.matchMedia("(display-mode: standalone)").matches&&(D.application=window.matchMedia("(display-mode: standalone)").matches,setTimeout(()=>{f()},200))}catch(a){}},f=()=>{const e=document.documentElement,a=document;a.fullScreen||a.mozFullScreen||a.webkitIsFullScreen?a.exitFullscreen?a.exitFullscreen():a.mozCancelFullScreen?a.mozCancelFullScreen():a.webkitExitFullscreen&&a.webkitExitFullscreen():e.requestFullscreen&&e.requestFullscreen()||e.mozRequestFullScreen&&e.mozRequestFullScreen()||e.webkitRequestFullscreen&&e.webkitRequestFullscreen()||e.msRequestFullscreen&&e.msRequestFullscreen()},i=async()=>{u.value=!0;try{const{data:e}=await I({page:1,rows:99,gradeYear:S.value,upgradeFlag:!0,...s}),a=e.rows||[],m=[];a.forEach(b=>{m.push(b)}),d.value=m}catch(e){}u.value=!1},o=z(()=>i(),500),_=async()=>{try{const{data:e}=await U({});S.value=e}catch(e){}};return E(async()=>{u.value=!0,await _(),i()}),()=>t("div",{class:l.attendClass},[t("div",{class:l.attendClassSearch},[t(G,{placeholder:"请输入班级名称",clearable:!0,value:s.keyword,"onUpdate:value":e=>s.keyword=e,onKeyup:e=>{e.code==="Enter"&&o()},onClear:()=>o()},{prefix:()=>t("span",{class:"icon-search-input",onClick:()=>o()},null)}),t(h,{placeholder:"全部年级",clearable:!0,options:[{label:"全部年级",value:null},...g.grades],value:s.currentGradeNum,"onUpdate:value":[e=>s.currentGradeNum=e,()=>o()]},null),t(h,{placeholder:"全部班级",clearable:!0,options:[{label:"全部班级",value:null},...w],value:s.currentClass,"onUpdate:value":[e=>s.currentClass=e,()=>o()]},null)]),t(K,{class:l.classList},{default:()=>[t(R,{show:u.value},{default:()=>[t("div",{class:[l.listSection,!u.value&&d.value.length<=0?l.emptySection:""]},[d.value.map(e=>t("div",{onClick:()=>C(e)},[t(q,{class:[l.thingItem,"isFull"]},{header:()=>t(A,null,[t("div",{class:l.title},[e.name,v(" "),e.preStudentNum,v("人")]),t("div",{class:[l.subjects,e.instrumentName?"":l.noSubjects]},[e.instrumentName?e.instrumentName:"暂无乐器"])]),default:()=>e.lastStudy&&t("div",{class:l.content},[e.lastStudy])})])),!u.value&&d.value.length<=0&&t(F,null,null)])]})]}),t(x,{maskClosable:T,show:s.showSubjectClass,"onUpdate:show":e=>s.showSubjectClass=e,style:{width:"500px"},preset:"card",class:["modalTitle background"],title:"修改乐器"},{default:()=>[s.showSubjectClass?t(L,{activeRow:s.activeRow,onGetList:()=>i(),onConfirm:e=>{r("confirm",e)},onClose:()=>s.showSubjectClass=!1},null):null]})])}});export{ue as A};
