import{B as C}from"./index-5d3c3cc0-1706882452509.js";import{N as _,d as j,n as F}from"./api-11298959-1706882452509.js";import{T as g}from"./index-dcd64cc7-1706882452509.js";import{u as y}from"./index-ab6b0b21-1706882452509.js";import{s as I}from"./state-6ce04b36-1706882452509.js";import{U as N}from"./updateSubject-68dce01e-1706882452509.js";import{d as E,e as k,r as S,p as A,f as s,h as R,C as m,A as q,D as x,F as D,k as h,l as G}from"./index-f5a86b16-1706882452509.js";import{a as T}from"./index-0239170e-1706882452509.js";const L="_attendClass_ev241_1",U="_attendClassSearch_ev241_4",K="_iconSearch_ev241_16",z="_classList_ev241_20",B="_listSection_ev241_25",M="_emptySection_ev241_28",O="_thingItem_ev241_32",P="_title_ev241_55",V="_subjects_ev241_72",$="_noSubjects_ev241_83",H="_content_ev241_88",a={attendClass:L,attendClassSearch:U,iconSearch:K,classList:z,listSection:B,emptySection:M,thingItem:O,title:P,subjects:V,noSubjects:$,content:H},v=[];for(let c=1;c<=40;c++)v.push({label:c+"班",value:c});const te=E({name:"attend-class",props:{type:{type:String,default:"change"}},emits:["close","preview","confirm"],setup(c,{emit:r}){const n=y(),t=k({showSubjectClass:!1,activeRow:{},keyword:null,currentGradeNum:null,currentClass:null}),d=S([]),u=S(!1),b=async e=>{try{if(c.type=="change"){e.subjectId?r("confirm",{lastUseCoursewareId:e.lessonCoursewareId,unit:e.lessonCoursewareKnowledgeDetailId,subjectId:e.subjectId,courseScheduleSubjectId:e.courseScheduleSubjectId,name:e.name,classGroupId:e.id,preStudentNum:e.preStudentNum}):(t.showSubjectClass=!0,t.activeRow=e);return}const l=await j({lessonCoursewareKnowledgeDetailId:n.selectKey,classGroupId:e.id,subjectId:n.getSubjectId});r("close"),r("preview",{type:"class",classId:l.data,classGroupId:e.id,subjectId:n.getSubjectId,detailId:n.getSelectKey,lessonCourseId:n.getBaseCourseware.id,preStudentNum:e.preStudentNum}),window.matchMedia("(display-mode: standalone)").matches&&(I.application=window.matchMedia("(display-mode: standalone)").matches,setTimeout(()=>{w()},200))}catch(l){}},w=()=>{const e=document.documentElement,l=document;l.fullScreen||l.mozFullScreen||l.webkitIsFullScreen?l.exitFullscreen?l.exitFullscreen():l.mozCancelFullScreen?l.mozCancelFullScreen():l.webkitExitFullscreen&&l.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 F({page:1,rows:99,upgradeFlag:!0,...t}),l=e.rows||[],p=[];l.forEach(f=>{p.push(f)}),d.value=p}catch(e){}u.value=!1},o=T(()=>i(),500);return A(()=>{i()}),()=>s("div",{class:a.attendClass},[s("div",{class:a.attendClassSearch},[s(R,{placeholder:"请输入班级名称",clearable:!0,value:t.keyword,"onUpdate:value":e=>t.keyword=e,onKeyup:e=>{e.code==="Enter"&&o()},onClear:()=>o()},{prefix:()=>s("span",{class:"icon-search-input",onClick:()=>o()},null)}),s(m,{placeholder:"全部年级",clearable:!0,options:[{label:"全部年级",value:null},...C.grades],value:t.currentGradeNum,"onUpdate:value":[e=>t.currentGradeNum=e,()=>o()]},null),s(m,{placeholder:"全部班级",clearable:!0,options:[{label:"全部班级",value:null},...v],value:t.currentClass,"onUpdate:value":[e=>t.currentClass=e,()=>o()]},null)]),s(_,{class:a.classList},{default:()=>[s(q,{show:u.value},{default:()=>[s("div",{class:[a.listSection,!u.value&&d.value.length<=0?a.emptySection:""]},[d.value.map(e=>s("div",{onClick:()=>b(e)},[s(x,{class:[a.thingItem,"isFull"]},{header:()=>s(D,null,[s("div",{class:a.title},[e.name,h(" "),e.preStudentNum,h("人")]),s("div",{class:[a.subjects,e.subjectName?"":a.noSubjects]},[e.subjectName?e.subjectName:"暂无声部"])]),default:()=>e.lastStudy&&s("div",{class:a.content},[e.lastStudy])})])),!u.value&&d.value.length<=0&&s(g,null,null)])]})]}),s(G,{show:t.showSubjectClass,"onUpdate:show":e=>t.showSubjectClass=e,style:{width:"500px"},preset:"card",class:["modalTitle background"],title:"修改声部"},{default:()=>[t.showSubjectClass?s(N,{activeRow:t.activeRow,onGetList:()=>i(),onConfirm:e=>{r("confirm",e)},onClose:()=>t.showSubjectClass=!1},null):null]})])}});export{te as A};
