index-fd63d39b-1706107518515.js 4.1 KB

1
  1. import{B as C}from"./index-8c5105a6-1706107518515.js";import{N as _,d as j,n as F}from"./api-2baae04f-1706107518515.js";import{T as g}from"./index-1aaceba7-1706107518515.js";import{u as y}from"./index-d5ab64c5-1706107518515.js";import{s as I}from"./state-ba682549-1706107518515.js";import{U as N}from"./updateSubject-ec9c9333-1706107518515.js";import{d as E,e as k,r as S,p as A,f as s,h as R,C as m,A as q,D as x,F as D,k as h,l as G}from"./index-18b8b0d9-1706107518515.js";import{a as T}from"./index-0e750973-1706107518515.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",$="_noSubjects_ev241_83",H="_content_ev241_88",a={attendClass:L,attendClassSearch:U,iconSearch:K,classList:z,listSection:B,emptySection:M,thingItem:O,title:P,subjects:V,noSubjects:$,content:H},v=[];for(let c=1;c<=40;c++)v.push({label:c+"班",value:c});const te=E({name:"attend-class",props:{type:{type:String,default:"change"}},emits:["close","preview","confirm"],setup(c,{emit:r}){const n=y(),t=k({showSubjectClass:!1,activeRow:{},keyword:null,currentGradeNum:null,currentClass:null}),d=S([]),u=S(!1),b=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 j({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&&(I.application=window.matchMedia("(display-mode: standalone)").matches,setTimeout(()=>{w()},200))}catch(l){}},w=()=>{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 A(()=>{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(m,{placeholder:"全部年级",clearable:!0,options:[{label:"全部年级",value:null},...C.grades],value:t.currentGradeNum,"onUpdate:value":[e=>t.currentGradeNum=e,()=>o()]},null),s(m,{placeholder:"全部班级",clearable:!0,options:[{label:"全部班级",value:null},...v],value:t.currentClass,"onUpdate:value":[e=>t.currentClass=e,()=>o()]},null)]),s(_,{class:a.classList},{default:()=>[s(q,{show:u.value},{default:()=>[s("div",{class:[a.listSection,!u.value&&d.value.length<=0?a.emptySection:""]},[d.value.map(e=>s("div",{onClick:()=>b(e)},[s(x,{class:[a.thingItem,"isFull"]},{header:()=>s(D,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(g,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(N,{activeRow:t.activeRow,onGetList:()=>i(),onConfirm:e=>{r("confirm",e)},onClose:()=>t.showSubjectClass=!1},null):null]})])}});export{te as A};