import{d as k,O as b,i,o as A,g as a,R as w,B as r,h as d,F as y,S as x}from"./index-123c6a88.js";import{M as N}from"./index-41010493.js";import{M as D}from"./index-3266a6cb.js";import{s as g,M as C,A as F,a as I,b as R,c as O,e as P}from"./api-e85f391a.js";import{S as L}from"./skeletion-index-057952dd.js";import{M as T}from"./index-782f12da.js";import{D as B,a as M}from"./index-17fb7d15.js";import{P as G}from"./index-32f2e5af.js";import{L as V}from"./index-d6400189.js";import"./index-2d329a72.js";import"./index-6b7987bf.js";import"./icon-student-default-4c78efb2.js";import"./index-368e6b72.js";import"./index-d3763f9b.js";import"./index-49d39bf5.js";import"./index-b3d547ae.js";import"./use-tab-status-5973befe.js";const se=k({name:"student-manage",setup(){const l=b({page:1,rows:20,keyword:"",musicGroupId:"",statusList:["QUIT"],subjectId:"",vipFlag:""}),t=b({skelet:!0,refresh:!1,loading:!1,finshed:!1,list:[],musicGroups:[{text:"全部乐团",value:""}],musicGroupName:"全部乐团",subjects:[{text:"全部声部",value:""}],subjectName:"全部声部"}),c=i(),h=i(),p=i(),v=i(),S=()=>{R().then(e=>{let s=Array.isArray(e==null?void 0:e.data)?e.data:[];s.length&&(s=[{name:"全部乐团",id:""}].concat(s),t.musicGroups=s.map(o=>({text:o.name,value:o.id})))})},j=()=>{O().then(e=>{let s=Array.isArray(e==null?void 0:e.data)?e.data:[];s.length&&(s=[{name:"全部声部",id:""}].concat(s),t.subjects=s.map(o=>({text:o.name,value:o.id})))})},f=async()=>{t.loading=!0,P({...l,vipFlag:l.vipFlag==="1"?!0:l.vipFlag==="2"?!1:""}).then(e=>{var o;t.refresh&&(t.list=[]);const s=Array.isArray((o=e==null?void 0:e.data)==null?void 0:o.rows)?e.data.rows:[];t.list=t.list.concat(s),(!s.length||s.length<l.rows)&&(t.finshed=!0),l.page++}).catch(()=>{t.finshed=!0}).finally(()=>{setTimeout(()=>{t.loading=!1,t.refresh=!1,t.skelet=!1},500)})},m=()=>{l.page=1,t.refresh=!0,f()};return A(()=>{S(),j()}),()=>a("div",{class:g.container},[a(D,{position:"top"},{default:()=>[a(w,null,null),a(N,{placeholder:"请输入学员姓名",onSearch:e=>{l.keyword=e,m()}},null),a(B,null,{default:()=>[a(M,{ref:c,title:t.musicGroupName},{default:()=>[a(G,{ref:h,showToolbar:!1,visibleOptionNum:5,columns:t.musicGroups},null),a("div",{class:["btnGroupPopup","van-hairline--top"]},[a(r,{round:!0,onClick:()=>{var e;(e=c.value)==null||e.toggle(!1)}},{default:()=>[d("取消")]}),a(r,{disabled:!t.musicGroups.length,type:"primary",round:!0,onClick:()=>{var s,o,n,u;(s=c.value)==null||s.toggle(!1);const e=(u=(n=(o=h.value)==null?void 0:o.getSelectedOptions)==null?void 0:n.call(o))==null?void 0:u[0];e&&(l.musicGroupId=e.value,t.musicGroupName=e.text,m())}},{default:()=>[d("确定")]})])]}),a(M,{ref:p,title:t.subjectName},{default:()=>[a(G,{ref:v,showToolbar:!1,visibleOptionNum:5,columns:t.subjects},null),a("div",{class:["btnGroupPopup","van-hairline--top"]},[a(r,{round:!0,onClick:()=>{var e;(e=p.value)==null||e.toggle(!1)}},{default:()=>[d("取消")]}),a(r,{disabled:!t.subjects.length,type:"primary",round:!0,onClick:()=>{var s,o,n,u;(s=p.value)==null||s.toggle(!1);const e=(u=(n=(o=v.value)==null?void 0:o.getSelectedOptions)==null?void 0:n.call(o))==null?void 0:u[0];console.log(e),l.subjectId=e.value,t.subjectName=e.text,m()}},{default:()=>[d("确定")]})])]})]})]}),a(T,{modelValue:t.refresh,"onUpdate:modelValue":e=>t.refresh=e,onRefresh:()=>{l.page=1,t.finshed=!1,f()}},{default:()=>[a(V,{class:g.list,loading:t.loading,finished:t.finshed,onLoad:()=>{t.loading=!0,console.log("触底了"),f()}},{default:()=>[a(L,{loading:t.skelet},{default:()=>[a(y,null,[t.list.map(e=>a("div",{class:g.student},[a(C,{item:e},null),!!e.shouldAttendanceCount&&a(y,null,[a(F,{item:e},null),a(I,{item:e},null)])])),!t.loading&&!t.list.length&&a(x,{description:"暂无数据",style:{minHeight:"100%"}},null)])]})]})]})])}});export{se as default};
