fix(订单中心):首页订单状态分布图删除,新增二维码订单数量横向柱状图

This commit is contained in:
2025-08-05 12:56:51 +08:00
parent 20e9e066bf
commit e4ca99ffb2
5 changed files with 93 additions and 10 deletions
@@ -64,6 +64,11 @@ interface Statistics {
type: string;
value: number;
}[];
qrcodeOrderCount: {
qrcodeName: string;
qrcodeId: string;
orderCount: number;
}[];
};
// 新增筛选维度数据
filterOptions: {
@@ -296,15 +301,41 @@ const Welcome: React.FC = () => {
},
};
// 订单分布配置
const orderDistConfig = {
data: chartStats.orderDistribution || [],
angleField: 'value',
colorField: 'type',
radius: 0.8,
// 二维码订单数量配置 - 横向柱状图
const qrcodeOrderConfig = {
data: chartStats.qrcodeOrderCount || [],
xField: 'orderCount',
yField: 'qrcodeName',
seriesField: 'qrcodeName',
bar: {
style: {
fill: '#1890ff',
},
},
label: {
type: 'outer',
content: '{name} {percentage}',
position: 'right' as const,
style: {
fill: '#666',
fontSize: 12,
},
},
xAxis: {
title: {
text: '订单数量',
},
},
yAxis: {
title: {
text: '二维码',
},
},
tooltip: {
formatter: (datum: any) => {
return {
name: '订单数量',
value: datum.orderCount,
};
},
},
};
@@ -516,8 +547,8 @@ const Welcome: React.FC = () => {
</Card>
</Col>
<Col xs={24} lg={8}>
<Card title="订单状态分布" loading={loading}>
<Pie {...orderDistConfig} height={300} />
<Card title="二维码订单数量" loading={loading}>
<Column {...qrcodeOrderConfig} height={300} />
</Card>
</Col>
</Row>