PageSourceSearch

https://doinhanhweb.manus.space/assets/WalletHistory-B45ecEOf.js

js doinhanhweb.manus.space collected 2026-10-03 05:02:43 UTC 11,853 bytes, 1 lines download raw bytes

1import{u as k,a as C,r as n,t as A,j as t,L as u,W as m,i as N,f as W,m as T}from"./index-DRYNtDfq.js";import{U as H,P as j,a as L}from"./PageLayout-BT1vZgiA.js";import{R as B}from"./refresh-cw-D2dmFQzs.js";import{C as D}from"./calendar-B5BYcSdL.js";import{C as M}from"./chevron-left-mvqxhe1t.js";import{C as P}from"./chevron-right-C0SJQso0.js";import{C as E}from"./circle-alert-CtK3RIb0.js";const p={deposit:"Nạp số dư",withdraw:"Yêu cầu rút tiền",withdrawal:"Yêu cầu rút tiền",withdrawal_hold:"Tạm giữ rút tiền",withdrawal_release:"Hoàn tiền rút",card_credit:"Đổi thẻ thành công",card_freeze:"Đóng băng đổi thẻ",card_unfreeze:"Mở khóa đổi thẻ",buycard_debit:"Mua thẻ",buy_card_debit:"Mua thẻ",buycard_refund:"Hoàn tiền mua thẻ",buycard_admin_refund:"Hoàn tiền mua thẻ (admin)",topup_debit:"Nạp cước",topup_refund:"Hoàn tiền nạp cước",topup_admin_refund:"Hoàn tiền nạp cước (admin)",manual_reconcile:"Đối soát thủ công",admin_adjust:"Admin điều chỉnh",refund:"Hoàn tiền",credit:"Nhận tiền",debit:"Trừ tiền"},w={deposit:{bg:"#d1fae5",text:"#065f46"},card_credit:{bg:"#d1fae5",text:"#065f46"},refund:{bg:"#d1fae5",text:"#065f46"},credit:{bg:"#d1fae5",text:"#065f46"},buycard_refund:{bg:"#d1fae5",text:"#065f46"},buycard_admin_refund:{bg:"#d1fae5",text:"#065f46"},topup_refund:{bg:"#d1fae5",text:"#065f46"},topup_admin_refund:{bg:"#d1fae5",text:"#065f46"},withdrawal_release:{bg:"#d1fae5",text:"#065f46"},manual_reconcile:{bg:"#d1fae5",text:"#065f46"},withdraw:{bg:"#fee2e2",text:"#991b1b"},withdrawal:{bg:"#fee2e2",text:"#991b1b"},withdrawal_hold:{bg:"#fee2e2",text:"#991b1b"},topup_debit:{bg:"#fee2e2",text:"#991b1b"},buycard_debit:{bg:"#fee2e2",text:"#991b1b"},buy_card_debit:{bg:"#fee2e2",text:"#991b1b"},debit:{bg:"#fee2e2",text:"#991b1b"},card_freeze:{bg:"#fef3c7",text:"#92400e"},card_unfreeze:{bg:"#dbeafe",text:"#1e40af"},admin_adjust:{bg:"#f3e8ff",text:"#6b21a8"}};function q(){k({title:"Biến động số dư",description:"Xem lịch sử biến động số dư ví, nạp tiền, rút tiền và các giao dịch liên quan.",breadcrumbs:[{name:"Trang chủ",url:"/"},{name:"Lịch sử",url:"/lich-su"},{name:"Biến động số dư"}]});const{isAuthenticated:g}=C(),[s,a]=n.useState(0),[c,_]=n.useState(void 0),[r,y]=n.useState(""),[o,x]=n.useState(""),d=20,{data:i,refetch:S,isLoading:v}=A.wallet.getTransactions.useQuery({limit:d,offset:s*d,...c&&{type:c},...r&&{fromDate:new Date(r+"T00:00:00").getTime()},...o&&{toDate:new Date(o+"T23:59:59").getTime()}},{enabled:g}),h=Array.isArray(i)?i:i?.items||i||[],z=i?.total??h.length,l=Math.max(1,Math.ceil(z/d));return g?t.jsx(u,{"data-loc":"client/src/pages/history/WalletHistory.tsx:120",children:t.jsxs(H,{"data-loc":"client/src/pages/history/WalletHistory.tsx:121",children:[t.jsx(j,{"data-loc":"client/src/pages/history/WalletHistory.tsx:122",items:[{label:"Lịch sử",href:"/lich-su"},{label:"Biến động số dư"}]}),t.jsx(L,{"data-loc":"client/src/pages/history/WalletHistory.tsx:123",title:"Biến động số dư",subtitle:"Xem toàn bộ lịch sử biến động số dư ví của bạn.",icon:t.jsx(m,{"data-loc":"client/src/pages/history/WalletHistory.tsx:126",style:{width:20,height:20}})}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:130",className:"page-section",children:[t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:131",style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",marginBottom:12},children:[[{key:void 0,label:"Tất cả"},{key:"deposit",label:"Nạp số dư"},{key:"card_credit",label:"Đổi thẻ"},{key:"buy_card_debit",label:"Mua thẻ"},{key:"topup_debit",label:"Nạp cước"},{key:"withdraw",label:"Nhận tiền"},{key:"admin_adjust",label:"Điều chỉnh"}].map(e=>t.jsx("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:141",className:`amount-btn${c===e.key?" is-active":""}`,style:{height:36,fontSize:13,padding:"0 16px"},onClick:()=>{_(e.key),a(0)},children:e.label},e.key??"all")),t.jsxs("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:150",onClick:()=>S(),style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#7c3aed",background:"none",border:"none",cursor:"pointer"},children:[t.jsx(B,{"data-loc":"client/src/pages/history/WalletHistory.tsx:154",style:{width:14,height:14}})," Làm mới"]})]}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:158",style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[t.jsx(D,{"data-loc":"client/src/pages/history/WalletHistory.tsx:159",style:{width:16,height:16,color:"#6b7280"}}),t.jsx("input",{"data-loc":"client/src/pages/history/WalletHistory.tsx:160",type:"date",value:r,onChange:e=>{y(e.target.value),a(0)},className:"date-filter-input",placeholder:"Từ ngày"}),t.jsx("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:167",style:{color:"#9ca3af",fontSize:13},children:"—"}),t.jsx("input",{"data-loc":"client/src/pages/history/WalletHistory.tsx:168",type:"date",value:o,onChange:e=>{x(e.target.value),a(0)},className:"date-filter-input",placeholder:"Đến ngày"}),(r||o)&&t.jsx("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:176",onClick:()=>{y(""),x(""),a(0)},style:{fontSize:12,color:"#ef4444",background:"none",border:"none",cursor:"pointer",fontWeight:600},children:"Xóa lọc"})]})]}),v?t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:188",className:"ui-card page-section",style:{padding:40,textAlign:"center"},children:[t.jsx("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:189",className:"spinner",style:{margin:"0 auto 12px"}}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:190",style:{fontSize:14,color:"#6b7280"},children:"Đang tải..."})]}):h.length>0?t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:194",className:"ui-card page-section",style:{padding:0,overflow:"hidden"},children:t.jsx("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:195",style:{overflowX:"auto"},children:t.jsxs("table",{"data-loc":"client/src/pages/history/WalletHistory.tsx:196",style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[t.jsx("thead",{"data-loc":"client/src/pages/history/WalletHistory.tsx:197",children:t.jsxs("tr",{"data-loc":"client/src/pages/history/WalletHistory.tsx:198",style:{background:"#fafafa"},children:[t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:199",style:{padding:"12px 14px",textAlign:"left",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Loại"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:200",style:{padding:"12px 14px",textAlign:"left",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Mô tả"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:201",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Số tiền"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:202",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Số dư sau"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:203",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Thời gian"})]})}),t.jsx("tbody",{"data-loc":"client/src/pages/history/WalletHistory.tsx:206",children:h.map(e=>{const f=e.amount>0,b=w[e.description??""]||w[e.type]||{bg:"#f3f4f6",text:"#374151"};return t.jsxs("tr",{"data-loc":"client/src/pages/history/WalletHistory.tsx:211",style:{borderBottom:"1px solid #f3f4f6"},children:[t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:212",style:{padding:"13px 14px"},children:t.jsx("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:213",style:{display:"inline-block",padding:"3px 10px",borderRadius:20,fontSize:12,fontWeight:600,background:b.bg,color:b.text,whiteSpace:"nowrap"},children:p[e.description??""]||p[e.type]||e.type})}),t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:226",style:{padding:"13px 14px",fontSize:13,color:"#6b7280",maxWidth:220},children:t.jsx("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:227",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p[e.description??""]?"—":e.description||"—"})}),t.jsxs("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:231",style:{padding:"13px 14px",textAlign:"right",fontWeight:700,color:f?"#059669":"#dc2626",fontSize:14},children:[f?"+":"",W(e.amount)]}),t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:234",style:{padding:"13px 14px",textAlign:"right",fontSize:13,color:"#374151",fontWeight:600},children:e.balanceAfter!=null?W(e.balanceAfter):"—"}),t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:237",style:{padding:"13px 14px",textAlign:"right",fontSize:13,color:"#6b7280"},children:T(e.createdAt)})]},e.id)})})]})})}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:249",className:"page-section",style:{display:"flex",justifyContent:"center",alignItems:"center",gap:12,flexWrap:"wrap"},children:[t.jsxs("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:250",onClick:()=>a(e=>Math.max(0,e-1)),disabled:s===0,className:"pagination-btn",style:{opacity:s===0?.4:1,cursor:s===0?"default":"pointer"},children:[t.jsx(M,{"data-loc":"client/src/pages/history/WalletHistory.tsx:256",style:{width:16,height:16}})," Trước"]}),t.jsxs("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:258",style:{fontSize:13,color:"#374151",fontWeight:600},children:["Trang ",s+1," / ",l]}),t.jsxs("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:261",onClick:()=>a(e=>Math.min(l-1,e+1)),disabled:s>=l-1,className:"pagination-btn",style:{opacity:s>=l-1?.4:1,cursor:s>=l-1?"default":"pointer"},children:["Sau ",t.jsx(P,{"data-loc":"client/src/pages/history/WalletHistory.tsx:267",style:{width:16,height:16}})]})]})]}):t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:272",className:"ui-card page-section",style:{padding:40,textAlign:"center"},children:[t.jsx(E,{"data-loc":"client/src/pages/history/WalletHistory.tsx:273",style:{width:40,height:40,color:"#d1d5db",margin:"0 auto 12px"}}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:274",style:{fontSize:15,fontWeight:600,color:"#374151",marginBottom:4},children:"Chưa có biến động số dư"}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:275",style:{fontSize:13,color:"#9ca3af"},children:"Lịch sử biến động số dư sẽ hiển thị tại đây"})]})]})}):t.jsx(u,{"data-loc":"client/src/pages/history/WalletHistory.tsx:104",children:t.jsxs(H,{"data-loc":"client/src/pages/history/WalletHistory.tsx:105",children:[t.jsx(j,{"data-loc":"client/src/pages/history/WalletHistory.tsx:106",items:[{label:"Lịch sử",href:"/lich-su"},{label:"Biến động số dư"}]}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:107",className:"ui-card page-section",style:{padding:40,textAlign:"center"},children:[t.jsx(m,{"data-loc":"client/src/pages/history/WalletHistory.tsx:108",style:{width:48,height:48,color:"#d1d5db",margin:"0 auto 16px"}}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:109",style:{fontSize:16,fontWeight:600,marginBottom:8},children:"Đăng nhập để xem biến động số dư"}),t.jsx("a",{"data-loc":"client/src/pages/history/WalletHistory.tsx:110",href:N("/l
1ich-su/vi"),className:"primary-submit-btn",style:{display:"inline-block",marginTop:12},children:"Đăng nhập ngay"})]})]})})}export{q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.