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
+28 -2
View File
@@ -26,7 +26,11 @@
"disabled": "Disabled",
"noData": "No Data",
"saveConfig": "Save Config",
"refreshConfig": "Refresh Config"
"refreshConfig": "Refresh Config",
"total": "Total",
"items": "items",
"prev": "Previous",
"next": "Next"
},
"account": {
"title": "Account Management",
@@ -478,6 +482,11 @@
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled. Check depth of first N levels",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"priceRangeFilter": "Price Range Filter",
"priceRange": "Price Range",
"priceRangeTooltip": "Only copy orders where Leader's trade price is within the specified range. Leave empty to disable. Examples: Fill 0.11 and 0.89 means only copy orders with price between 0.11 and 0.89; Fill only max price 0.89 means only copy orders with price below 0.89; Fill only min price 0.11 means only copy orders with price above 0.11.",
"minPricePlaceholder": "Min Price (leave empty for no limit)",
"maxPricePlaceholder": "Max Price (leave empty for no limit)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders. Enabled: copy both Leader's buy and sell orders; Disabled: only copy Leader's buy orders, ignore sell orders.",
"create": "Create Template",
@@ -530,6 +539,11 @@
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled. Check depth of first N levels",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"priceRangeFilter": "Price Range Filter",
"priceRange": "Price Range",
"priceRangeTooltip": "Only copy orders where Leader's trade price is within the specified range. Leave empty to disable. Examples: Fill 0.11 and 0.89 means only copy orders with price between 0.11 and 0.89; Fill only max price 0.89 means only copy orders with price below 0.89; Fill only min price 0.11 means only copy orders with price above 0.11.",
"minPricePlaceholder": "Min Price (leave empty for no limit)",
"maxPricePlaceholder": "Max Price (leave empty for no limit)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders. Enabled: copy both Leader's buy and sell orders; Disabled: only copy Leader's buy orders, ignore sell orders.",
"invalidNumber": "Please enter a valid number"
@@ -590,6 +604,11 @@
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled. Check depth of first N levels",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"priceRangeFilter": "Price Range Filter",
"priceRange": "Price Range",
"priceRangeTooltip": "Only copy orders where Leader's trade price is within the specified range. Leave empty to disable. Examples: Fill 0.11 and 0.89 means only copy orders with price between 0.11 and 0.89; Fill only max price 0.89 means only copy orders with price below 0.89; Fill only min price 0.11 means only copy orders with price above 0.11.",
"minPricePlaceholder": "Min Price (leave empty for no limit)",
"maxPricePlaceholder": "Max Price (leave empty for no limit)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders",
"create": "Create Copy Trading Config",
@@ -648,6 +667,11 @@
"minOrderbookDepth": "Min Orderbook Depth (USDC)",
"minOrderbookDepthTooltip": "Minimum orderbook depth (USDC amount), NULL means this filter is not enabled",
"minOrderbookDepthPlaceholder": "For example: 50 (optional, leave empty to disable)",
"priceRangeFilter": "Price Range Filter",
"priceRange": "Price Range",
"priceRangeTooltip": "Only copy orders where Leader's trade price is within the specified range. Leave empty to disable. Examples: Fill 0.11 and 0.89 means only copy orders with price between 0.11 and 0.89; Fill only max price 0.89 means only copy orders with price below 0.89; Fill only min price 0.11 means only copy orders with price above 0.11.",
"minPricePlaceholder": "Min Price (leave empty for no limit)",
"maxPricePlaceholder": "Max Price (leave empty for no limit)",
"supportSell": "Support Sell",
"supportSellTooltip": "Whether to copy Leader's sell orders",
"save": "Save",
@@ -677,8 +701,10 @@
"marketStatus": "Market Not Tradable",
"orderbookError": "Orderbook Fetch Failed",
"orderbookEmpty": "Orderbook Empty",
"priceRange": "Price Range Mismatch",
"unknown": "Unknown Reason"
}
},
"noData": "No filtered orders"
},
"copyTradingList": {
"title": "Copy Trading Config Management",
+31 -5
View File
@@ -23,7 +23,11 @@
"loading": "加载中",
"noData": "暂无数据",
"saveConfig": "保存配置",
"refreshConfig": "刷新配置"
"refreshConfig": "刷新配置",
"total": "共",
"items": "条",
"prev": "上一页",
"next": "下一页"
},
"login": {
"title": "登录",
@@ -390,6 +394,11 @@
"minOrderbookDepth": "最小订单簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小订单簿深度(USDC金额),NULL表示不启用此过滤。检查前 N 档的深度",
"minOrderbookDepthPlaceholder": "例如:50(可选,不填写表示不启用)",
"priceRangeFilter": "价格区间过滤",
"priceRange": "价格区间",
"priceRangeTooltip": "仅跟单 Leader 交易价格在指定区间内的订单。不填写表示不限制。示例:填写 0.11 和 0.89 表示仅跟单价格在 0.11 到 0.89 之间的订单;只填写最高价 0.89 表示仅跟单价格在 0.89 以下的订单;只填写最低价 0.11 表示仅跟单价格在 0.11 以上的订单。",
"minPricePlaceholder": "最低价(留空不限制)",
"maxPricePlaceholder": "最高价(留空不限制)",
"supportSell": "跟单卖出",
"supportSellTooltip": "是否跟单 Leader 的卖出订单。开启:跟单 Leader 的买入和卖出订单;关闭:只跟单 Leader 的买入订单,忽略卖出订单。",
"create": "创建模板",
@@ -442,6 +451,11 @@
"minOrderbookDepth": "最小订单簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小订单簿深度(USDC金额),NULL表示不启用此过滤。检查前 N 档的深度",
"minOrderbookDepthPlaceholder": "例如:50(可选,不填写表示不启用)",
"priceRangeFilter": "价格区间过滤",
"priceRange": "价格区间",
"priceRangeTooltip": "仅跟单 Leader 交易价格在指定区间内的订单。不填写表示不限制。示例:填写 0.11 和 0.89 表示仅跟单价格在 0.11 到 0.89 之间的订单;只填写最高价 0.89 表示仅跟单价格在 0.89 以下的订单;只填写最低价 0.11 表示仅跟单价格在 0.11 以上的订单。",
"minPricePlaceholder": "最低价(留空不限制)",
"maxPricePlaceholder": "最高价(留空不限制)",
"supportSell": "跟单卖出",
"supportSellTooltip": "是否跟单 Leader 的卖出订单。开启:跟单 Leader 的买入和卖出订单;关闭:只跟单 Leader 的买入订单,忽略卖出订单。",
"invalidNumber": "请输入有效的数字"
@@ -502,6 +516,11 @@
"minOrderbookDepth": "最小订单簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小订单簿深度(USDC金额),NULL表示不启用此过滤。检查前 N 档的深度",
"minOrderbookDepthPlaceholder": "例如:50(可选,不填写表示不启用)",
"priceRangeFilter": "价格区间过滤",
"priceRange": "价格区间",
"priceRangeTooltip": "仅跟单 Leader 交易价格在指定区间内的订单。不填写表示不限制。示例:填写 0.11 和 0.89 表示仅跟单价格在 0.11 到 0.89 之间的订单;只填写最高价 0.89 表示仅跟单价格在 0.89 以下的订单;只填写最低价 0.11 表示仅跟单价格在 0.11 以上的订单。",
"minPricePlaceholder": "最低价(留空不限制)",
"maxPricePlaceholder": "最高价(留空不限制)",
"supportSell": "跟单卖出",
"supportSellTooltip": "是否跟单 Leader 的卖出订单",
"create": "创建跟单配置",
@@ -560,6 +579,11 @@
"minOrderbookDepth": "最小订单簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小订单簿深度(USDC金额),NULL表示不启用此过滤",
"minOrderbookDepthPlaceholder": "例如:50(可选,不填写表示不启用)",
"priceRangeFilter": "价格区间过滤",
"priceRange": "价格区间",
"priceRangeTooltip": "仅跟单 Leader 交易价格在指定区间内的订单。不填写表示不限制。示例:填写 0.11 和 0.89 表示仅跟单价格在 0.11 到 0.89 之间的订单;只填写最高价 0.89 表示仅跟单价格在 0.89 以下的订单;只填写最低价 0.11 表示仅跟单价格在 0.11 以上的订单。",
"minPricePlaceholder": "最低价(留空不限制)",
"maxPricePlaceholder": "最高价(留空不限制)",
"supportSell": "跟单卖出",
"supportSellTooltip": "是否跟单 Leader 的卖出订单",
"save": "保存",
@@ -569,8 +593,8 @@
"invalidNumber": "请输入有效的数字"
},
"filteredOrdersList": {
"title": "过滤订单列表",
"fetchFailed": "获取过滤订单列表失败",
"title": "过滤订单列表",
"fetchFailed": "获取过滤订单列表失败",
"market": "市场",
"outcome": "方向",
"price": "价格",
@@ -589,8 +613,10 @@
"marketStatus": "市场状态不可交易",
"orderbookError": "订单簿获取失败",
"orderbookEmpty": "订单簿为空",
"priceRange": "价格区间不符",
"unknown": "未知原因"
}
},
"noData": "暂无已过滤订单"
},
"copyTradingList": {
"title": "跟单配置管理",
@@ -611,7 +637,7 @@
"buyOrders": "买入订单",
"sellOrders": "卖出订单",
"matchedOrders": "匹配关系",
"filteredOrders": "过滤订单",
"filteredOrders": "过滤订单",
"filterWallet": "筛选钱包",
"filterTemplate": "筛选模板",
"filterLeader": "筛选 Leader",
+28 -2
View File
@@ -26,7 +26,11 @@
"disabled": "禁用",
"noData": "暫無數據",
"saveConfig": "保存配置",
"refreshConfig": "刷新配置"
"refreshConfig": "刷新配置",
"total": "共",
"items": "條",
"prev": "上一頁",
"next": "下一頁"
},
"account": {
"title": "賬戶管理",
@@ -478,6 +482,11 @@
"minOrderbookDepth": "最小訂單簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小訂單簿深度(USDC金額),NULL表示不啟用此過濾。檢查前 N 檔的深度",
"minOrderbookDepthPlaceholder": "例如:50(可選,不填寫表示不啟用)",
"priceRangeFilter": "價格區間過濾",
"priceRange": "價格區間",
"priceRangeTooltip": "僅跟單 Leader 交易價格在指定區間內的訂單。不填寫表示不限制。示例:填寫 0.11 和 0.89 表示僅跟單價格在 0.11 到 0.89 之間的訂單;只填寫最高價 0.89 表示僅跟單價格在 0.89 以下的訂單;只填寫最低價 0.11 表示僅跟單價格在 0.11 以上的訂單。",
"minPricePlaceholder": "最低價(留空不限制)",
"maxPricePlaceholder": "最高價(留空不限制)",
"supportSell": "跟單賣出",
"supportSellTooltip": "是否跟單 Leader 的賣出訂單。開啟:跟單 Leader 的買入和賣出訂單;關閉:只跟單 Leader 的買入訂單,忽略賣出訂單。",
"create": "創建模板",
@@ -530,6 +539,11 @@
"minOrderbookDepth": "最小訂單簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小訂單簿深度(USDC金額),NULL表示不啟用此過濾。檢查前 N 檔的深度",
"minOrderbookDepthPlaceholder": "例如:50(可選,不填寫表示不啟用)",
"priceRangeFilter": "價格區間過濾",
"priceRange": "價格區間",
"priceRangeTooltip": "僅跟單 Leader 交易價格在指定區間內的訂單。不填寫表示不限制。示例:填寫 0.11 和 0.89 表示僅跟單價格在 0.11 到 0.89 之間的訂單;只填寫最高價 0.89 表示僅跟單價格在 0.89 以下的訂單;只填寫最低價 0.11 表示僅跟單價格在 0.11 以上的訂單。",
"minPricePlaceholder": "最低價(留空不限制)",
"maxPricePlaceholder": "最高價(留空不限制)",
"supportSell": "跟單賣出",
"supportSellTooltip": "是否跟單 Leader 的賣出訂單。開啟:跟單 Leader 的買入和賣出訂單;關閉:只跟單 Leader 的買入訂單,忽略賣出訂單。",
"invalidNumber": "請輸入有效的數字"
@@ -590,6 +604,11 @@
"minOrderbookDepth": "最小訂單簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小訂單簿深度(USDC金額),NULL表示不啟用此過濾。檢查前 N 檔的深度",
"minOrderbookDepthPlaceholder": "例如:50(可選,不填寫表示不啟用)",
"priceRangeFilter": "價格區間過濾",
"priceRange": "價格區間",
"priceRangeTooltip": "僅跟單 Leader 交易價格在指定區間內的訂單。不填寫表示不限制。示例:填寫 0.11 和 0.89 表示僅跟單價格在 0.11 到 0.89 之間的訂單;只填寫最高價 0.89 表示僅跟單價格在 0.89 以下的訂單;只填寫最低價 0.11 表示僅跟單價格在 0.11 以上的訂單。",
"minPricePlaceholder": "最低價(留空不限制)",
"maxPricePlaceholder": "最高價(留空不限制)",
"supportSell": "跟單賣出",
"supportSellTooltip": "是否跟單 Leader 的賣出訂單",
"create": "創建跟單配置",
@@ -648,6 +667,11 @@
"minOrderbookDepth": "最小訂單簿深度 (USDC)",
"minOrderbookDepthTooltip": "最小訂單簿深度(USDC金額),NULL表示不啟用此過濾",
"minOrderbookDepthPlaceholder": "例如:50(可選,不填寫表示不啟用)",
"priceRangeFilter": "價格區間過濾",
"priceRange": "價格區間",
"priceRangeTooltip": "僅跟單 Leader 交易價格在指定區間內的訂單。不填寫表示不限制。示例:填寫 0.11 和 0.89 表示僅跟單價格在 0.11 到 0.89 之間的訂單;只填寫最高價 0.89 表示僅跟單價格在 0.89 以下的訂單;只填寫最低價 0.11 表示僅跟單價格在 0.11 以上的訂單。",
"minPricePlaceholder": "最低價(留空不限制)",
"maxPricePlaceholder": "最高價(留空不限制)",
"supportSell": "跟單賣出",
"supportSellTooltip": "是否跟單 Leader 的賣出訂單",
"save": "保存",
@@ -677,8 +701,10 @@
"marketStatus": "市場狀態不可交易",
"orderbookError": "訂單簿獲取失敗",
"orderbookEmpty": "訂單簿為空",
"priceRange": "價格區間不符",
"unknown": "未知原因"
}
},
"noData": "暫無已過濾訂單"
},
"copyTradingList": {
"title": "跟單配置管理",