diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/dto/CopyTradingDto.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/dto/CopyTradingDto.kt index d21b9a4..96f7a39 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/dto/CopyTradingDto.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/dto/CopyTradingDto.kt @@ -36,7 +36,6 @@ data class CopyTradingCreateRequest( val maxPrice: String? = null, // 最高价格(可选),NULL表示不限制最高价 // 最大仓位配置 val maxPositionValue: String? = null, // 最大仓位金额(USDC),NULL表示不启用 - val maxPositionCount: Int? = null, // 最大仓位数量,NULL表示不启用 // 关键字过滤配置 val keywordFilterMode: String? = null, // 关键字过滤模式:DISABLED(不启用)、WHITELIST(白名单)、BLACKLIST(黑名单) val keywords: List? = null, // 关键字列表,当keywordFilterMode为DISABLED时为null @@ -75,7 +74,6 @@ data class CopyTradingUpdateRequest( val maxPrice: String? = null, // 最高价格(可选),NULL表示不限制最高价 // 最大仓位配置 val maxPositionValue: String? = null, // 最大仓位金额(USDC),NULL表示不启用 - val maxPositionCount: Int? = null, // 最大仓位数量,NULL表示不启用 // 关键字过滤配置 val keywordFilterMode: String? = null, // 关键字过滤模式:DISABLED(不启用)、WHITELIST(白名单)、BLACKLIST(黑名单) val keywords: List? = null, // 关键字列表,当keywordFilterMode为DISABLED时为null @@ -151,7 +149,6 @@ data class CopyTradingDto( val maxPrice: String?, // 最高价格(可选),NULL表示不限制最高价 // 最大仓位配置 val maxPositionValue: String? = null, // 最大仓位金额(USDC),NULL表示不启用 - val maxPositionCount: Int? = null, // 最大仓位数量,NULL表示不启用 // 关键字过滤配置 val keywordFilterMode: String? = null, // 关键字过滤模式:DISABLED(不启用)、WHITELIST(白名单)、BLACKLIST(黑名单) val keywords: List? = null, // 关键字列表,当keywordFilterMode为DISABLED时为null diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/entity/CopyTrading.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/entity/CopyTrading.kt index 4c94b4e..2271d42 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/entity/CopyTrading.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/entity/CopyTrading.kt @@ -83,9 +83,6 @@ data class CopyTrading( @Column(name = "max_position_value", precision = 20, scale = 8) val maxPositionValue: BigDecimal? = null, // 最大仓位金额(USDC),NULL表示不启用 - @Column(name = "max_position_count") - val maxPositionCount: Int? = null, // 最大仓位数量,NULL表示不启用 - // 关键字过滤配置 @Column(name = "keyword_filter_mode", nullable = false, length = 20) val keywordFilterMode: String = "DISABLED", // 关键字过滤模式:DISABLED(不启用)、WHITELIST(白名单)、BLACKLIST(黑名单) diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingFilterService.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingFilterService.kt index f4642c9..cd17618 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingFilterService.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingFilterService.kt @@ -315,7 +315,7 @@ class CopyTradingFilterService( outcomeIndex: Int? ): FilterResult { // 如果未配置仓位限制,直接通过 - if (copyTrading.maxPositionValue == null && copyTrading.maxPositionCount == null) { + if (copyTrading.maxPositionValue == null) { return FilterResult.passed() } @@ -369,39 +369,6 @@ class CopyTradingFilterService( } } - // 检查最大仓位数量(如果配置了) - if (copyTrading.maxPositionCount != null) { - // 使用数据库中的订单记录计算活跃仓位数量(解决延迟问题) - val dbCount = copyOrderTrackingRepository.countActivePositions(copyTrading.id!!) - - // 计算外部持仓中的唯一市场数量(防止遗漏非本项目创建的仓位) - val extCount = positions.currentPositions - .filter { it.accountId == copyTrading.accountId } - .map { it.marketId } - .distinct() - .size - - val currentPositionCount = maxOf(dbCount, extCount) - - // 检查:如果当前没有该市场该方向的活跃仓位,且总仓位数量已达到限制,则不允许开新仓 - // 判断当前市场该方向是否已有活跃仓位(数据库) - val hasDbPosition = if (outcomeIndex != null) { - copyOrderTrackingRepository.findUnmatchedBuyOrdersByOutcomeIndex( - copyTrading.id, marketId, outcomeIndex - ).isNotEmpty() - } else { - false - } - val hasExtPosition = marketPositions.isNotEmpty() - val hasCurrentMarketPosition = hasDbPosition || hasExtPosition - - if (!hasCurrentMarketPosition && currentPositionCount >= copyTrading.maxPositionCount) { - return FilterResult.maxPositionCountFailed( - "超过最大仓位数量限制: 当前活跃仓位总数(取最大值)=${currentPositionCount} (DB=${dbCount}, Ext=${extCount}) >= 最大限制=${copyTrading.maxPositionCount}" - ) - } - } - return FilterResult.passed() } catch (e: Exception) { logger.error("仓位检查异常: accountId=${copyTrading.accountId}, marketId=$marketId, outcomeIndex=$outcomeIndex, error=${e.message}", e) diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingService.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingService.kt index e238a3a..74e40f7 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingService.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/CopyTradingService.kt @@ -100,7 +100,6 @@ class CopyTradingService( minPrice = request.minPrice?.toSafeBigDecimal() ?: template.minPrice, maxPrice = request.maxPrice?.toSafeBigDecimal() ?: template.maxPrice, maxPositionValue = request.maxPositionValue?.toSafeBigDecimal(), - maxPositionCount = request.maxPositionCount, keywordFilterMode = request.keywordFilterMode ?: "DISABLED", keywords = convertKeywordsToJson(request.keywords), maxMarketEndDate = request.maxMarketEndDate, @@ -132,7 +131,6 @@ class CopyTradingService( minPrice = request.minPrice?.toSafeBigDecimal(), maxPrice = request.maxPrice?.toSafeBigDecimal(), maxPositionValue = request.maxPositionValue?.toSafeBigDecimal(), - maxPositionCount = request.maxPositionCount, keywordFilterMode = request.keywordFilterMode ?: "DISABLED", keywords = convertKeywordsToJson(request.keywords), maxMarketEndDate = request.maxMarketEndDate, @@ -164,7 +162,6 @@ class CopyTradingService( minPrice = config.minPrice, maxPrice = config.maxPrice, maxPositionValue = config.maxPositionValue, - maxPositionCount = config.maxPositionCount, keywordFilterMode = config.keywordFilterMode, keywords = config.keywords, configName = configName, @@ -282,16 +279,6 @@ class CopyTradingService( } else { copyTrading.maxPositionValue }, - // 处理 maxPositionCount:-1 表示要清空(设置为 null),null 表示不更新 - maxPositionCount = if (request.maxPositionCount != null) { - if (request.maxPositionCount == -1) { - null - } else { - request.maxPositionCount - } - } else { - copyTrading.maxPositionCount - }, keywordFilterMode = request.keywordFilterMode ?: copyTrading.keywordFilterMode, keywords = if (request.keywords != null) { convertKeywordsToJson(request.keywords) @@ -520,7 +507,6 @@ class CopyTradingService( minPrice = copyTrading.minPrice?.toPlainString(), maxPrice = copyTrading.maxPrice?.toPlainString(), maxPositionValue = copyTrading.maxPositionValue?.toPlainString(), - maxPositionCount = copyTrading.maxPositionCount, keywordFilterMode = copyTrading.keywordFilterMode, keywords = convertJsonToKeywords(copyTrading.keywords), configName = copyTrading.configName, @@ -585,7 +571,6 @@ class CopyTradingService( val minPrice: BigDecimal?, val maxPrice: BigDecimal?, val maxPositionValue: BigDecimal?, - val maxPositionCount: Int?, val keywordFilterMode: String, val keywords: String?, // JSON 字符串 val maxMarketEndDate: Long?, // 市场截止时间限制(毫秒时间戳) diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/FilterResult.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/FilterResult.kt index aff1fe3..087f9be 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/FilterResult.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/configs/FilterResult.kt @@ -20,8 +20,6 @@ enum class FilterStatus { FAILED_ORDER_DEPTH, /** 失败:超过最大仓位金额 */ FAILED_MAX_POSITION_VALUE, - /** 失败:超过最大仓位数量 */ - FAILED_MAX_POSITION_COUNT, /** 失败:关键字过滤 */ FAILED_KEYWORD_FILTER, /** 失败:市场截止时间超出限制 */ @@ -87,12 +85,6 @@ data class FilterResult( status = FilterStatus.FAILED_MAX_POSITION_VALUE, reason = reason ) - - /** 超过最大仓位数量 */ - fun maxPositionCountFailed(reason: String) = FilterResult( - status = FilterStatus.FAILED_MAX_POSITION_COUNT, - reason = reason - ) /** 关键字过滤失败 */ fun keywordFilterFailed(reason: String) = FilterResult( diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/statistics/CopyOrderTrackingService.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/statistics/CopyOrderTrackingService.kt index d7298a9..e2a38e0 100644 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/statistics/CopyOrderTrackingService.kt +++ b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/copytrading/statistics/CopyOrderTrackingService.kt @@ -1430,7 +1430,6 @@ open class CopyOrderTrackingService( FilterStatus.FAILED_SPREAD -> "SPREAD" FilterStatus.FAILED_ORDER_DEPTH -> "ORDER_DEPTH" FilterStatus.FAILED_MAX_POSITION_VALUE -> "MAX_POSITION_VALUE" - FilterStatus.FAILED_MAX_POSITION_COUNT -> "MAX_POSITION_COUNT" FilterStatus.FAILED_KEYWORD_FILTER -> "KEYWORD_FILTER" FilterStatus.FAILED_MARKET_END_DATE -> "MARKET_END_DATE" } diff --git a/backend/src/main/resources/db/migration/V26__remove_max_position_count.sql b/backend/src/main/resources/db/migration/V26__remove_max_position_count.sql new file mode 100644 index 0000000..5fe6b2d --- /dev/null +++ b/backend/src/main/resources/db/migration/V26__remove_max_position_count.sql @@ -0,0 +1,8 @@ +-- ============================================ +-- V26: 移除最大仓位数量配置字段 +-- 从 copy_trading 表中删除 max_position_count 字段 +-- ============================================ + +ALTER TABLE copy_trading +DROP COLUMN max_position_count; + diff --git a/frontend/src/locales/en/common.json b/frontend/src/locales/en/common.json index 3dceb14..0862472 100644 --- a/frontend/src/locales/en/common.json +++ b/frontend/src/locales/en/common.json @@ -718,9 +718,6 @@ "maxPositionValue": "Max Position Value (USDC)", "maxPositionValueTooltip": "Limit the maximum position value for a single market. If the current position value + copy order amount exceeds this limit, the order will not be placed. Leave empty to disable", "maxPositionValuePlaceholder": "For example: 100 (optional, leave empty to disable)", - "maxPositionCount": "Max Position Count", - "maxPositionCountTooltip": "Limit the maximum position count for a single market. If the current position count reaches or exceeds this limit, the order will not be placed. Leave empty to disable", - "maxPositionCountPlaceholder": "For example: 10 (optional, leave empty to disable)", "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.", "pushFilteredOrders": "Push Filtered Orders", @@ -792,9 +789,6 @@ "maxPositionValue": "Max Position Value (USDC)", "maxPositionValueTooltip": "Limit the maximum position value for a single market. If the current position value + copy order amount exceeds this limit, the order will not be placed. Leave empty to disable", "maxPositionValuePlaceholder": "For example: 100 (optional, leave empty to disable)", - "maxPositionCount": "Max Position Count", - "maxPositionCountTooltip": "Limit the maximum position count for a single market. If the current position count reaches or exceeds this limit, the order will not be placed. Leave empty to disable", - "maxPositionCountPlaceholder": "For example: 10 (optional, leave empty to disable)", "keywordFilter": "Keyword Filter", "keywordFilterMode": "Filter Mode", "keywordFilterModeTooltip": "Select keyword filter mode. Whitelist: only copy markets containing keywords; Blacklist: do not copy markets containing keywords; Disabled: no keyword filtering. Keyword matching is case-insensitive.", @@ -905,9 +899,6 @@ "maxPositionValue": "Max Position Value (USDC)", "maxPositionValueTooltip": "Limit the maximum position value for a single market. If the current position value + copy order amount exceeds this limit, the order will not be placed. Leave empty to disable", "maxPositionValuePlaceholder": "For example: 100 (optional, leave empty to disable)", - "maxPositionCount": "Max Position Count", - "maxPositionCountTooltip": "Limit the maximum position count for a single market. If the current position count reaches or exceeds this limit, the order will not be placed. Leave empty to disable", - "maxPositionCountPlaceholder": "For example: 10 (optional, leave empty to disable)", "keywordFilter": "Keyword Filter", "keywordFilterMode": "Filter Mode", "keywordFilterModeTooltip": "Select keyword filter mode. Whitelist: only copy markets containing keywords; Blacklist: do not copy markets containing keywords; Disabled: no keyword filtering. Keyword matching is case-insensitive.", @@ -972,7 +963,6 @@ "orderbookEmpty": "Orderbook Empty", "priceRange": "Price Range Mismatch", "maxPositionValue": "Exceeds Max Position Value", - "maxPositionCount": "Exceeds Max Position Count", "marketEndDate": "Market End Date Exceeds Limit", "unknown": "Unknown Reason" }, diff --git a/frontend/src/locales/zh-CN/common.json b/frontend/src/locales/zh-CN/common.json index 30cf1f3..d87e7e1 100644 --- a/frontend/src/locales/zh-CN/common.json +++ b/frontend/src/locales/zh-CN/common.json @@ -718,9 +718,6 @@ "maxPositionValue": "最大仓位金额 (USDC)", "maxPositionValueTooltip": "限制单个市场的最大仓位金额。如果该市场的当前仓位金额 + 跟单金额超过此限制,则不会下单。不填写则不启用此限制", "maxPositionValuePlaceholder": "例如:100(可选,不填写表示不启用)", - "maxPositionCount": "最大仓位数量", - "maxPositionCountTooltip": "限制单个市场的最大仓位数量。如果该市场的当前仓位数量达到或超过此限制,则不会下单。不填写则不启用此限制", - "maxPositionCountPlaceholder": "例如:10(可选,不填写表示不启用)", "supportSell": "跟单卖出", "supportSellTooltip": "是否跟单 Leader 的卖出订单。开启:跟单 Leader 的买入和卖出订单;关闭:只跟单 Leader 的买入订单,忽略卖出订单。", "pushFilteredOrders": "推送已过滤订单", @@ -806,9 +803,6 @@ "maxPositionValue": "最大仓位金额 (USDC)", "maxPositionValueTooltip": "限制单个市场的最大仓位金额。如果该市场的当前仓位金额 + 跟单金额超过此限制,则不会下单。不填写则不启用此限制", "maxPositionValuePlaceholder": "例如:100(可选,不填写表示不启用)", - "maxPositionCount": "最大仓位数量", - "maxPositionCountTooltip": "限制单个市场的最大仓位数量。如果该市场的当前仓位数量达到或超过此限制,则不会下单。不填写则不启用此限制", - "maxPositionCountPlaceholder": "例如:10(可选,不填写表示不启用)", "keywordFilter": "关键字过滤", "keywordFilterMode": "过滤模式", "keywordFilterModeTooltip": "选择关键字过滤模式。白名单:只跟单包含关键字的市场;黑名单:不跟单包含关键字的市场;不启用:不进行关键字过滤。关键字匹配不区分大小写。", @@ -919,9 +913,6 @@ "maxPositionValue": "最大仓位金额 (USDC)", "maxPositionValueTooltip": "限制单个市场的最大仓位金额。如果该市场的当前仓位金额 + 跟单金额超过此限制,则不会下单。不填写则不启用此限制", "maxPositionValuePlaceholder": "例如:100(可选,不填写表示不启用)", - "maxPositionCount": "最大仓位数量", - "maxPositionCountTooltip": "限制单个市场的最大仓位数量。如果该市场的当前仓位数量达到或超过此限制,则不会下单。不填写则不启用此限制", - "maxPositionCountPlaceholder": "例如:10(可选,不填写表示不启用)", "keywordFilter": "关键字过滤", "keywordFilterMode": "过滤模式", "keywordFilterModeTooltip": "选择关键字过滤模式。白名单:只跟单包含关键字的市场;黑名单:不跟单包含关键字的市场;不启用:不进行关键字过滤。关键字匹配不区分大小写。", @@ -972,7 +963,6 @@ "orderbookEmpty": "订单簿为空", "priceRange": "价格区间不符", "maxPositionValue": "超过最大仓位金额", - "maxPositionCount": "超过最大仓位数量", "marketEndDate": "市场截止时间超出限制", "unknown": "未知原因" }, diff --git a/frontend/src/locales/zh-TW/common.json b/frontend/src/locales/zh-TW/common.json index ced40b1..bb660a6 100644 --- a/frontend/src/locales/zh-TW/common.json +++ b/frontend/src/locales/zh-TW/common.json @@ -718,9 +718,6 @@ "maxPositionValue": "最大倉位金額 (USDC)", "maxPositionValueTooltip": "限制單個市場的最大倉位金額。如果該市場的當前倉位金額 + 跟單金額超過此限制,則不會下單。不填寫則不啟用此限制", "maxPositionValuePlaceholder": "例如:100(可選,不填寫表示不啟用)", - "maxPositionCount": "最大倉位數量", - "maxPositionCountTooltip": "限制單個市場的最大倉位數量。如果該市場的當前倉位數量達到或超過此限制,則不會下單。不填寫則不啟用此限制", - "maxPositionCountPlaceholder": "例如:10(可選,不填寫表示不啟用)", "supportSell": "跟單賣出", "supportSellTooltip": "是否跟單 Leader 的賣出訂單。開啟:跟單 Leader 的買入和賣出訂單;關閉:只跟單 Leader 的買入訂單,忽略賣出訂單。", "pushFilteredOrders": "推送已過濾訂單", @@ -792,9 +789,6 @@ "maxPositionValue": "最大倉位金額 (USDC)", "maxPositionValueTooltip": "限制單個市場的最大倉位金額。如果該市場的當前倉位金額 + 跟單金額超過此限制,則不會下單。不填寫則不啟用此限制", "maxPositionValuePlaceholder": "例如:100(可選,不填寫表示不啟用)", - "maxPositionCount": "最大倉位數量", - "maxPositionCountTooltip": "限制單個市場的最大倉位數量。如果該市場的當前倉位數量達到或超過此限制,則不會下單。不填寫則不啟用此限制", - "maxPositionCountPlaceholder": "例如:10(可選,不填寫表示不啟用)", "keywordFilter": "關鍵字過濾", "keywordFilterMode": "過濾模式", "keywordFilterModeTooltip": "選擇關鍵字過濾模式。白名單:只跟單包含關鍵字的市場;黑名單:不跟單包含關鍵字的市場;不啟用:不進行關鍵字過濾。關鍵字匹配不區分大小寫。", @@ -905,9 +899,6 @@ "maxPositionValue": "最大倉位金額 (USDC)", "maxPositionValueTooltip": "限制單個市場的最大倉位金額。如果該市場的當前倉位金額 + 跟單金額超過此限制,則不會下單。不填寫則不啟用此限制", "maxPositionValuePlaceholder": "例如:100(可選,不填寫表示不啟用)", - "maxPositionCount": "最大倉位數量", - "maxPositionCountTooltip": "限制單個市場的最大倉位數量。如果該市場的當前倉位數量達到或超過此限制,則不會下單。不填寫則不啟用此限制", - "maxPositionCountPlaceholder": "例如:10(可選,不填寫表示不啟用)", "keywordFilter": "關鍵字過濾", "keywordFilterMode": "過濾模式", "keywordFilterModeTooltip": "選擇關鍵字過濾模式。白名單:只跟單包含關鍵字的市場;黑名單:不跟單包含關鍵字的市場;不啟用:不進行關鍵字過濾。關鍵字匹配不區分大小寫。", @@ -972,7 +963,6 @@ "orderbookEmpty": "訂單簿為空", "priceRange": "價格區間不符", "maxPositionValue": "超過最大倉位金額", - "maxPositionCount": "超過最大倉位數量", "marketEndDate": "市場截止時間超出限制", "unknown": "未知原因" }, diff --git a/frontend/src/pages/CopyTradingOrders/AddModal.tsx b/frontend/src/pages/CopyTradingOrders/AddModal.tsx index be4af55..099f97d 100644 --- a/frontend/src/pages/CopyTradingOrders/AddModal.tsx +++ b/frontend/src/pages/CopyTradingOrders/AddModal.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState, useRef } from 'react' -import { Modal, Form, Button, Switch, message, Space, Radio, InputNumber, Table, Select, Divider, Input, Tag, InputRef, Card, Row, Col, Statistic } from 'antd' +import { Modal, Form, Button, Switch, message, Space, Radio, InputNumber, Table, Select, Divider, Input, Tag, InputRef, Card, Row, Col, Statistic, Spin } from 'antd' import { SaveOutlined, FileTextOutlined, PlusOutlined } from '@ant-design/icons' import { apiService } from '../../services/api' import { useAccountStore } from '../../store/accountStore' @@ -122,7 +122,6 @@ const AddModal: React.FC = ({ minPrice: template.minPrice ? parseFloat(template.minPrice) : undefined, maxPrice: template.maxPrice ? parseFloat(template.maxPrice) : undefined, maxPositionValue: (template as any).maxPositionValue ? parseFloat((template as any).maxPositionValue) : undefined, - maxPositionCount: (template as any).maxPositionCount, pushFilteredOrders: template.pushFilteredOrders ?? false }) setCopyMode(template.copyMode) @@ -277,7 +276,6 @@ const AddModal: React.FC = ({ minPrice: values.minPrice?.toString(), maxPrice: values.maxPrice?.toString(), maxPositionValue: values.maxPositionValue?.toString(), - maxPositionCount: values.maxPositionCount, keywordFilterMode: values.keywordFilterMode || 'DISABLED', keywords: (values.keywordFilterMode === 'WHITELIST' || values.keywordFilterMode === 'BLACKLIST') ? keywords @@ -800,19 +798,6 @@ const AddModal: React.FC = ({ /> - - - - {t('copyTradingAdd.keywordFilter') || '关键字过滤'} = ({ minPrice: found.minPrice ? parseFloat(found.minPrice) : undefined, maxPrice: found.maxPrice ? parseFloat(found.maxPrice) : undefined, maxPositionValue: found.maxPositionValue ? parseFloat(found.maxPositionValue) : undefined, - maxPositionCount: found.maxPositionCount, keywordFilterMode: found.keywordFilterMode || 'DISABLED', configName: found.configName || '', pushFailedOrders: found.pushFailedOrders ?? false, @@ -237,8 +236,6 @@ const EditModal: React.FC = ({ minPrice: values.minPrice != null ? values.minPrice.toString() : '', maxPrice: values.maxPrice != null ? values.maxPrice.toString() : '', maxPositionValue: values.maxPositionValue != null ? values.maxPositionValue.toString() : '', - // 对于 maxPositionCount,如果值为 null/undefined,传 -1 表示要清空(后端会识别并设置为 null) - maxPositionCount: values.maxPositionCount != null ? values.maxPositionCount : -1, keywordFilterMode: values.keywordFilterMode || 'DISABLED', keywords: (values.keywordFilterMode === 'WHITELIST' || values.keywordFilterMode === 'BLACKLIST') ? keywords @@ -722,19 +719,6 @@ const EditModal: React.FC = ({ /> - - - - {/* 关键字过滤 */} {t('copyTradingEdit.keywordFilter') || t('copyTradingAdd.keywordFilter') || '关键字过滤'} diff --git a/frontend/src/pages/CopyTradingOrders/FilteredOrdersModal.tsx b/frontend/src/pages/CopyTradingOrders/FilteredOrdersModal.tsx index fd7b6b8..cc6f6fb 100644 --- a/frontend/src/pages/CopyTradingOrders/FilteredOrdersModal.tsx +++ b/frontend/src/pages/CopyTradingOrders/FilteredOrdersModal.tsx @@ -69,7 +69,6 @@ const FilteredOrdersModal: React.FC = ({ ORDERBOOK_EMPTY: { color: 'default', text: t('filteredOrdersList.filterTypes.orderbookEmpty') || '订单簿为空' }, PRICE_RANGE: { color: 'purple', text: t('filteredOrdersList.filterTypes.priceRange') || '价格区间不符' }, MAX_POSITION_VALUE: { color: 'volcano', text: t('filteredOrdersList.filterTypes.maxPositionValue') || '超过最大仓位金额' }, - MAX_POSITION_COUNT: { color: 'volcano', text: t('filteredOrdersList.filterTypes.maxPositionCount') || '超过最大仓位数量' }, MARKET_END_DATE: { color: 'cyan', text: t('filteredOrdersList.filterTypes.marketEndDate') || '市场截止时间超出限制' }, KEYWORD_FILTER: { color: 'geekblue', text: t('filteredOrdersList.filterTypes.keywordFilter') || '关键字过滤' } } diff --git a/frontend/src/pages/FilteredOrdersList.tsx b/frontend/src/pages/FilteredOrdersList.tsx index 9880297..7108106 100644 --- a/frontend/src/pages/FilteredOrdersList.tsx +++ b/frontend/src/pages/FilteredOrdersList.tsx @@ -66,7 +66,6 @@ const FilteredOrdersList: React.FC = () => { 'ORDERBOOK_EMPTY': { color: 'default', label: t('filteredOrdersList.filterTypes.orderbookEmpty') || '订单簿为空' }, 'PRICE_RANGE': { color: 'purple', label: t('filteredOrdersList.filterTypes.priceRange') || '价格区间不符' }, 'MAX_POSITION_VALUE': { color: 'volcano', label: t('filteredOrdersList.filterTypes.maxPositionValue') || '超过最大仓位金额' }, - 'MAX_POSITION_COUNT': { color: 'volcano', label: t('filteredOrdersList.filterTypes.maxPositionCount') || '超过最大仓位数量' }, 'MARKET_END_DATE': { color: 'cyan', label: t('filteredOrdersList.filterTypes.marketEndDate') || '市场截止时间超出限制' }, 'KEYWORD_FILTER': { color: 'geekblue', label: t('filteredOrdersList.filterTypes.keywordFilter') || '关键字过滤' }, 'UNKNOWN': { color: 'default', label: t('filteredOrdersList.filterTypes.unknown') || '未知原因' } diff --git a/frontend/src/pages/LeaderList.tsx b/frontend/src/pages/LeaderList.tsx index 50dd5e6..f9a79c1 100644 --- a/frontend/src/pages/LeaderList.tsx +++ b/frontend/src/pages/LeaderList.tsx @@ -266,7 +266,7 @@ const LeaderList: React.FC = () => { title: t('common.actions'), key: 'action', width: isMobile ? 180 : 250, - fixed: 'right', + fixed: 'right' as const, render: (_: any, record: Leader) => (