1 |
- import{B as g}from"./index-b5933c28-1694078809672.js";import{d as _,k as v}from"./isCollaose-2ffd9935-1694078809672.js";import{T as C}from"./index-b4d77148-1694078809672.js";import{u as F}from"./index-a9a10738-1694078809672.js";import{s as j}from"./state-0273c02e-1694078809672.js";import{U as I}from"./updateSubject-295b4626-1694078809672.js";import{d as q,e as N,r as S,n as k,f as s,h as R,W as h,A as x,c8 as G,F as T,k as w,v as A}from"./index-ce8959eb-1694078809672.js";import{u as E}from"./index-4ed60982-1694078809672.js";import{N as L}from"./contants-ee65eda7-1694078809672.js";const U="_attendClass_qy21g_1",K="_attendClassSearch_qy21g_4",z="_iconSearch_qy21g_20",B="_classList_qy21g_24",M="_listSection_qy21g_29",D="_emptySection_qy21g_32",O="_thingItem_qy21g_36",P="_title_qy21g_56",V="_subjects_qy21g_73",W="_noSubjects_qy21g_84",$="_content_qy21g_89",l={attendClass:U,attendClassSearch:K,iconSearch:z,classList:B,listSection:M,emptySection:D,thingItem:O,title:P,subjects:V,noSubjects:W,content:$},f=[];for(let a=1;a<=40;a++)f.push({label:a+"班",value:a});const le=q({name:"attend-class",props:{type:{type:String,default:"change"}},emits:["close","preview","confirm"],setup(a,{emit:u}){const r=F(),t=N({showSubjectClass:!1,activeRow:{},keyword:null,currentGradeNum:null,currentClass:null}),d=S([]),n=S(!1),b=async e=>{try{if(a.type=="change"){e.subjectId?u("confirm",{lastUseCoursewareId:e.lessonCoursewareId,unit:e.lessonCoursewareKnowledgeDetailId,subjectId:e.subjectId,name:e.name,classGroupId:e.id}):(t.showSubjectClass=!0,t.activeRow=e);return}const o=await _({lessonCoursewareKnowledgeDetailId:r.selectKey,classGroupId:e.id});u("close"),u("preview",{type:"class",classId:o.data,classGroupId:e.id,subjectId:r.getSubjectId,detailId:r.getSelectKey,lessonCourseId:r.getBaseCourseware.id}),window.matchMedia("(display-mode: standalone)").matches&&(j.application=window.matchMedia("(display-mode: standalone)").matches,setTimeout(()=>{y()},200))}catch(o){}},y=()=>{const e=document.documentElement;document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():e.requestFullscreen&&e.requestFullscreen()||e.mozRequestFullScreen&&e.mozRequestFullScreen()||e.webkitRequestFullscreen&&e.webkitRequestFullscreen()||e.msRequestFullscreen&&e.msRequestFullscreen()},i=async()=>{n.value=!0;try{const{data:e}=await v({page:1,rows:99,upgradeFlag:!0,...t}),o=e.rows||[],p=[];o.forEach(m=>{m.preStudentNum>0&&p.push(m)}),d.value=p}catch(e){}n.value=!1},c=E(()=>i(),500);return k(()=>{i()}),()=>s("div",{class:l.attendClass},[s("div",{class:l.attendClassSearch},[s(R,{placeholder:"请输入班级名称",clearable:!0,value:t.keyword,"onUpdate:value":e=>t.keyword=e,onKeyup:e=>{e.code==="Enter"&&c()},onClear:()=>c()},{prefix:()=>s("span",{class:"icon-search-input",onClick:()=>c()},null)}),s(h,{placeholder:"全部年级",clearable:!0,options:[{label:"全部年级",value:null},...g.grades],value:t.currentGradeNum,"onUpdate:value":[e=>t.currentGradeNum=e,()=>c()]},null),s(h,{placeholder:"全部班级",clearable:!0,options:[{label:"全部班级",value:null},...f],value:t.currentClass,"onUpdate:value":[e=>t.currentClass=e,()=>c()]},null)]),s(L,{class:l.classList},{default:()=>[s(x,{show:n.value},{default:()=>[s("div",{class:[l.listSection,!n.value&&d.value.length<=0?l.emptySection:""]},[d.value.map(e=>s("div",{onClick:()=>b(e)},[s(G,{class:[l.thingItem,"isFull"]},{header:()=>s(T,null,[s("div",{class:l.title},[e.name,w(" "),e.preStudentNum,w("人")]),s("div",{class:[l.subjects,e.subjectName?"":l.noSubjects]},[e.subjectName?e.subjectName:"暂无声部"])]),default:()=>e.lastStudy&&s("div",{class:l.content},[e.lastStudy])})])),!n.value&&d.value.length<=0&&s(C,null,null)])]})]}),s(A,{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=>{u("confirm",e)},onClose:()=>t.showSubjectClass=!1},null):null]})])}});export{le as A};
|