1import{r as e,j as t}from"./vendor-react-DejgYtBM.js";import{i as a,f as l,m as s,l as i,B as n,j as r,k as o,x as d,y as c}from"./vendor-semi-D8d7bTtM.js";import{u as y,A as m,s as x}from"./index-BeIIFw6E.js";import{R as h}from"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";const{Title:p,Text:u}=l,f=()=>{const{t:l}=y(),[f,g]=e.useState(null),[_,j]=e.useState([]),[b,v]=e.useState(0),[V,w]=e.useState(!1),[S,k]=e.useState(!1),[z,C]=e.useState(1),[B]=e.useState(20),[I,$]=e.useState(0),[T,W]=e.useState(null),O=e.useCallback(async()=>{k(!0);try{const e=await m.get("/api/platform_revenue/statistics"),{success:t,data:a,message:s}=e.data;t?g(a):x(s||l("è·åç»è®¡æ°æ®å¤±è´¥"))}catch(e){x(e.message)}finally{k(!1)}},[]),F=e.useCallback(async()=>{w(!0);try{const e={page:z,page_size:B};I>0&&(e.revenue_type=I),T&&2===T.length&&(e.start_timestamp=Math.floor(T[0].getTime()/1e3),e.end_timestamp=Math.floor(T[1].getTime()/1e3));const t=await m.get("/api/platform_revenue/logs",{params:e}),{success:a,data:s,message:i}=t.data;a?(j(s.logs||[]),v(s.total||0)):x(i||l("è·åæ¶å
¥æ¥å¿å¤±è´¥"))}catch(e){x(e.message)}finally{w(!1)}},[z,B,I,T]);e.useEffect(()=>{O()},[O]),e.useEffect(()=>{F()},[F]);const E=e=>null==e?"Â¥0.00":`Â¥${Number(e).toFixed(2)}`,D=({title:e,todayValue:a,yesterdayValue:i,monthValue:n,allValue:r,color:o})=>t.jsxs(s,{style:{flex:1,minWidth:220},bodyStyle:{padding:"16px"},children:[t.jsx(u,{strong:!0,style:{fontSize:14,color:o||"#333"},children:e}),t.jsxs("div",{style:{marginTop:12},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},children:[t.jsx(u,{type:"tertiary",size:14,children:l("仿¥")}),t.jsx(u,{strong:!0,style:{color:"#10B981"},children:E(a)})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},children:[t.jsx(u,{type:"tertiary",size:14,children:l("æ¨æ¥")}),t.jsx(u,{children:E(i)})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},children:[t.jsx(u,{type:"tertiary",size:14,children:l("æ¬æ")}),t.jsx(u,{children:E(n)})]}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[t.jsx(u,{type:"tertiary",size:14,children:l("累计")}),t.jsx(u,{strong:!0,children:E(r)})]})]})]}),P=[{title:l("ID"),dataIndex:"id",key:"id",width:70},{title:l("æ¶å
¥ç±»å"),dataIndex:"revenue_type",key:"revenue_type",width:140,render:e=>{const s=(e=>({1:{label:e("å¨çº¿å
弿½æ"),color:"blue"},2:{label:e("å
æ¢ç æç»è´¹"),color:"green"},3:{label:e("å
æ¢ç åææ½æ"),color:"cyan"},4:{label:e("ç«é¿å转æç»è´¹"),color:"orange"},5:{label:e("æ¶çåè½¬æ½æ"),color:"purple"}}))(l),i=s[e];return i?t.jsx(a,{color:i.color,size:"small",children:i.label}):t.jsx(a,{size:"small",children:l("æªç¥")})}},{title:l("éé¢"),dataIndex:"amount",key:"amount",width:120,render:e=>t.jsx(u,{strong:!0,style:{color:"#10B981"},children:E(e)})},{title:l("代ç"),dataIndex:"agent_name",key:"agent_name",width:120,render:(e,t)=>e?`${e} (${t.agent_id})`:t.agent_id||"-"},{title:l("ç¨æ·"),dataIndex:"user_name",key:"user_name",width:120,render:(e,t)=>e?`${e} (${t.user_id})`:t.user_id||"-"},{title:l("说æ"),dataIndex:"description",key:"description",ellipsis:!0},{title:l("å
³è订å"),dataIndex:"related_id",key:"related_id",width:120,render:e=>e||"-"},{title:l("æ¶é´"),dataIndex:"created_at",key:"created_at",width:170,render:e=>(e=>e?new Date(1e3*e).toLocaleString():"-")(e)}];return t.jsxs("div",{className:"bg-background h-full px-2",children:[t.jsx(s,{title:t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},children:[t.jsx(p,{heading:5,style:{margin:0},children:l("平尿¶å
¥ç»è®¡")}),t.jsx(n,{icon:t.jsx(h,{size:16}),onClick:()=>{O(),F()},loading:S,children:l("å·æ°")})]}),style:{marginBottom:16},children:S&&!f?t.jsx("div",{style:{textAlign:"center",padding:40},children:t.jsx(i,{size:20})}):f?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:12,marginBottom:16,flexWrap:"wrap"},children:[t.jsxs(s,{style:{flex:1,minWidth:220,background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},bodyStyle:{padding:"16px"},children:[t.jsx(u,{style:{color:"rgba(255,255,255,0.8)",fontSize:13},children:l("仿¥æ»æ¶å
¥")}),t.jsx(p,{heading:3,style:{margin:"8px 0 0",color:"#fff"},children:E(f.today_total)})]}),t.jsxs(s,{style:{flex:1,minWidth:220,background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},bodyStyle:{padding:"16px"},children:[t.jsx(u,{style:{color:"rgba(255,255,255,0.8)",fontSize:13},children:l("æ¨æ¥æ»æ¶å
¥")}),t.jsx(p,{heading:3,style:{margin:"8px 0 0",color:"#fff"},children:E(f.yesterday_total)})]}),t.jsxs(s,{style:{flex:1,minWidth:220,background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)"},bodyStyle:{padding:"16px"},children:[t.jsx(u,{style:{color:"rgba(255,255,255,0.8)",fontSize:13}
1,children:l("æ¬ææ»æ¶å
¥")}),t.jsx(p,{heading:3,style:{margin:"8px 0 0",color:"#fff"},children:E(f.month_total)})]}),t.jsxs(s,{style:{flex:1,minWidth:220,background:"linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)"},bodyStyle:{padding:"16px"},children:[t.jsx(u,{style:{color:"rgba(255,255,255,0.8)",fontSize:13},children:l("ç´¯è®¡æ»æ¶å
¥")}),t.jsx(p,{heading:3,style:{margin:"8px 0 0",color:"#fff"},children:E(f.all_total)})]})]}),t.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[t.jsx(D,{title:l("å¨çº¿å
弿½æ"),color:"#3B82F6",todayValue:f.today_top_up_commission,yesterdayValue:f.yesterday_top_up_commission,monthValue:f.month_top_up_commission,allValue:f.all_top_up_commission}),t.jsx(D,{title:l("å
æ¢ç æç»è´¹"),color:"#22C55E",todayValue:f.today_redemption_fee,yesterdayValue:f.yesterday_redemption_fee,monthValue:f.month_redemption_fee,allValue:f.all_redemption_fee}),t.jsx(D,{title:l("å
æ¢ç åææ½æ"),color:"#06B6D4",todayValue:f.today_redemption_commission,yesterdayValue:f.yesterday_redemption_commission,monthValue:f.month_redemption_commission,allValue:f.all_redemption_commission}),t.jsx(D,{title:l("ç«é¿å转æç»è´¹"),color:"#F97316",todayValue:f.today_transfer_fee,yesterdayValue:f.yesterday_transfer_fee,monthValue:f.month_transfer_fee,allValue:f.all_transfer_fee}),t.jsx(D,{title:l("æ¶çåè½¬æ½æ"),color:"#8B5CF6",todayValue:f.today_aff_transfer_commission,yesterdayValue:f.yesterday_aff_transfer_commission,monthValue:f.month_aff_transfer_commission,allValue:f.all_aff_transfer_commission})]})]}):null}),t.jsxs(s,{title:t.jsx(p,{heading:5,style:{margin:0},children:l("æ¶å
¥æ¥å¿")}),children:[t.jsxs(r,{style:{marginBottom:16},wrap:!0,children:[t.jsxs(o,{placeholder:l("æ¶å
¥ç±»å"),value:I,onChange:e=>{$(e),C(1)},style:{width:180},children:[t.jsx(o.Option,{value:0,children:l("å
¨é¨ç±»å")}),t.jsx(o.Option,{value:1,children:l("å¨çº¿å
弿½æ")}),t.jsx(o.Option,{value:2,children:l("å
æ¢ç æç»è´¹")}),t.jsx(o.Option,{value:3,children:l("å
æ¢ç åææ½æ")}),t.jsx(o.Option,{value:4,children:l("ç«é¿å转æç»è´¹")}),t.jsx(o.Option,{value:5,children:l("æ¶çåè½¬æ½æ")})]}),t.jsx(d,{type:"dateRange",placeholder:[l("å¼å§æ¥æ"),l("ç»ææ¥æ")],onChange:e=>{W(e),C(1)},style:{width:260}})]}),t.jsx(c,{columns:P,dataSource:_,loading:V,rowKey:"id",pagination:{currentPage:z,pageSize:B,total:b,onPageChange:e=>C(e),showTotal:!0,formatPageText:e=>`${e.currentStart}-${e.currentEnd} / ${l("å
±")} ${b} ${l("æ¡")}`},size:"small",bordered:!0,empty:t.jsx(u,{type:"tertiary",children:l("ææ æ¶å
¥è®°å½")})})]})]})};export{f 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.