feat: 重构 TradingSimulation 和 Dashboard 组件

This commit is contained in:
zdl
2025-10-18 09:03:10 +08:00
parent ea627f867e
commit 32121c416e
8 changed files with 119 additions and 60 deletions

View File

@@ -32,6 +32,7 @@ import {
useToast
} from '@chakra-ui/react';
import { FiSearch, FiFilter, FiClock, FiTrendingUp, FiTrendingDown } from 'react-icons/fi';
import { logger } from '../../../utils/logger';
export default function TradingHistory({ history, onCancelOrder }) {
const [filterType, setFilterType] = useState('ALL'); // ALL, BUY, SELL
@@ -147,6 +148,7 @@ export default function TradingHistory({ history, onCancelOrder }) {
const handleCancelOrder = async (orderId) => {
try {
await onCancelOrder(orderId);
logger.info('TradingHistory', '撤单成功', { orderId });
toast({
title: '撤单成功',
description: `订单 ${orderId} 已撤销`,
@@ -155,6 +157,7 @@ export default function TradingHistory({ history, onCancelOrder }) {
isClosable: true,
});
} catch (error) {
logger.error('TradingHistory', 'handleCancelOrder', error, { orderId });
toast({
title: '撤单失败',
description: error.message,