
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.github.io
 */

import{_ as $}from"./index.vue_vue_type_script_setup_true_lang-DpYLhOHb.js";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang-BTce45WY.js";import{d as H,r as _,m as I,a as G,p as r,q as O,g as u,c as v,b as t,w as a,F as R,s as M,i as m,h as d,y as K,z as h,t as g,e as J,K as P,k as V}from"./index-nGFMSQGw.js";import{R as Q,l as W,U as X,j as Z}from"./index-BE-LteFu.js";import{u as ee}from"./utcformatTime-Bq4gDWNx.js";const te=J("div",{class:"flex items-center gap-4"},"账户明细",-1),ae=H({__name:"accountLog",setup(le){const C=_(),T=_(0),f=_(!1),n=I({userId:"",rechargeType:"",packageId:"",page:1,size:15});I({model3Count:[{required:!0,message:"请填写赠送基础模型额度",trigger:"blur"}],model4Count:[{required:!0,message:"请填写赠送高级模型额度",trigger:"blur"}],drawMjCount:[{required:!0,message:"请填写赠送绘画积分额度",trigger:"blur"}]});const A=_(),k=_([]);async function i(){try{f.value=!0;const s=await P.queryUserAccountLog(n),{rows:l,count:b}=s.data;f.value=!1,T.value=b,k.value=l}catch{f.value=!1}}async function D(s){const l=await P.queryAllUser({size:30,keyword:s});A.value=l.data.rows}function q(s){s==null||s.resetFields(),i()}return G(()=>i()),(s,l)=>{const b=F,U=r("el-option"),x=r("el-select"),w=r("el-form-item"),z=r("el-button"),Y=r("el-form"),S=$,E=r("el-avatar"),o=r("el-table-column"),y=r("el-tag"),j=r("el-table"),L=r("el-pagination"),B=r("el-row"),N=O("loading");return u(),v("div",null,[t(b,null,{title:a(()=>[te]),_:1}),t(S,null,{default:a(()=>[t(Y,{ref_key:"formRef",ref:C,inline:!0,model:n},{default:a(()=>[t(w,{label:"用户名称",prop:"userId"},{default:a(()=>[t(x,{modelValue:n.userId,"onUpdate:modelValue":l[0]||(l[0]=e=>n.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"昵称|手机号|邮箱[模糊搜索]","remote-show-suffix":"","remote-method":D,style:{width:"200px"}},{default:a(()=>[(u(!0),v(R,null,M(A.value,e=>(u(),h(U,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(w,{label:"充值类型",prop:"rechargeType"},{default:a(()=>[t(x,{modelValue:n.rechargeType,"onUpdate:modelValue":l[1]||(l[1]=e=>n.rechargeType=e),placeholder:"请选择充值类型",clearable:"",style:{width:"160px"}},{default:a(()=>[(u(!0),v(R,null,M(m(Q),e=>(u(),h(U,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(w,null,{default:a(()=>[t(z,{type:"primary",onClick:i},{default:a(()=>[d(" 查询 ")]),_:1}),t(z,{onClick:l[2]||(l[2]=e=>q(C.value))},{default:a(()=>[d(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(S,{style:{width:"100%"}},{default:a(()=>[K((u(),h(j,{border:"",data:k.value,style:{width:"100%"},size:"large"},{default:a(()=>[t(o,{prop:"avatar",label:"用户头像",width:"120",fixed:""},{default:a(e=>[t(E,{src:e.row.avatar},null,8,["src"])]),_:1}),t(o,{prop:"username",label:"用户名称",width:"150",fixed:""}),t(o,{prop:"userId",label:"用户ID",width:"80"}),t(o,{prop:"uid",label:"订单ID",width:"130"}),t(o,{prop:"email",label:"用户邮箱",width:"250",align:"left"}),t(o,{prop:"balanceInfo.useModel4Count",label:"充值类型",width:"160",align:"center"},{default:a(e=>[t(y,{type:"success"},{default:a(()=>{var c,p;return[d(g((c=e.row)!=null&&c.rechargeType?m(W)[(p=e.row)==null?void 0:p.rechargeType]:"---"),1)]}),_:2},1024)]),_:1}),t(o,{prop:"model3Count",label:"基础模型额度",width:"120",align:"center"}),t(o,{prop:"model4Count",label:"高级模型额度",width:"120",align:"center"}),t(o,{prop:"drawMjCount",label:"绘画余额额度",width:"120",align:"center"}),t(o,{label:"额度有效期",width:"170",align:"center"},{default:a(e=>[t(y,{type:"success"},{default:a(()=>{var c,p;return[d(g(((c=e.row)==null?void 0:c.days)<=0?"永久时效":`${(p=e.row)==null?void 0:p.days}天`),1)]}),_:2},1024)]),_:1}),t(o,{prop:"status",label:"用户状态",width:"120",align:"center"},{default:a(({row:e})=>[t(y,{type:m(X)[e.status]},{default:a(()=>[d(g(m(Z)[e.status]),1)]),_:2},1032,["type"])]),_:1}),t(o,{prop:"createdAt",label:"充值时间",width:"200",align:"center"},{default:a(e=>[d(g(m(ee)(e.row.createdAt,"YYYY-MM-DD hh:mm:ss")),1)]),_:1})]),_:1},8,["data"])),[[N,f.value]]),t(B,{class:"mt-5 flex justify-end"},{default:a(()=>[t(L,{"current-page":n.page,"onUpdate:currentPage":l[3]||(l[3]=e=>n.page=e),"page-size":n.size,"onUpdate:pageSize":l[4]||(l[4]=e=>n.size=e),class:"mr-5","page-sizes":[15,30,50,100],layout:"total, sizes, prev, pager, next, jumper",total:T.value,onSizeChange:i,onCurrentChange:i},null,8,["current-page","page-size","total"])]),_:1})]),_:1})])}}});typeof V=="function"&&V(ae);export{ae as default};
