From eb5edf919c2ae7bb1ef6db8bb63c1791efa2c2df Mon Sep 17 00:00:00 2001 From: aaron <> Date: Sun, 29 Mar 2026 18:33:24 +0800 Subject: [PATCH] update --- frontend/trading.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/frontend/trading.html b/frontend/trading.html index 349f06d..d647bb6 100644 --- a/frontend/trading.html +++ b/frontend/trading.html @@ -421,6 +421,7 @@ + @@ -479,6 +480,7 @@ 收益率 状态 时间 + 操作 @@ -504,6 +506,9 @@ {{ formatTime(order.closed_at) }} + + + @@ -784,6 +789,23 @@ } }, + async deleteOrder(order) { + if (!confirm('确定要删除该订单吗?此操作不可恢复!')) return; + + try { + const response = await axios.delete(`/api/trading/orders/${order.order_id}`); + if (response.data.success) { + await this.refreshData(); + alert('订单删除成功'); + } else { + alert('删除失败: ' + (response.data.message || '未知错误')); + } + } catch (error) { + console.error('删除订单失败:', error); + alert('删除失败: ' + (error.response?.data?.detail || error.message)); + } + }, + async resetAccount() { if (!confirm('确定要重置账户吗?这将清除所有持仓和订单!')) return;