1 |
- import{d as N,P as C,q as k,r as i,x as b,y as D,D as h,a as e,b$ as L,A as x,a2 as V,R as f,a3 as F}from"./index-869d77fb.js";import{s as t,a as y,p as O}from"./san-6ea3ad8d.js";import{M as q}from"./index-3eb77ad0.js";import{M as B}from"./index-7af89263.js";import{M}from"./index-d315d9dc.js";import{L as R}from"./index-f12c44b8.js";import{D as A}from"./index-da1851f9.js";import{P as g}from"./index-6f985828.js";import"./index-155c29c2.js";import"./index-0153d173.js";import"./index-1c6c2ec0.js";import"./use-tab-status-0ed30c24.js";function P(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!F(l)}const K=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),x("报名人数")]),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(R,{"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(V,{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{K as default};
|