feat: 迭代

This commit is contained in:
2026-05-22 18:54:30 +08:00
parent ca22542c7a
commit 4c7a1e06a8
20 changed files with 2169 additions and 1087 deletions
@@ -5,15 +5,20 @@ import { getFinancialOverview, getPlatformTransactions } from '@/api/finance';
import type { ColumnsType } from 'antd/es/table';
interface FinancialOverview {
systemTotalAmount: number;
totalUserPaid: number;
totalRefund: number;
totalWithdrawn: number;
platformBalance: number;
platformTotalIncome: number;
platformTotalExpense: number;
totalUserBalance: number;
totalMerchantBalance: number;
userCount: number;
merchantCount: number;
todayIncome: number;
todayExpense: number;
monthIncome: number;
monthExpense: number;
pendingWithdrawals: number;
pendingSettlements: number;
todayOrders: number;
}
interface Transaction {
@@ -108,18 +113,21 @@ const FinanceDashboard: React.FC = () => {
{overview && (
<>
{/* 平台总账户额 - 突出显示 */}
{/* 系统总账户额 - 突出显示 */}
<Card style={{ marginBottom: 24, background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)' }}>
<Statistic
title={<span style={{ color: '#fff', fontSize: 16 }}></span>}
value={Number(overview.platformBalance || 0) + Number(overview.totalMerchantBalance || 0) + Number(overview.totalUserBalance || 0)}
title={<span style={{ color: '#fff', fontSize: 16 }}></span>}
value={Number(overview.systemTotalAmount || 0)}
prefix={<WalletOutlined style={{ color: '#fff' }} />}
suffix={<span style={{ color: '#fff' }}></span>}
precision={2}
valueStyle={{ color: '#fff', fontSize: 36, fontWeight: 'bold' }}
/>
<div style={{ color: 'rgba(255,255,255,0.8)', fontSize: 12, marginTop: 8 }}>
¥{Number(overview.totalUserPaid || 0).toFixed(2)}- 退¥{Number(overview.totalRefund || 0).toFixed(2)}- ¥{Number(overview.totalWithdrawn || 0).toFixed(2)}
</div>
<div style={{ color: 'rgba(255,255,255,0.6)', fontSize: 11, marginTop: 4 }}>
= ¥{Number(overview.totalMerchantBalance || 0).toFixed(2)}+ ¥{Number(overview.totalUserBalance || 0).toFixed(2)}+ ¥{Number(overview.platformBalance || 0).toFixed(2)}
</div>
</Card>
@@ -127,13 +135,16 @@ const FinanceDashboard: React.FC = () => {
<Col span={6}>
<Card>
<Statistic
title="平台账户余额"
title="平台净收益"
value={overview.platformBalance}
precision={2}
prefix={<WalletOutlined />}
suffix="元"
valueStyle={{ color: '#1890ff' }}
/>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
-
</div>
</Card>
</Col>
<Col span={6}>
@@ -146,6 +157,9 @@ const FinanceDashboard: React.FC = () => {
suffix="元"
valueStyle={{ color: '#52c41a' }}
/>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
{overview.userCount}
</div>
</Card>
</Col>
<Col span={6}>
@@ -158,23 +172,25 @@ const FinanceDashboard: React.FC = () => {
suffix="元"
valueStyle={{ color: '#faad14' }}
/>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
{overview.merchantCount}
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<Statistic
title="待处理提现"
value={overview.pendingWithdrawals}
precision={2}
suffix="元"
valueStyle={{ color: '#ff4d4f' }}
title="今日订单数"
value={overview.todayOrders}
suffix="单"
valueStyle={{ color: '#722ed1' }}
/>
</Card>
</Col>
</Row>
<Row gutter={24} style={{ marginBottom: 24 }}>
<Col span={6}>
<Col span={8}>
<Card>
<Statistic
title="今日收入"
@@ -186,7 +202,7 @@ const FinanceDashboard: React.FC = () => {
/>
</Card>
</Col>
<Col span={6}>
<Col span={8}>
<Card>
<Statistic
title="今日支出"
@@ -198,6 +214,19 @@ const FinanceDashboard: React.FC = () => {
/>
</Card>
</Col>
<Col span={8}>
<Card>
<Statistic
title="今日净收益"
value={Number(overview.todayIncome || 0) - Number(overview.todayExpense || 0)}
precision={2}
suffix="元"
valueStyle={{
color: (Number(overview.todayIncome || 0) - Number(overview.todayExpense || 0)) >= 0 ? '#52c41a' : '#ff4d4f'
}}
/>
</Card>
</Col>
<Col span={6}>
<Card>
<Statistic