import{d as M,r as f,a as C,o as j,g as o,J as q,c as E,k as h,e as t,w as a,K as H,f as S,t as u,l as w,O as J,s as O,z as x,x as d,b as r,H as G,_ as Q}from"./index-CUnFTKV2.js";import{d as W}from"./rank-XE5cpzWb.js";const X={class:"page-container"},Y={class:"user-info"},Z={class:"user-detail"},$={class:"nickname"},ee={class:"uid"},te={class:"mobile"},ae={class:"prize-info"},le={class:"prize-title"},ne={class:"money"},oe=M({__name:"month-log",setup(se){const _=f(!1),b=f([]),v=f(0),s=C({userId:"",mobile:""}),i=C({page:1,pageSize:20}),p=async()=>{_.value=!0;try{const n={page:i.page,pageSize:i.pageSize};s.userId&&(n.userId=Number(s.userId)),s.mobile&&(n.mobile=s.mobile);const l=await W(n);b.value=l.data.list,v.value=l.data.total}finally{_.value=!1}},m=()=>{i.page=1,p()},V=()=>{s.userId="",s.mobile="",i.page=1,p()},U=n=>{i.page=n,p()},D=n=>{i.pageSize=n,i.page=1,p()},N=n=>n===1?"danger":n===2?"warning":n===3?"success":"";return j(()=>{p()}),(n,l)=>{const z=o("el-input"),g=o("el-form-item"),y=o("el-icon"),I=o("el-button"),B=o("el-form"),K=o("el-tag"),c=o("el-table-column"),T=o("el-avatar"),L=o("el-image"),P=o("el-table"),R=o("el-pagination"),A=o("el-card"),F=q("loading");return h(),E("div",X,[t(A,null,{header:a(()=>[...l[4]||(l[4]=[r("div",{class:"card-header"},[r("span",null,"月榜中奖记录")],-1)])]),default:a(()=>[t(B,{inline:!0,model:s,class:"search-form"},{default:a(()=>[t(g,{label:"用户UID"},{default:a(()=>[t(z,{modelValue:s.userId,"onUpdate:modelValue":l[0]||(l[0]=e=>s.userId=e),placeholder:"请输入用户ID",clearable:"",onKeyup:S(m,["enter"]),style:{width:"140px"}},null,8,["modelValue"])]),_:1}),t(g,{label:"手机号"},{default:a(()=>[t(z,{modelValue:s.mobile,"onUpdate:modelValue":l[1]||(l[1]=e=>s.mobile=e),placeholder:"请输入手机号",clearable:"",onKeyup:S(m,["enter"]),style:{width:"160px"}},null,8,["modelValue"])]),_:1}),t(g,null,{default:a(()=>[t(I,{type:"primary",onClick:m},{default:a(()=>[t(y,null,{default:a(()=>[t(w(J))]),_:1}),l[5]||(l[5]=u("查询 ",-1))]),_:1}),t(I,{onClick:V},{default:a(()=>[t(y,null,{default:a(()=>[t(w(O))]),_:1}),l[6]||(l[6]=u("重置 ",-1))]),_:1})]),_:1})]),_:1},8,["model"]),H((h(),x(P,{data:b.value,border:"",stripe:""},{default:a(()=>[t(c,{prop:"rank",label:"排名",width:"80",align:"center"},{default:a(({row:e})=>[t(K,{type:N(e.rank),size:"small"},{default:a(()=>[u(" 第"+d(e.rank)+"名 ",1)]),_:2},1032,["type"])]),_:1}),t(c,{label:"用户信息","min-width":"180"},{default:a(({row:e})=>[r("div",Y,[t(T,{src:e.headImg,size:40},null,8,["src"]),r("div",Z,[r("span",$,d(e.nickname||"-"),1),r("span",ee,"UID: "+d(e.uid),1),r("span",te,d(e.mobile||"-"),1)])])]),_:1}),t(c,{label:"奖品信息","min-width":"200"},{default:a(({row:e})=>[r("div",ae,[e.prizeImgUrl?(h(),x(L,{key:0,src:e.prizeImgUrl,"preview-src-list":[e.prizeImgUrl],fit:"cover",class:"prize-image","preview-teleported":""},null,8,["src","preview-src-list"])):G("",!0),r("span",le,d(e.prizeTitle||"-"),1)])]),_:1}),t(c,{label:"消费金额",width:"120",align:"right"},{default:a(({row:e})=>{var k;return[r("span",ne,"¥"+d(((k=e.consumeAmount)==null?void 0:k.toFixed(2))||"0.00"),1)]}),_:1}),t(c,{label:"统计时间",width:"180",align:"center"},{default:a(({row:e})=>[u(d(e.timeRange||"-"),1)]),_:1}),t(c,{label:"中奖时间",width:"160",align:"center"},{default:a(({row:e})=>[u(d(e.createdAt||"-"),1)]),_:1})]),_:1},8,["data"])),[[F,_.value]]),t(R,{"current-page":i.page,"onUpdate:currentPage":l[2]||(l[2]=e=>i.page=e),"page-size":i.pageSize,"onUpdate:pageSize":l[3]||(l[3]=e=>i.pageSize=e),"page-sizes":[10,20,50,100],total:v.value,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:D,onCurrentChange:U,class:"pagination"},null,8,["current-page","page-size","total"])]),_:1})])}}}),de=Q(oe,[["__scopeId","data-v-6fc6bd65"]]);export{de as default};
