1
This commit is contained in:
parent
5a5ce5ada4
commit
a9f0aa0717
@ -448,9 +448,9 @@
|
||||
<div class="tabs">
|
||||
<button
|
||||
class="tab"
|
||||
:class="{ active: currentTab === 'active' }"
|
||||
@click="currentTab = 'active'">
|
||||
活跃订单 ({{ activeOrders.length }})
|
||||
:class="{ active: currentTab === 'positions' }"
|
||||
@click="currentTab = 'positions'">
|
||||
交易所持仓 ({{ exchangePositions.length }})
|
||||
</button>
|
||||
<button
|
||||
class="tab"
|
||||
@ -458,12 +458,6 @@
|
||||
@click="currentTab = 'history'">
|
||||
历史订单
|
||||
</button>
|
||||
<button
|
||||
class="tab"
|
||||
:class="{ active: currentTab === 'positions' }"
|
||||
@click="currentTab = 'positions'">
|
||||
交易所持仓
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 订单列表 -->
|
||||
@ -473,11 +467,11 @@
|
||||
<p style="margin-top: 12px;">加载中...</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="currentTab === 'active' && activeOrders.length === 0" class="empty-state">
|
||||
<div v-else-if="currentTab === 'positions' && exchangePositions.length === 0" class="empty-state">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
||||
</svg>
|
||||
<p>暂无活跃订单</p>
|
||||
<p>暂无持仓</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="currentTab === 'history' && historyOrders.length === 0" class="empty-state">
|
||||
@ -487,13 +481,6 @@
|
||||
<p>暂无历史订单</p>
|
||||
</div>
|
||||
|
||||
<div v-else-if="currentTab === 'positions' && exchangePositions.length === 0" class="empty-state">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
||||
</svg>
|
||||
<p>暂无持仓</p>
|
||||
</div>
|
||||
|
||||
<table class="orders-table" v-else>
|
||||
<thead>
|
||||
<tr v-if="currentTab === 'positions'">
|
||||
@ -596,7 +583,7 @@
|
||||
createApp({
|
||||
data() {
|
||||
return {
|
||||
currentTab: 'active',
|
||||
currentTab: 'positions',
|
||||
loading: false,
|
||||
serviceEnabled: false,
|
||||
apiConfigured: false,
|
||||
@ -608,7 +595,6 @@
|
||||
total_position_value: 0
|
||||
},
|
||||
stats: null,
|
||||
activeOrders: [],
|
||||
historyOrders: [],
|
||||
exchangePositions: [],
|
||||
autoRefreshInterval: null
|
||||
@ -616,7 +602,6 @@
|
||||
},
|
||||
computed: {
|
||||
displayOrders() {
|
||||
if (this.currentTab === 'active') return this.activeOrders;
|
||||
if (this.currentTab === 'history') return this.historyOrders;
|
||||
if (this.currentTab === 'positions') return this.exchangePositions;
|
||||
return [];
|
||||
@ -630,7 +615,6 @@
|
||||
this.fetchServiceStatus(),
|
||||
this.fetchAccountStatus(),
|
||||
this.fetchStats(),
|
||||
this.fetchActiveOrders(),
|
||||
this.fetchHistoryOrders(),
|
||||
this.fetchExchangePositions()
|
||||
]);
|
||||
@ -678,17 +662,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
async fetchActiveOrders() {
|
||||
try {
|
||||
const response = await axios.get('/api/real-trading/orders/active');
|
||||
if (response.data.success) {
|
||||
this.activeOrders = response.data.orders;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取活跃订单失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
async fetchHistoryOrders() {
|
||||
try {
|
||||
const response = await axios.get('/api/real-trading/orders?status=closed&limit=50');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user