This commit is contained in:
aaron 2026-03-29 18:17:45 +08:00
parent 09df00091e
commit b7858fd85f

View File

@ -391,7 +391,12 @@
<p>暂无历史订单</p> <p>暂无历史订单</p>
</div> </div>
<div v-else> <div v-else-if="currentTab === 'stats'" class="empty-state">
<p>暂无统计数据</p>
</div>
<!-- Open Positions Table -->
<div v-if="currentTab === 'positions'" class="table-container">
<!-- Open Positions Table --> <!-- Open Positions Table -->
<div v-if="currentTab === 'positions'" class="table-container"> <div v-if="currentTab === 'positions'" class="table-container">
<table> <table>
@ -437,7 +442,7 @@
</div> </div>
<!-- Pending Orders Table --> <!-- Pending Orders Table -->
<div v-else-if="currentTab === 'pending'" class="table-container"> <div v-if="currentTab === 'pending'" class="table-container">
<table> <table>
<thead> <thead>
<tr> <tr>
@ -475,7 +480,7 @@
</div> </div>
<!-- Order History Table --> <!-- Order History Table -->
<div v-else class="table-container"> <div v-if="currentTab === 'history'" class="table-container">
<table> <table>
<thead> <thead>
<tr> <tr>
@ -686,7 +691,8 @@
await Promise.all([ await Promise.all([
this.fetchAccountStatus(), this.fetchAccountStatus(),
this.fetchStatistics(), this.fetchStatistics(),
this.fetchOrders() this.fetchOrders(),
this.fetchLatestPrices()
]); ]);
} catch (e) { } catch (e) {
console.error('刷新数据失败:', e); console.error('刷新数据失败:', e);
@ -700,13 +706,25 @@
await Promise.all([ await Promise.all([
this.fetchAccountStatus(), this.fetchAccountStatus(),
this.fetchStatistics(), this.fetchStatistics(),
this.fetchOrders() this.fetchOrders(),
this.fetchLatestPrices()
]); ]);
} catch (e) { } catch (e) {
console.error('静默刷新失败:', e); console.error('静默刷新失败:', e);
} }
}, },
async fetchLatestPrices() {
try {
const response = await axios.get('/monitor/status');
if (response.data.success && response.data.latest_prices) {
this.latestPrices = response.data.latest_prices;
}
} catch (error) {
console.error('获取实时价格失败:', error);
}
},
async fetchAccountStatus() { async fetchAccountStatus() {
try { try {
const response = await axios.get('/api/trading/account'); const response = await axios.get('/api/trading/account');
@ -735,10 +753,6 @@
console.log('API Response:', response.data); console.log('API Response:', response.data);
if (response.data.success) { if (response.data.success) {
this.orders = response.data.orders || []; this.orders = response.data.orders || [];
// 获取实时价格
if (response.data.latest_prices) {
this.latestPrices = response.data.latest_prices;
}
console.log('Orders loaded:', this.orders.length); console.log('Orders loaded:', this.orders.length);
console.log('Orders data:', this.orders); console.log('Orders data:', this.orders);
console.log('Open positions:', this.orders.filter(o => o.status === 'open')); console.log('Open positions:', this.orders.filter(o => o.status === 'open'));