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;