import{d as N,U as C,q as k,r as i,x as b,y as D,D as h,a as e,bP as L,A as V,a0 as x,V as f,a1 as F}from"./index-f1aa8576.js";import{s as t,a as y,p as O}from"./san-cb394dc1.js";import{M as q}from"./index-c95dcdb9.js";import{M as B}from"./index-b5127a67.js";import{M}from"./index-fee32a87.js";import{L as U}from"./index-36302bd0.js";import{D as A}from"./index-75b0a2e6.js";import{P as g}from"./index-2eae8c9e.js";import"./index-b94ac003.js";import"./index-8c4ec4c7.js";import"./index-2e59479e.js";import"./use-tab-status-b1cf94ec.js";function P(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!F(l)}const Q=N({name:"tenant-apply-data",setup(){const l=C(),S=k();i("all");const a=b({keyword:"",id:l.query.id,yearStatus:!1,schoolChiose:[l.query.schoolId],schoolId:l.query.schoolId,schoolName:l.query.schoolName,year:[new Date().getFullYear()],yearName:new Date().getFullYear(),classList:[],classStatus:!1,statObj:{registerNum:0,schoolNum:0},perponStatus:!1,sortId:"desc",sortName:"时间降序",sortList:[{value:"desc",text:"时间降序"},{value:"asc",text:"时间升序"}],page:1,rows:20,isClick:!1}),u=i(!1),d=i(!0),p=i(!1),m=i(!1),n=i([]),w=async()=>{try{const{data:o}=await h.get("/edu-app/open/school/list",{params:{tenantId:a.id}}),s=[{value:"",text:"全部学校"}];Array.isArray(o)&&(o.forEach(r=>{s.push({value:r.id,text:r.name})}),a.classList=s)}catch(o){}},c=async()=>{if(!a.isClick){a.isClick=!0,u.value&&(n.value=[],a.page=1,u.value=!1);try{const o=await h.post("/edu-app/open/school/schoolRegisterUserPage",{data:{tenantId:a.id,page:a.page,rows:a.rows,year:a.yearName,keyword:a.keyword,sort:a.sortId,schoolId:a.schoolId}});if(n.value.length>0&&o.data.current===1)return;n.value=n.value.concat(o.data.rows||[]),a.page=o.data.current+1,m.value=n.value.length>0,d.value=!1,p.value=o.data.current>=o.data.pages}catch(o){m.value=!1,p.value=!0}finally{d.value=!1}a.isClick=!1}},I=()=>{p.value=!1,d.value=!0,c()};D(async()=>{document.title="学生报名统计",await v(),await c(),await w()});const v=async()=>{try{const{data:o}=await h.post("/edu-app/open/school/schoolRegisterStat",{data:{tenantId:a.id,year:a.yearName,schoolId:a.schoolId}});a.statObj=o}catch(o){}};return()=>{let o;return e("div",{class:t.tenantAllData},[e(q,{position:"top"},{default:()=>[e("div",{class:t.top},[e("div",{class:t.topWrap},[e("div",{class:t.topHead,onClick:()=>a.classStatus=!0},[a.schoolName,e("img",{src:y,class:[t.sanIcon,a.classStatus?t.routeSan:""],alt:""},null)])]),e("div",{class:t.cardWrap},[e("div",{class:[t.studentCard,t.cardItem,t.detailCard]},[e("div",{class:t.cardNum},[" ",L(a.statObj.registerNum).format("0,0")]),e("div",{class:t.cardInfo},[e("img",{src:O,class:t.cardInfoImg,alt:""},null),V("报名人数")]),e("div",{class:t.cardLine},null)])]),e("div",{class:t.searchWrap},[e("div",{class:t.searechInfo},[e(M,{class:t.allDataWrap,shape:"round",background:"#F6F8F9",inputBackground:"white",placeholder:"请输入学员名称",onSearch:s=>{a.keyword=s,a.page=1,u.value=!0,c()}},null)]),e("div",{class:t.timerWrap,onClick:()=>a.perponStatus=!0},[a.sortName," ",e("img",{src:y,class:[t.sanIcon,a.perponStatus?t.routeSan:""],alt:""},null)])])])]}),e("div",{class:t.schoolList},[m.value?e(B,{modelValue:u.value,"onUpdate:modelValue":s=>u.value=s,onRefresh:I,class:t.refreshD},{default:()=>[e(U,{"loading-text":" ",finished:p.value,"finished-text":" ",onLoad:c},P(o=n.value.map(s=>e("div",{class:t.studentItem},[e("div",{class:t.studentNameWrap},[e("p",{class:t.title},[s.userName]),e("p",{class:t.studentPhone},[s.phone])]),e("div",{class:t.studentCountWrap},[e("div",null,[e("p",{class:t.title},[s.createTime])])])])))?o:{default:()=>[o]})]}):null,!m.value&&!d.value&&e(x,{description:"暂无学生报名",class:t.emptyD},null)]),e(f,{show:a.yearStatus,"onUpdate:show":s=>a.yearStatus=s,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(A,{showToolbar:!0,modelValue:a.year,"onUpdate:modelValue":s=>a.year=s,"columns-type":["year"],onCancel:()=>a.yearStatus=!1,onConfirm:s=>{console.log(s),a.year=[s.selectedValues[0]],a.yearName=s.selectedValues[0],a.page=1,u.value=!0,c(),a.yearStatus=!1}},null)]}),e(f,{show:a.perponStatus,"onUpdate:show":s=>a.perponStatus=s,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(g,{showToolbar:!0,columns:a.sortList,onCancel:()=>a.perponStatus=!1,onConfirm:s=>{console.log(s);const r=s.selectedOptions[0];a.sortId=r.value,a.sortName=r.text,u.value=!0,c(),a.perponStatus=!1}},null)]}),e(f,{show:a.classStatus,"onUpdate:show":s=>a.classStatus=s,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(g,{showToolbar:!0,modelValue:a.schoolChiose,"onUpdate:modelValue":s=>a.schoolChiose=s,columns:a.classList,onCancel:()=>a.classStatus=!1,onConfirm:s=>{const r=s.selectedOptions[0];a.schoolChiose=[r.value],a.schoolId=r.value,a.schoolName=r.text,S.push({query:{...l.query,schoolId:a.schoolId,schoolName:a.schoolName}}),a.classStatus=!1,u.value=!0,v(),c()}},null)]})])}}});export{Q as default};
