1
This commit is contained in:
parent
09df00091e
commit
b7858fd85f
@ -391,7 +391,12 @@
|
||||
<p>暂无历史订单</p>
|
||||
</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 -->
|
||||
<div v-if="currentTab === 'positions'" class="table-container">
|
||||
<table>
|
||||
@ -437,7 +442,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Pending Orders Table -->
|
||||
<div v-else-if="currentTab === 'pending'" class="table-container">
|
||||
<div v-if="currentTab === 'pending'" class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -475,7 +480,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Order History Table -->
|
||||
<div v-else class="table-container">
|
||||
<div v-if="currentTab === 'history'" class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -686,7 +691,8 @@
|
||||
await Promise.all([
|
||||
this.fetchAccountStatus(),
|
||||
this.fetchStatistics(),
|
||||
this.fetchOrders()
|
||||
this.fetchOrders(),
|
||||
this.fetchLatestPrices()
|
||||
]);
|
||||
} catch (e) {
|
||||
console.error('刷新数据失败:', e);
|
||||
@ -700,13 +706,25 @@
|
||||
await Promise.all([
|
||||
this.fetchAccountStatus(),
|
||||
this.fetchStatistics(),
|
||||
this.fetchOrders()
|
||||
this.fetchOrders(),
|
||||
this.fetchLatestPrices()
|
||||
]);
|
||||
} catch (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() {
|
||||
try {
|
||||
const response = await axios.get('/api/trading/account');
|
||||
@ -735,10 +753,6 @@
|
||||
console.log('API Response:', response.data);
|
||||
if (response.data.success) {
|
||||
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 data:', this.orders);
|
||||
console.log('Open positions:', this.orders.filter(o => o.status === 'open'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user