import{B as y}from"./index-af10e15c.js";import{d as _,k as v}from"./isCollaose-3bee922d.js";import{T as C}from"./index-9e5d3d42.js";import{u as j}from"./index-44eee29c.js";import{s as F}from"./state-3601bb19.js";import{U as I}from"./updateSubject-ee5a6fd2.js";import{d as N,e as q,r as S,n as E,f as s,h as k,W as m,A,c8 as R,F as x,k as h,v as G}from"./index-e7035897.js";import{u as T}from"./index-94975ec6.js";import{N as D}from"./contants-c9a6e0a3.js";const L="_attendClass_qy21g_1",U="_attendClassSearch_qy21g_4",K="_iconSearch_qy21g_20",z="_classList_qy21g_24",B="_listSection_qy21g_29",M="_emptySection_qy21g_32",O="_thingItem_qy21g_36",P="_title_qy21g_56",V="_subjects_qy21g_73",W="_noSubjects_qy21g_84",$="_content_qy21g_89",a={attendClass:L,attendClassSearch:U,iconSearch:K,classList:z,listSection:B,emptySection:M,thingItem:O,title:P,subjects:V,noSubjects:W,content:$},b=[];for(let c=1;c<=40;c++)b.push({label:c+"班",value:c});const le=N({name:"attend-class",props:{type:{type:String,default:"change"}},emits:["close","preview","confirm"],setup(c,{emit:r}){const n=j(),t=q({showSubjectClass:!1,activeRow:{},keyword:null,currentGradeNum:null,currentClass:null}),d=S([]),u=S(!1),w=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 _({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&&(F.application=window.matchMedia("(display-mode: standalone)").matches,setTimeout(()=>{f()},200))}catch(l){}},f=()=>{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 v({page:1,rows:99,upgradeFlag:!0,...t}),l=e.rows||[],p=[];l.forEach(g=>{p.push(g)}),d.value=p}catch(e){}u.value=!1},o=T(()=>i(),500);return E(()=>{i()}),()=>s("div",{class:a.attendClass},[s("div",{class:a.attendClassSearch},[s(k,{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},...y.grades],value:t.currentGradeNum,"onUpdate:value":[e=>t.currentGradeNum=e,()=>o()]},null),s(m,{placeholder:"全部班级",clearable:!0,options:[{label:"全部班级",value:null},...b],value:t.currentClass,"onUpdate:value":[e=>t.currentClass=e,()=>o()]},null)]),s(D,{class:a.classList},{default:()=>[s(A,{show:u.value},{default:()=>[s("div",{class:[a.listSection,!u.value&&d.value.length<=0?a.emptySection:""]},[d.value.map(e=>s("div",{onClick:()=>w(e)},[s(R,{class:[a.thingItem,"isFull"]},{header:()=>s(x,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(C,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(I,{activeRow:t.activeRow,onGetList:()=>i(),onConfirm:e=>{r("confirm",e)},onClose:()=>t.showSubjectClass=!1},null):null]})])}});export{le as A};