feat: 添加价格区间过滤功能并优化UI

- 添加价格区间过滤功能(minPrice/maxPrice)
  - 数据库迁移:添加价格区间字段到 copy_trading 和 copy_trading_templates 表
  - 后端:实体类、DTO、服务层支持价格区间配置和过滤
  - 前端:模板和配置页面添加价格区间配置UI
  - 过滤逻辑:在订单创建前检查价格是否在配置区间内

- 优化价格区间文案,使其更易懂
  - 明确说明是 Leader 交易价格
  - 详细说明三种配置方式(区间、只填最低价、只填最高价)

- 补充多语言翻译
  - 为 zh-CN、zh-TW、en 添加价格区间相关翻译
  - 添加价格区间过滤类型翻译
  - 添加通用翻译(prev、next、items、total)

- 修复复制模板功能
  - 补充缺失的过滤条件字段(minOrderDepth、maxSpread、minOrderbookDepth、minPrice、maxPrice)
  - 在复制模板表单中添加所有过滤条件配置项

- 已过滤订单列表优化
  - 添加移动端卡片样式布局
  - 在筛选下拉菜单中添加价格区间过滤类型选项

- 订单页面返回按钮优化
  - 买入订单、卖出订单、匹配关系页面的返回按钮改为返回上一页(navigate(-1))
  - 使用多语言支持返回按钮文本
This commit is contained in:
WrBug
2025-12-05 23:52:49 +08:00
parent 6c13362b17
commit 3369dbb248
26 changed files with 753 additions and 127 deletions
+24 -22
View File
@@ -264,12 +264,6 @@ const CopyTradingList: React.FC = () => {
{
type: 'divider'
},
{
key: 'statistics',
label: t('copyTradingList.viewStatistics') || '查看统计',
icon: <BarChartOutlined />,
onClick: () => navigate(`/copy-trading/statistics/${record.id}`)
},
{
key: 'buyOrders',
label: t('copyTradingList.buyOrders') || '买入订单',
@@ -290,7 +284,7 @@ const CopyTradingList: React.FC = () => {
},
{
key: 'filteredOrders',
label: t('copyTradingList.filteredOrders') || '过滤订单',
label: t('copyTradingList.filteredOrders') || '过滤订单',
icon: <UnorderedListOutlined />,
onClick: () => navigate(`/copy-trading/filtered-orders/${record.id}`)
},
@@ -550,39 +544,47 @@ const CopyTradingList: React.FC = () => {
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
<Button
type="primary"
size="small"
icon={<EditOutlined />}
onClick={() => navigate(`/copy-trading/edit/${record.id}`)}
style={{ flex: 1, minWidth: '80px' }}
>
{t('common.edit') || '编辑'}
</Button>
<Button
size="small"
icon={<BarChartOutlined />}
onClick={() => navigate(`/copy-trading/statistics/${record.id}`)}
style={{ flex: 1, minWidth: '80px' }}
>
{t('copyTradingList.statistics') || '统计'}
</Button>
<Dropdown
menu={{
items: [
{
key: 'statistics',
label: '查看统计',
icon: <BarChartOutlined />,
onClick: () => navigate(`/copy-trading/statistics/${record.id}`)
},
{
key: 'buyOrders',
label: '买入订单',
label: t('copyTradingList.buyOrders') || '买入订单',
icon: <UnorderedListOutlined />,
onClick: () => navigate(`/copy-trading/orders/buy/${record.id}`)
},
{
key: 'sellOrders',
label: '卖出订单',
label: t('copyTradingList.sellOrders') || '卖出订单',
icon: <UnorderedListOutlined />,
onClick: () => navigate(`/copy-trading/orders/sell/${record.id}`)
},
{
key: 'matchedOrders',
label: '匹配关系',
label: t('copyTradingList.matchedOrders') || '匹配关系',
icon: <UnorderedListOutlined />,
onClick: () => navigate(`/copy-trading/orders/matched/${record.id}`)
},
{
key: 'filteredOrders',
label: t('copyTradingList.filteredOrders') || '已过滤订单',
icon: <UnorderedListOutlined />,
onClick: () => navigate(`/copy-trading/filtered-orders/${record.id}`)
}
]
}}
@@ -593,14 +595,14 @@ const CopyTradingList: React.FC = () => {
icon={<UnorderedListOutlined />}
style={{ flex: 1, minWidth: '80px' }}
>
{t('copyTradingList.orders') || '订单'}
</Button>
</Dropdown>
<Popconfirm
title="确定要删除这个跟单关系吗?"
title={t('copyTradingList.deleteConfirm') || '确定要删除这个跟单关系吗?'}
onConfirm={() => handleDelete(record.id)}
okText="确定"
cancelText="取消"
okText={t('common.confirm') || '确定'}
cancelText={t('common.cancel') || '取消'}
>
<Button
danger
@@ -608,7 +610,7 @@ const CopyTradingList: React.FC = () => {
icon={<DeleteOutlined />}
style={{ flex: 1, minWidth: '80px' }}
>
{t('common.delete') || '删除'}
</Button>
</Popconfirm>
</div>