import{B as y}from"./index-e3cc0a1b-1694073636386.js";import{d as _,k as C}from"./isCollaose-165fcc78-1694073636386.js";import{T as v}from"./index-abb28f9d-1694073636386.js";import{u as j}from"./index-68f4d275-1694073636386.js";import{s as F}from"./state-27312f32-1694073636386.js";import{U as I}from"./updateSubject-c0335f40-1694073636386.js";import{d as N,e as q,r as S,n as E,f as s,h as k,W as m,B as R,c8 as A,F as x,k as h,w as G}from"./index-b1b92161-1694073636386.js";import{u as T}from"./index-bfe5aa38-1694073636386.js";import{N as D}from"./contants-addb4cde-1694073636386.js";const L="_attendClass_qy21g_1",U="_attendClassSearch_qy21g_4",B="_iconSearch_qy21g_20",K="_classList_qy21g_24",z="_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:B,classList:K,listSection:z,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 C({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(R,{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(A,{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(v,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};
