index-72e7d422.js 3.8 KB

1
  1. import{d as w,O as M,i as d,o as A,g as a,R as x,B as c,h as p,F as N,T as D}from"./index-e362c2e8.js";import{M as F}from"./index-2a51a0f7.js";import{M as I}from"./index-cf657a5b.js";import{s as y,M as R,A as C,a as O,b as P,c as T,e as L}from"./api-8951fe73.js";import{S as B}from"./skeletion-index-e3ca124e.js";import{M as V}from"./index-04aee2cb.js";import{D as E,a as G}from"./index-8b701a0f.js";import{P as j}from"./index-14b5dea2.js";import{L as U}from"./index-7861a26d.js";import"./index-6c6fed8e.js";import"./index-5c45ec33.js";import"./icon-student-default-4c78efb2.js";import"./index-85ccd873.js";import"./index-5276fe86.js";import"./index-f2403653.js";import"./index-f57b4c5f.js";import"./use-tab-status-92e284d0.js";const le=w({name:"student-manage",setup(){const l=M({page:1,rows:20,keyword:"",musicGroupId:"",statusList:["QUIT"],subjectId:"",vipFlag:""}),t=M({skelet:!0,refresh:!1,loading:!1,finshed:!1,list:[],musicGroups:[{text:"全部乐团",value:""}],musicGroupName:"全部乐团",subjects:[{text:"全部声部",value:""}],subjectName:"全部声部"}),m=d(),f=d(),g=d(),h=d(),S=()=>{P().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})))})},k=()=>{T().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})))})},v=async()=>{t.loading=!0,L({...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)})},b=()=>{l.page=1,t.refresh=!0,v()};return A(()=>{S(),k()}),()=>a("div",{class:y.container},[a(I,{position:"top"},{default:()=>[a(x,null,null),a(F,{placeholder:"请输入学员姓名",onSearch:e=>{l.keyword=e,b()}},null),a(E,null,{default:()=>[a(G,{ref:m,title:t.musicGroupName},{default:()=>[a(j,{ref:f,showToolbar:!1,visibleOptionNum:5,columns:t.musicGroups},null),a("div",{class:["btnGroupPopup","van-hairline--top"]},[a(c,{round:!0,onClick:()=>{var e;(e=m.value)==null||e.toggle(!1)}},{default:()=>[p("取消")]}),a(c,{disabled:!t.musicGroups.length,type:"primary",round:!0,onClick:()=>{var s,o,n,u,i,r;(o=(s=f.value)==null?void 0:s.confirm)==null||o.call(s);const e=(i=(u=(n=f.value)==null?void 0:n.getSelectedOptions)==null?void 0:u.call(n))==null?void 0:i[0];e&&(l.musicGroupId=e.value,t.musicGroupName=e.text,b()),(r=m.value)==null||r.toggle(!1)}},{default:()=>[p("确定")]})])]}),a(G,{ref:g,title:t.subjectName},{default:()=>[a(j,{ref:h,showToolbar:!1,visibleOptionNum:5,columns:t.subjects},null),a("div",{class:["btnGroupPopup","van-hairline--top"]},[a(c,{round:!0,onClick:()=>{var e;(e=g.value)==null||e.toggle(!1)}},{default:()=>[p("取消")]}),a(c,{disabled:!t.subjects.length,type:"primary",round:!0,onClick:()=>{var s,o,n,u,i,r;(o=(s=h.value)==null?void 0:s.confirm)==null||o.call(s);const e=(i=(u=(n=h.value)==null?void 0:n.getSelectedOptions)==null?void 0:u.call(n))==null?void 0:i[0];console.log(e),l.subjectId=e.value,t.subjectName=e.text,b(),(r=g.value)==null||r.toggle(!1)}},{default:()=>[p("确定")]})])]})]})]}),a(V,{modelValue:t.refresh,"onUpdate:modelValue":e=>t.refresh=e,onRefresh:()=>{l.page=1,t.finshed=!1,v()}},{default:()=>[a(U,{class:y.list,loading:t.loading,finished:t.finshed,onLoad:()=>{t.loading=!0,console.log("触底了"),v()}},{default:()=>[a(B,{loading:t.skelet},{default:()=>[a(N,null,[t.list.map(e=>a("div",{class:y.student},[a(R,{item:e},null),a(C,{item:e},null),a(O,{item:e},null)])),!t.loading&&!t.list.length&&a(D,{description:"暂无数据",style:{minHeight:"100%"}},null)])]})]})]})])}});export{le as default};