feat: 实现跟单筛选条件记录和展示功能
- 新增 FilteredOrder 实体和数据库表,记录被过滤的订单信息 - 在筛选失败时自动记录到数据库并发送 Telegram 通知 - 创建 FilteredOrderService 和 API 接口,支持查询被过滤订单列表 - 前端新增被过滤订单列表页面,支持按过滤类型筛选 - 修复价差计算逻辑,使用数组最大值和最小值而非第一个元素 - 优化编辑页面 UI,钱包和 Leader 显示与创建页面一致(只读) - 添加多语言支持(中文、繁体中文、英文)
This commit is contained in:
@@ -1,24 +1,26 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Card, Form, Button, Select, Switch, message, Typography, Space } from 'antd'
|
||||
import { ArrowLeftOutlined, SaveOutlined } from '@ant-design/icons'
|
||||
import { Card, Form, Button, Switch, message, Typography, Space, Radio, InputNumber, Modal, Table, Select, Divider } from 'antd'
|
||||
import { ArrowLeftOutlined, SaveOutlined, FileTextOutlined } from '@ant-design/icons'
|
||||
import { apiService } from '../services/api'
|
||||
import { useAccountStore } from '../store/accountStore'
|
||||
import type { Leader, CopyTradingTemplate } from '../types'
|
||||
import { useMediaQuery } from 'react-responsive'
|
||||
import type { Leader, CopyTradingTemplate, CopyTradingCreateRequest } from '../types'
|
||||
import { formatUSDC } from '../utils'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const { Title } = Typography
|
||||
const { Option } = Select
|
||||
|
||||
const CopyTradingAdd: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
useMediaQuery({ maxWidth: 768 }) // 用于响应式布局,但当前页面未使用
|
||||
const { accounts, fetchAccounts } = useAccountStore()
|
||||
const [form] = Form.useForm()
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [leaders, setLeaders] = useState<Leader[]>([])
|
||||
const [templates, setTemplates] = useState<CopyTradingTemplate[]>([])
|
||||
const [templateModalVisible, setTemplateModalVisible] = useState(false)
|
||||
const [copyMode, setCopyMode] = useState<'RATIO' | 'FIXED'>('RATIO')
|
||||
|
||||
useEffect(() => {
|
||||
fetchAccounts()
|
||||
@@ -33,7 +35,7 @@ const CopyTradingAdd: React.FC = () => {
|
||||
setLeaders(response.data.data.list || [])
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '获取 Leader 列表失败')
|
||||
message.error(error.message || t('copyTradingAdd.fetchLeaderFailed') || '获取 Leader 列表失败')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,28 +46,83 @@ const CopyTradingAdd: React.FC = () => {
|
||||
setTemplates(response.data.data.list || [])
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '获取模板列表失败')
|
||||
message.error(error.message || t('copyTradingAdd.fetchTemplateFailed') || '获取模板列表失败')
|
||||
}
|
||||
}
|
||||
|
||||
const handleSelectTemplate = (template: CopyTradingTemplate) => {
|
||||
// 填充模板数据到表单(只填充模板中存在的字段)
|
||||
form.setFieldsValue({
|
||||
copyMode: template.copyMode,
|
||||
copyRatio: template.copyRatio ? parseFloat(template.copyRatio) * 100 : 100, // 转换为百分比显示
|
||||
fixedAmount: template.fixedAmount ? parseFloat(template.fixedAmount) : undefined,
|
||||
maxOrderSize: template.maxOrderSize ? parseFloat(template.maxOrderSize) : undefined,
|
||||
minOrderSize: template.minOrderSize ? parseFloat(template.minOrderSize) : undefined,
|
||||
maxDailyOrders: template.maxDailyOrders,
|
||||
priceTolerance: template.priceTolerance ? parseFloat(template.priceTolerance) : undefined,
|
||||
supportSell: template.supportSell,
|
||||
minOrderDepth: template.minOrderDepth ? parseFloat(template.minOrderDepth) : undefined,
|
||||
maxSpread: template.maxSpread ? parseFloat(template.maxSpread) : undefined,
|
||||
minOrderbookDepth: template.minOrderbookDepth ? parseFloat(template.minOrderbookDepth) : undefined
|
||||
})
|
||||
setCopyMode(template.copyMode)
|
||||
setTemplateModalVisible(false)
|
||||
message.success(t('copyTradingAdd.templateFilled') || '模板内容已填充,您可以修改')
|
||||
}
|
||||
|
||||
const handleCopyModeChange = (mode: 'RATIO' | 'FIXED') => {
|
||||
setCopyMode(mode)
|
||||
}
|
||||
|
||||
const handleSubmit = async (values: any) => {
|
||||
// 前端校验
|
||||
if (values.copyMode === 'FIXED') {
|
||||
if (!values.fixedAmount || Number(values.fixedAmount) < 1) {
|
||||
message.error(t('copyTradingAdd.fixedAmountMin') || '固定金额必须 >= 1')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (values.copyMode === 'RATIO' && values.minOrderSize !== undefined && values.minOrderSize !== null && Number(values.minOrderSize) < 1) {
|
||||
message.error(t('copyTradingAdd.minOrderSizeMin') || '最小金额必须 >= 1')
|
||||
return
|
||||
}
|
||||
|
||||
setLoading(true)
|
||||
try {
|
||||
const response = await apiService.copyTrading.create({
|
||||
const request: CopyTradingCreateRequest = {
|
||||
accountId: values.accountId,
|
||||
templateId: values.templateId,
|
||||
leaderId: values.leaderId,
|
||||
enabled: values.enabled !== false
|
||||
})
|
||||
enabled: true, // 默认启用
|
||||
copyMode: values.copyMode || 'RATIO',
|
||||
copyRatio: values.copyMode === 'RATIO' && values.copyRatio ? (values.copyRatio / 100).toString() : undefined,
|
||||
fixedAmount: values.copyMode === 'FIXED' ? values.fixedAmount?.toString() : undefined,
|
||||
maxOrderSize: values.maxOrderSize?.toString(),
|
||||
minOrderSize: values.minOrderSize?.toString(),
|
||||
maxDailyLoss: values.maxDailyLoss?.toString(),
|
||||
maxDailyOrders: values.maxDailyOrders,
|
||||
priceTolerance: values.priceTolerance?.toString(),
|
||||
delaySeconds: values.delaySeconds,
|
||||
pollIntervalSeconds: values.pollIntervalSeconds,
|
||||
useWebSocket: values.useWebSocket,
|
||||
websocketReconnectInterval: values.websocketReconnectInterval,
|
||||
websocketMaxRetries: values.websocketMaxRetries,
|
||||
supportSell: values.supportSell !== false,
|
||||
minOrderDepth: values.minOrderDepth?.toString(),
|
||||
maxSpread: values.maxSpread?.toString(),
|
||||
minOrderbookDepth: values.minOrderbookDepth?.toString()
|
||||
}
|
||||
|
||||
const response = await apiService.copyTrading.create(request)
|
||||
|
||||
if (response.data.code === 0) {
|
||||
message.success('创建跟单成功')
|
||||
message.success(t('copyTradingAdd.createSuccess') || '创建跟单配置成功')
|
||||
navigate('/copy-trading')
|
||||
} else {
|
||||
message.error(response.data.msg || '创建跟单失败')
|
||||
message.error(response.data.msg || t('copyTradingAdd.createFailed') || '创建跟单配置失败')
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '创建跟单失败')
|
||||
message.error(error.message || t('copyTradingAdd.createFailed') || '创建跟单配置失败')
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
@@ -78,27 +135,40 @@ const CopyTradingAdd: React.FC = () => {
|
||||
icon={<ArrowLeftOutlined />}
|
||||
onClick={() => navigate('/copy-trading')}
|
||||
>
|
||||
返回
|
||||
{t('common.back') || '返回'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<Title level={4}>新增跟单</Title>
|
||||
<Title level={4}>{t('copyTradingAdd.title') || '新增跟单配置'}</Title>
|
||||
|
||||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
onFinish={handleSubmit}
|
||||
initialValues={{
|
||||
enabled: true
|
||||
copyMode: 'RATIO',
|
||||
copyRatio: 100,
|
||||
maxOrderSize: 1000,
|
||||
minOrderSize: 1,
|
||||
maxDailyLoss: 10000,
|
||||
maxDailyOrders: 100,
|
||||
priceTolerance: 5,
|
||||
delaySeconds: 0,
|
||||
pollIntervalSeconds: 5,
|
||||
useWebSocket: true,
|
||||
websocketReconnectInterval: 5000,
|
||||
websocketMaxRetries: 10,
|
||||
supportSell: true
|
||||
}}
|
||||
>
|
||||
{/* 基础信息 */}
|
||||
<Form.Item
|
||||
label="选择钱包"
|
||||
label={t('copyTradingAdd.selectWallet') || '选择钱包'}
|
||||
name="accountId"
|
||||
rules={[{ required: true, message: '请选择钱包' }]}
|
||||
rules={[{ required: true, message: t('copyTradingAdd.walletRequired') || '请选择钱包' }]}
|
||||
>
|
||||
<Select placeholder="请选择钱包">
|
||||
<Select placeholder={t('copyTradingAdd.selectWalletPlaceholder') || '请选择钱包'}>
|
||||
{accounts.map(account => (
|
||||
<Option key={account.id} value={account.id}>
|
||||
{account.accountName || `账户 ${account.id}`} ({account.walletAddress.slice(0, 6)}...{account.walletAddress.slice(-4)})
|
||||
@@ -108,25 +178,11 @@ const CopyTradingAdd: React.FC = () => {
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="选择模板"
|
||||
name="templateId"
|
||||
rules={[{ required: true, message: '请选择模板' }]}
|
||||
>
|
||||
<Select placeholder="请选择模板">
|
||||
{templates.map(template => (
|
||||
<Option key={template.id} value={template.id}>
|
||||
{template.templateName} ({template.copyMode === 'RATIO' ? `比例 ${template.copyRatio}x` : `固定 ${template.fixedAmount ? formatUSDC(template.fixedAmount) : '0.0000'} USDC`})
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="选择 Leader"
|
||||
label={t('copyTradingAdd.selectLeader') || '选择 Leader'}
|
||||
name="leaderId"
|
||||
rules={[{ required: true, message: '请选择 Leader' }]}
|
||||
rules={[{ required: true, message: t('copyTradingAdd.leaderRequired') || '请选择 Leader' }]}
|
||||
>
|
||||
<Select placeholder="请选择 Leader">
|
||||
<Select placeholder={t('copyTradingAdd.selectLeaderPlaceholder') || '请选择 Leader'}>
|
||||
{leaders.map(leader => (
|
||||
<Option key={leader.id} value={leader.id}>
|
||||
{leader.leaderName || `Leader ${leader.id}`} ({leader.leaderAddress.slice(0, 6)}...{leader.leaderAddress.slice(-4)})
|
||||
@@ -135,12 +191,231 @@ const CopyTradingAdd: React.FC = () => {
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
{/* 模板填充按钮 */}
|
||||
<Form.Item>
|
||||
<Button
|
||||
type="dashed"
|
||||
icon={<FileTextOutlined />}
|
||||
onClick={() => setTemplateModalVisible(true)}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
{t('copyTradingAdd.selectTemplateFromModal') || '从模板填充配置'}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
|
||||
{/* 跟单金额模式 */}
|
||||
<Form.Item
|
||||
label="启用状态"
|
||||
name="enabled"
|
||||
label={t('copyTradingAdd.copyMode') || '跟单金额模式'}
|
||||
name="copyMode"
|
||||
tooltip={t('copyTradingAdd.copyModeTooltip') || '选择跟单金额的计算方式。比例模式:跟单金额随 Leader 订单大小按比例变化;固定金额模式:无论 Leader 订单大小如何,跟单金额都固定不变。'}
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Radio.Group onChange={(e) => handleCopyModeChange(e.target.value)}>
|
||||
<Radio value="RATIO">{t('copyTradingAdd.ratioMode') || '比例模式'}</Radio>
|
||||
<Radio value="FIXED">{t('copyTradingAdd.fixedAmountMode') || '固定金额模式'}</Radio>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
|
||||
{copyMode === 'RATIO' && (
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.copyRatio') || '跟单比例'}
|
||||
name="copyRatio"
|
||||
tooltip={t('copyTradingAdd.copyRatioTooltip') || '跟单比例表示跟单金额相对于 Leader 订单金额的百分比。例如:100% 表示 1:1 跟单,50% 表示半仓跟单,200% 表示双倍跟单'}
|
||||
>
|
||||
<InputNumber
|
||||
min={10}
|
||||
max={1000}
|
||||
step={1}
|
||||
precision={0}
|
||||
style={{ width: '100%' }}
|
||||
addonAfter="%"
|
||||
placeholder={t('copyTradingAdd.copyRatioPlaceholder') || '例如:100 表示 100%(1:1 跟单),默认 100%'}
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
{copyMode === 'FIXED' && (
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.fixedAmount') || '固定跟单金额 (USDC)'}
|
||||
name="fixedAmount"
|
||||
rules={[
|
||||
{ required: true, message: t('copyTradingAdd.fixedAmountRequired') || '请输入固定跟单金额' },
|
||||
{
|
||||
validator: (_, value) => {
|
||||
if (value !== undefined && value !== null && value !== '') {
|
||||
const amount = Number(value)
|
||||
if (isNaN(amount)) {
|
||||
return Promise.reject(new Error(t('copyTradingAdd.invalidNumber') || '请输入有效的数字'))
|
||||
}
|
||||
if (amount < 1) {
|
||||
return Promise.reject(new Error(t('copyTradingAdd.fixedAmountMin') || '固定金额必须 >= 1'))
|
||||
}
|
||||
}
|
||||
return Promise.resolve()
|
||||
}
|
||||
}
|
||||
]}
|
||||
>
|
||||
<InputNumber
|
||||
min={1}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.fixedAmountPlaceholder') || '固定金额,不随 Leader 订单大小变化,必须 >= 1'}
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
{copyMode === 'RATIO' && (
|
||||
<>
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.maxOrderSize') || '单笔订单最大金额 (USDC)'}
|
||||
name="maxOrderSize"
|
||||
tooltip={t('copyTradingAdd.maxOrderSizeTooltip') || '比例模式下,限制单笔跟单订单的最大金额上限'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0.0001}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.maxOrderSizePlaceholder') || '仅在比例模式下生效(可选)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.minOrderSize') || '单笔订单最小金额 (USDC)'}
|
||||
name="minOrderSize"
|
||||
tooltip={t('copyTradingAdd.minOrderSizeTooltip') || '比例模式下,限制单笔跟单订单的最小金额下限,必须 >= 1'}
|
||||
rules={[
|
||||
{
|
||||
validator: (_, value) => {
|
||||
if (value === undefined || value === null || value === '') {
|
||||
return Promise.resolve()
|
||||
}
|
||||
if (typeof value === 'number' && value < 1) {
|
||||
return Promise.reject(new Error(t('copyTradingAdd.minOrderSizeMin') || '最小金额必须 >= 1'))
|
||||
}
|
||||
return Promise.resolve()
|
||||
}
|
||||
}
|
||||
]}
|
||||
>
|
||||
<InputNumber
|
||||
min={1}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.minOrderSizePlaceholder') || '仅在比例模式下生效,必须 >= 1(可选)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.maxDailyLoss') || '每日最大亏损限制 (USDC)'}
|
||||
name="maxDailyLoss"
|
||||
tooltip={t('copyTradingAdd.maxDailyLossTooltip') || '限制每日最大亏损金额,用于风险控制'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.maxDailyLossPlaceholder') || '默认 10000 USDC(可选)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.maxDailyOrders') || '每日最大跟单订单数'}
|
||||
name="maxDailyOrders"
|
||||
tooltip={t('copyTradingAdd.maxDailyOrdersTooltip') || '限制每日最多跟单的订单数量'}
|
||||
>
|
||||
<InputNumber
|
||||
min={1}
|
||||
step={1}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.maxDailyOrdersPlaceholder') || '默认 100(可选)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.priceTolerance') || '价格容忍度 (%)'}
|
||||
name="priceTolerance"
|
||||
tooltip={t('copyTradingAdd.priceToleranceTooltip') || '允许跟单价格在 Leader 价格基础上的调整范围'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={100}
|
||||
step={0.1}
|
||||
precision={2}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.priceTolerancePlaceholder') || '默认 5%(可选)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.delaySeconds') || '跟单延迟 (秒)'}
|
||||
name="delaySeconds"
|
||||
tooltip={t('copyTradingAdd.delaySecondsTooltip') || '跟单延迟时间,0 表示立即跟单'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
step={1}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.delaySecondsPlaceholder') || '默认 0(立即跟单)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.minOrderDepth') || '最小订单深度 (USDC)'}
|
||||
name="minOrderDepth"
|
||||
tooltip={t('copyTradingAdd.minOrderDepthTooltip') || '最小订单深度(USDC金额),NULL表示不启用此过滤。确保市场有足够的流动性'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.minOrderDepthPlaceholder') || '例如:100(可选,不填写表示不启用)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.maxSpread') || '最大价差(绝对价格)'}
|
||||
name="maxSpread"
|
||||
tooltip={t('copyTradingAdd.maxSpreadTooltip') || '最大价差(绝对价格),NULL表示不启用此过滤。避免在价差过大的市场跟单'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.maxSpreadPlaceholder') || '例如:0.05(5美分,可选,不填写表示不启用)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.minOrderbookDepth') || '最小订单簿深度 (USDC)'}
|
||||
name="minOrderbookDepth"
|
||||
tooltip={t('copyTradingAdd.minOrderbookDepthTooltip') || '最小订单簿深度(USDC金额),NULL表示不启用此过滤。检查前 N 档的深度'}
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
step={0.0001}
|
||||
precision={4}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={t('copyTradingAdd.minOrderbookDepthPlaceholder') || '例如:50(可选,不填写表示不启用)'}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
{/* 跟单卖出 - 表单最底部 */}
|
||||
<Form.Item
|
||||
label={t('copyTradingAdd.supportSell') || '跟单卖出'}
|
||||
name="supportSell"
|
||||
tooltip={t('copyTradingAdd.supportSellTooltip') || '是否跟单 Leader 的卖出订单'}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch checkedChildren="开启" unCheckedChildren="停止" />
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
@@ -151,18 +426,61 @@ const CopyTradingAdd: React.FC = () => {
|
||||
icon={<SaveOutlined />}
|
||||
loading={loading}
|
||||
>
|
||||
创建跟单
|
||||
{t('copyTradingAdd.create') || '创建跟单配置'}
|
||||
</Button>
|
||||
<Button onClick={() => navigate('/copy-trading')}>
|
||||
取消
|
||||
{t('common.cancel') || '取消'}
|
||||
</Button>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Card>
|
||||
|
||||
{/* 模板选择 Modal */}
|
||||
<Modal
|
||||
title={t('copyTradingAdd.selectTemplate') || '选择模板'}
|
||||
open={templateModalVisible}
|
||||
onCancel={() => setTemplateModalVisible(false)}
|
||||
footer={null}
|
||||
width={800}
|
||||
>
|
||||
<Table
|
||||
dataSource={templates}
|
||||
rowKey="id"
|
||||
pagination={{ pageSize: 10 }}
|
||||
onRow={(record) => ({
|
||||
onClick: () => handleSelectTemplate(record),
|
||||
style: { cursor: 'pointer' }
|
||||
})}
|
||||
columns={[
|
||||
{
|
||||
title: t('copyTradingAdd.templateName') || '模板名称',
|
||||
dataIndex: 'templateName',
|
||||
key: 'templateName'
|
||||
},
|
||||
{
|
||||
title: t('copyTradingAdd.copyMode') || '跟单模式',
|
||||
key: 'copyMode',
|
||||
render: (_: any, record: CopyTradingTemplate) => (
|
||||
<span>
|
||||
{record.copyMode === 'RATIO'
|
||||
? `${t('copyTradingAdd.ratioMode') || '比例'} ${record.copyRatio}x`
|
||||
: `${t('copyTradingAdd.fixedAmountMode') || '固定'} ${formatUSDC(record.fixedAmount || '0')} USDC`
|
||||
}
|
||||
</span>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('copyTradingAdd.supportSell') || '跟单卖出',
|
||||
dataIndex: 'supportSell',
|
||||
key: 'supportSell',
|
||||
render: (supportSell: boolean) => supportSell ? (t('common.yes') || '是') : (t('common.no') || '否')
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default CopyTradingAdd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user