index-428c12d9.js 4.0 KB

1
  1. import{B as _}from"./index-5c624267.js";import{d as g,k as v}from"./isCollaose-13834238.js";import{T as C}from"./index-31c60059.js";import{u as F}from"./index-cb85a572.js";import{s as j}from"./state-225a7cc7.js";import{U as I}from"./updateSubject-9f80fe43.js";import{d as q,e as N,r as S,n as E,f as s,h as k,R as h,A as R,c9 as A,F as x,k as w,v as G}from"./index-a4aa5952.js";import{u as T}from"./index-0f629b87.js";import{N as L}from"./contants-8a18a84b.js";const U="_attendClass_qy21g_1",D="_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",$="_noSubjects_qy21g_84",H="_content_qy21g_89",l={attendClass:U,attendClassSearch:D,iconSearch:K,classList:z,listSection:B,emptySection:M,thingItem:O,title:P,subjects:V,noSubjects:$,content:H},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 g({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,...t}),o=e.rows||[],p=[];o.forEach(m=>{m.preStudentNum>0&&p.push(m)}),d.value=p}catch(e){}n.value=!1},c=T(()=>i(),500);return E(()=>{i()}),()=>s("div",{class:l.attendClass},[s("div",{class:l.attendClassSearch},[s(k,{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},..._.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(R,{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(A,{class:[l.thingItem,"isFull"]},{header:()=>s(x,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(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=>{u("confirm",e)},onClose:()=>t.showSubjectClass=!1},null):null]})])}});export{le as A};