= {
'已入账': 'green',
'已付款': 'blue',
'处理中': 'orange',
};
return {status};
},
},
];
// 移动端简化表格列
const mobileColumns = [
{
title: '日期',
dataIndex: 'date',
key: 'date',
width: 100,
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
width: 60,
render: (type: string) => (
{type === '收入' ? '↑' : '↓'}
),
},
{
title: '金额',
dataIndex: 'amount',
key: 'amount',
render: (amount: number) => (
¥{amount.toLocaleString()}
),
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (status: string) => (
{status}
),
},
];
const [isMobile, setIsMobile] = React.useState(false);
React.useEffect(() => {
const checkMobile = () => {
setIsMobile(window.innerWidth <= 768);
};
checkMobile();
window.addEventListener('resize', checkMobile);
return () => window.removeEventListener('resize', checkMobile);
}, []);
return (
{/* 统计卡片 - 移动端优化 */}
{stats.map((stat, index) => (
{stat.title}}
value={stat.value}
prefix={stat.prefix}
suffix={stat.trend}
valueStyle={{
color: stat.color,
fontSize: isMobile ? 18 : undefined
}}
/>
))}
{/* 财务明细表 */}
);
};
export default FinancePage;