import{d as R,r as g,a as w,o as H,g as r,J as j,c as h,k as i,e as s,w as t,b as o,K as q,F as E,y as J,l as m,z as u,t as K,x as c,ac as y,_ as M}from"./index-CUnFTKV2.js";import{U as d,h as A,i as G}from"./rank-XE5cpzWb.js";const O={class:"page-container"},Q={class:"type-tabs"},W={class:"rank-cell"},X={key:3,class:"rank-number"},Y={class:"user-info"},Z={class:"user-detail"},$={class:"nickname"},ee={class:"uid"},ae={class:"value"},te=R({__name:"user",setup(ne){const p=g(d.Invite),v=g(!1),b=g([]),z=g(0),n=w({page:1,pageSize:20,type:d.Invite}),_=async()=>{v.value=!0;try{n.type=p.value;const a=await G(n);b.value=a.data.list,z.value=a.data.total}finally{v.value=!1}},U=()=>{n.page=1,_()},x=a=>{n.page=a,_()},S=a=>{n.pageSize=a,n.page=1,_()},V=()=>{switch(p.value){case d.Invite:return"邀请人数";case d.DadaCoin:return"达达券数量";case d.Diamond:return"钻石数量";case d.UUCoin:return"HH币数量";default:return"数值"}},D=a=>a>=1e4?(a/1e4).toFixed(2)+"万":a.toFixed(0);return H(()=>{_()}),(a,l)=>{const I=r("el-radio-button"),T=r("el-radio-group"),f=r("el-icon"),k=r("el-table-column"),B=r("el-avatar"),F=r("el-table"),L=r("el-pagination"),N=r("el-card"),P=j("loading");return i(),h("div",O,[s(N,null,{header:t(()=>[...l[3]||(l[3]=[o("div",{class:"card-header"},[o("span",null,"用户排行榜")],-1)])]),default:t(()=>[o("div",Q,[s(T,{modelValue:p.value,"onUpdate:modelValue":l[0]||(l[0]=e=>p.value=e),onChange:U},{default:t(()=>[(i(!0),h(E,null,J(m(A),(e,C)=>(i(),u(I,{key:C,value:C},{default:t(()=>[K(c(e),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),q((i(),u(F,{data:b.value,border:"",stripe:""},{default:t(()=>[s(k,{prop:"rank",label:"排名",width:"80",align:"center"},{default:t(({row:e})=>[o("div",W,[e.rank===1?(i(),u(f,{key:0,class:"rank-icon gold"},{default:t(()=>[s(m(y))]),_:1})):e.rank===2?(i(),u(f,{key:1,class:"rank-icon silver"},{default:t(()=>[s(m(y))]),_:1})):e.rank===3?(i(),u(f,{key:2,class:"rank-icon bronze"},{default:t(()=>[s(m(y))]),_:1})):(i(),h("span",X,c(e.rank),1))])]),_:1}),s(k,{label:"用户信息","min-width":"200"},{default:t(({row:e})=>[o("div",Y,[s(B,{src:e.headImg,size:40},null,8,["src"]),o("div",Z,[o("span",$,c(e.nickname||"-"),1),o("span",ee,"UID: "+c(e.uid),1)])])]),_:1}),s(k,{label:V(),width:"150",align:"right"},{default:t(({row:e})=>[o("span",ae,c(D(e.value))+" "+c(e.unit),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[P,v.value]]),s(L,{"current-page":n.page,"onUpdate:currentPage":l[1]||(l[1]=e=>n.page=e),"page-size":n.pageSize,"onUpdate:pageSize":l[2]||(l[2]=e=>n.pageSize=e),"page-sizes":[10,20,50,100],total:z.value,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:S,onCurrentChange:x,class:"pagination"},null,8,["current-page","page-size","total"])]),_:1})])}}}),le=M(te,[["__scopeId","data-v-e8c34a95"]]);export{le as default};
