1 |
- import{B as C}from"./index-dcad6965-1714059328110.js";import{m as _,n as F}from"./index-8639da96-1714059328110.js";import{T as g}from"./index-3a6c73b8-1714059328110.js";import{u as y}from"./index-4a5ca751-1714059328110.js";import{s as I}from"./state-0b4d16be-1714059328110.js";import{U as j}from"./updateSubject-723859ee-1714059328110.js";import{d as N,e as E,r as m,p as k,f as s,h as R,G as S,C as A,H as G,F as q,k as h,l as x}from"./index-e9eb06c1-1714059328110.js";import{a as T}from"./index-596a056a-1714059328110.js";import{N as D}from"./Scrollbar-6abf08b7-1714059328110.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",H="_noSubjects_ev241_83",$="_content_ev241_88",a={attendClass:L,attendClassSearch:U,iconSearch:K,classList:z,listSection:B,emptySection:M,thingItem:O,title:P,subjects:V,noSubjects:H,content:$},v=[];for(let n=1;n<=40;n++)v.push({label:n+"班",value:n});const le=N({name:"attend-class",props:{type:{type:String,default:"change"}},emits:["close","preview","confirm"],setup(n,{emit:r}){const c=y(),t=E({showSubjectClass:!1,activeRow:{},keyword:null,currentGradeNum:null,currentClass:null}),d=m([]),u=m(!1),w=async e=>{try{if(n.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:c.selectKey,classGroupId:e.id,subjectId:c.getSubjectId});r("close"),r("preview",{type:"class",classId:l.data,classGroupId:e.id,subjectId:c.getSubjectId,detailId:c.getSelectKey,lessonCourseId:c.getBaseCourseware.id,preStudentNum:e.preStudentNum}),window.matchMedia("(display-mode: standalone)").matches&&(I.application=window.matchMedia("(display-mode: standalone)").matches,setTimeout(()=>{b()},200))}catch(l){}},b=()=>{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 k(()=>{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(S,{placeholder:"全部年级",clearable:!0,options:[{label:"全部年级",value:null},...C.grades],value:t.currentGradeNum,"onUpdate:value":[e=>t.currentGradeNum=e,()=>o()]},null),s(S,{placeholder:"全部班级",clearable:!0,options:[{label:"全部班级",value:null},...v],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(G,{class:[a.thingItem,"isFull"]},{header:()=>s(q,null,[s("div",{class:a.title},[e.name,h(" "),e.preStudentNum,h("人")]),s("div",{class:[a.subjects,e.instrumentName?"":a.noSubjects]},[e.instrumentName?e.instrumentName:"暂无乐器"])]),default:()=>e.lastStudy&&s("div",{class:a.content},[e.lastStudy])})])),!u.value&&d.value.length<=0&&s(g,null,null)])]})]}),s(x,{show:t.showSubjectClass,"onUpdate:show":e=>t.showSubjectClass=e,style:{width:"500px"},preset:"card",class:["modalTitle background"],title:"修改乐器"},{default:()=>[t.showSubjectClass?s(j,{activeRow:t.activeRow,onGetList:()=>i(),onConfirm:e=>{r("confirm",e)},onClose:()=>t.showSubjectClass=!1},null):null]})])}});export{le as A};
|