index-f0a031c8-1734950731618.js 4.3 KB

1
  1. import{B as g}from"./index-85d522f9-1734950731618.js";import{m as I,q as y}from"./api-5c1c8c26-1734950731618.js";import{T as F}from"./index-043f1db0-1734950731618.js";import{u as N}from"./index-5fd713bb-1734950731618.js";import{d as j,e as E,r as p,q as k,f as t,h as q,I as h,E as G,J as R,F as A,k as v,l as x,m as T,z as D}from"./index-efb66432-1734950731618.js";import{U as L}from"./updateSubject-4a5e4bdd-1734950731618.js";import{a as U}from"./api-5d798bfa-1734950731618.js";import{a as z}from"./index-5585b177-1734950731618.js";import{N as K}from"./Scrollbar-10f58cff-1734950731618.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",J="_thingItem_ev241_32",$="_title_ev241_55",H="_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:J,title:$,subjects:H,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=E({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 I({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 y({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 k(async()=>{u.value=!0,await _(),i()}),()=>t("div",{class:l.attendClass},[t("div",{class:l.attendClassSearch},[t(q,{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(G,{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(R,{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};