import{d as j,O as b,i,o as k,g as a,R as w,B as r,h as d,F as A,S as x}from"./index-8911ca98.js";import{M as N}from"./index-ddc128fa.js";import{M as D}from"./index-4e5e1d77.js";import{s as g,M as F,A as I,a as R,b as C,c as O,e as P}from"./api-7b5eaa81.js";import{S as L}from"./skeletion-index-d597f7a8.js";import{M as T}from"./index-ea97d764.js";import{D as B,a as y}from"./index-606c5b98.js";import{P as M}from"./index-2f907b0c.js";import{L as V}from"./index-7307e9a6.js";import"./index-5b3efa5e.js";import"./index-8a6d93dd.js";import"./icon-student-default-4c78efb2.js";import"./index-4522bae7.js";import"./index-be98d0cb.js";import"./index-d1bd0ef8.js";import"./index-22aba85d.js";import"./use-tab-status-5da328dc.js";const se=j({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(),G=()=>{C().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})))})},S=()=>{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})))})},m=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)})},f=()=>{l.page=1,t.refresh=!0,m()};return k(()=>{G(),S()}),()=>a("div",{class:g.container},[a(D,{position:"top"},{default:()=>[a(w,null,null),a(N,{placeholder:"请输入学员姓名",onSearch:e=>{l.keyword=e,f()}},null),a(B,null,{default:()=>[a(y,{ref:c,title:t.musicGroupName},{default:()=>[a(M,{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,f())}},{default:()=>[d("确定")]})])]}),a(y,{ref:p,title:t.subjectName},{default:()=>[a(M,{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,f()}},{default:()=>[d("确定")]})])]})]})]}),a(T,{modelValue:t.refresh,"onUpdate:modelValue":e=>t.refresh=e,onRefresh:()=>{l.page=1,t.finshed=!1,m()}},{default:()=>[a(V,{class:g.list,loading:t.loading,finished:t.finshed,onLoad:()=>{t.loading=!0,console.log("触底了"),m()}},{default:()=>[a(L,{loading:t.skelet},{default:()=>[a(A,null,[t.list.map(e=>a("div",{class:g.student},[a(F,{item:e},null),a(I,{item:e},null),a(R,{item:e},null)])),!t.loading&&!t.list.length&&a(x,{description:"暂无数据",style:{minHeight:"100%"}},null)])]})]})]})])}});export{se as default};
