fix(订单中心):首页统计数据规则修改,时间筛选无效bug修复

This commit is contained in:
2025-08-04 20:29:06 +08:00
parent b830b201f7
commit fdcf22832a
3 changed files with 121 additions and 9 deletions
@@ -2,7 +2,7 @@ import { PageContainer } from '@ant-design/pro-components';
import { Card, Row, Col, Statistic, Progress, Typography, Select, DatePicker, Space, Button, Switch } from 'antd';
import React, { useState, useEffect } from 'react';
import { dashboard, getQrcodeOptions } from '@/services/orders/api';
import { Area, Column, Pie } from '@ant-design/plots';
import { Line, Column, Pie } from '@ant-design/plots';
import {
ShoppingCartOutlined,
PayCircleOutlined,
@@ -168,7 +168,7 @@ const Welcome: React.FC = () => {
const platformAmount = Math.round(netIncome * platformRate);
const tourismAmount = netIncome - platformAmount;
// 订单趋势配置
// 订单趋势配置 - 改为折线图
const orderTrendConfig = {
data: chartStats.orderTrend || [],
xField: 'date',
@@ -179,8 +179,13 @@ const Welcome: React.FC = () => {
legend: {
position: 'top' as const,
},
areaStyle: {
fillOpacity: 0.6,
// 移除面积图样式,改为折线图
line: {
size: 2,
},
point: {
size: 4,
shape: 'circle',
},
color: ['#1890ff', '#52c41a', '#faad14'],
xAxis: {
@@ -192,6 +197,13 @@ const Welcome: React.FC = () => {
formatter: (v: any) => `${v}单`,
},
},
tooltip: {
shared: true,
showCrosshairs: true,
crosshairs: {
type: 'xy' as const,
},
},
};
// 订单分布配置
@@ -408,8 +420,8 @@ const Welcome: React.FC = () => {
{/* 图表展示 */}
<Row gutter={[16, 16]} className={styles.chartsRow}>
<Col xs={24} lg={16}>
<Card title="订单趋势(创建/完成/退款)" loading={loading}>
<Area {...orderTrendConfig} height={300} />
<Card title="订单趋势折线图(创建/完成/退款)" loading={loading}>
<Line {...orderTrendConfig} height={300} />
</Card>
</Col>
<Col xs={24} lg={8}>