import{P as Q}from"./index-97-mhYEo.js";import{r as e,dC as j,br as D,b7 as P,u as A,a as E,Q as X,aY as _,aT as i,aS as w,bf as N,bg as S,bh as B,a$ as a,b9 as Y,b0 as u,c as L,ba as y,bQ as q,bc as U,p as H,aX as V,N as J}from"./index-xnhGKCfe.js";import{L as K}from"./index-BCXnwPbG.js";import{p as M}from"./pre-D84pmYLY.js";import{_ as W}from"./index.vue_vue_type_style_index_0_lang-9szultRB.js";import"./currency-DTUBf2lI.js";import"./useProtocol-DJp7lFWi.js";import"./use-tab-status-C1dTAhJi.js";function Z(){const g=e([]),s=e([]),d=e(!1),m=e(0),v=e(1),r=e(10),h=e(0),l=e(void 0),c=e([]),T=async n=>{v.value=n,await C(n)},b=async n=>{Array.isArray(n)?c.value=n:l.value=n,await T(v.value)},x=e(),C=async n=>{try{d.value=!0;const{code:f,data:p}=await j({pageNo:v.value||n,pageSize:r.value,startUnixTime:c.value[0]?c.value[0]:0,endUnixTime:c.value[1]?D(c.value[1]).endOf("day").valueOf():0,type:l.value,amountType:x.value});if(f!==0)return;g.value=p.list,m.value=p.totalPage,h.value=p.totalCount,s.value=[...s.value,...p.list||[]]}catch{}finally{d.value=!1}};return{transactionRecord:g,transactionRecordLoading:d,transactionRecordTotal:m,transactionRecordPage:v,transactionRecordPageSize:r,categoryType:l,transactionRecordTotalCount:h,times:c,onChange:b,getTransactionRecordPage:C,onPageChange:T,amountType:x,allTransactionRecord:s}}const ee={class:"records-wrapper"},ae={class:"table-tr-body"},te={class:"f"},se={class:"n"},ne={class:"s"},oe=["src"],le={class:"t"},ce={key:0,class:"table-tr-remark"},re=P({__name:"list",props:{active:{type:String,default:""}},setup(g){const s=o=>/[\u4e00-\u9fa5]/.test(o),{t:d}=A(),{amountType:m,getTransactionRecordPage:v,transactionRecordPage:r,transactionRecordTotalCount:h,transactionRecordTotal:l,allTransactionRecord:c}=Z(),{allGameAccountChangeType:T}=E(),b=g,x=L(()=>T.value.map(o=>({label:o.label,value:o.value,text:d(o.text)}))),C=L(()=>x.value.reduce((o,k)=>(o[k.value.toLowerCase()]=k,o),{})),n=e(),f=e(!1),p=e(!0),R=e(!0),z={all:void 0,income:0,expense:1},G=async()=>{try{m.value=z[b.active],await v(r.value)}catch{}finally{f.value=!1,r.value>=l.value?p.value=!0:++r.value,R.value=h.value!==0}};function I(){l.value=0,h.value=0,r.value=1,f.value=!1,p.value=!1,R.value=!0,c.value=[]}function F(){H(()=>{n.value&&n.value.check()})}return X(()=>b.active,()=>{I(),F()},{immediate:!0}),(o,k)=>{const O=K;return i(),_("div",ee,[R.value?(i(),w(O,{key:0,ref_key:"listRef",ref:n,class:"list-container",loading:f.value,"onUpdate:loading":k[0]||(k[0]=t=>f.value=t),finished:p.value,"loading-text":"loading","finished-text":o.$t("t550"),onLoad:G},{default:N(()=>[(i(!0),_(S,null,B(y(c),t=>{var $;return i(),_("div",{class:"table-tr",key:t.id},[a("div",ae,[a("div",te,[a("p",se,u((($=C.value[t.type.toLowerCase()])==null?void 0:$.text)||"-"),1),a("p",null,u(y(q)(t.createTime)),1)]),a("div",ne,[a("img",{src:y(M)},null,8,oe),a("p",{class:U({positive:t.amount>0})},u(t.amount>0?"+":"")+u(t.amount),3)]),a("div",le,u(t.backAmount),1)]),t.type.toLowerCase()==="bonusrecharge"&&t.remark&&!s(t.remark)?(i(),_("div",ce,u(t.remark),1)):Y("",!0)])}),128))]),_:1},8,["loading","finished","finished-text"])):(i(),w(W,{key:1,text:o.$t("t781")},null,8,["text"]))])}}}),ie=V(re,[["__scopeId","data-v-d4554d20"]]),ue={class:"records"},de={class:"header"},ve=["onClick"],pe={class:"table-th"},fe=P({__name:"index",setup(g){const{t:s}=A(),d=e("all"),m=L(()=>[{title:s("t124"),value:"all"},{title:s("t1160"),value:"income"},{title:s("t1161"),value:"expense"}]),v=r=>{d.value=r};return(r,h)=>(i(),w(Q,{"is-overfllow":!1},{default:N(()=>[a("div",ue,[a("div",de,[(i(!0),_(S,null,B(m.value,(l,c)=>(i(),_("div",{class:U({active:d.value===l.value}),key:l.value,onClick:T=>v(l.value)},[(i(),_("div",{key:c},u(l.title),1))],10,ve))),128))]),a("div",pe,[a("div",null,u(y(s)("t60")),1),a("div",null,u(y(s)("t1162")),1),a("div",null,u(y(s)("t62")),1)]),J(ie,{active:d.value},null,8,["active"])])]),_:1}))}}),xe=V(fe,[["__scopeId","data-v-af61a970"]]);export{xe as default};
