update
This commit is contained in:
parent
ba45ccd712
commit
eb5edf919c
@ -421,6 +421,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-danger btn-small" @click="closeOrder(order)">平仓</button>
|
<button class="btn btn-danger btn-small" @click="closeOrder(order)">平仓</button>
|
||||||
|
<button v-if="adminMode" class="btn btn-secondary btn-small" @click="deleteOrder(order)" style="margin-left: 4px;">删除</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -479,6 +480,7 @@
|
|||||||
<th>收益率</th>
|
<th>收益率</th>
|
||||||
<th>状态</th>
|
<th>状态</th>
|
||||||
<th>时间</th>
|
<th>时间</th>
|
||||||
|
<th v-if="adminMode">操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -504,6 +506,9 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ formatTime(order.closed_at) }}</td>
|
<td>{{ formatTime(order.closed_at) }}</td>
|
||||||
|
<td v-if="adminMode">
|
||||||
|
<button class="btn btn-danger btn-small" @click="deleteOrder(order)">删除</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -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() {
|
async resetAccount() {
|
||||||
if (!confirm('确定要重置账户吗?这将清除所有持仓和订单!')) return;
|
if (!confirm('确定要重置账户吗?这将清除所有持仓和订单!')) return;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user