diff --git a/src/views/trade/components/orders-panel.vue b/src/views/trade/components/orders-panel.vue index 2eecdce..0814be4 100644 --- a/src/views/trade/components/orders-panel.vue +++ b/src/views/trade/components/orders-panel.vue @@ -1,198 +1,110 @@ - + + + + + {{ item.side === 'buy' ? '买入' : '卖出' }} + + {{ item.symbol }} + + {{ getStatusConfig(item.status).text }} + + + + 撤单 + + + + + > + + + + + + + + > + + + + + + + - - - - - - {{ activeTab === 'current' ? '暂无当前委托' : '暂无历史记录' }} - - - - - - - - - {{ order.side === 'buy' ? '买入' : '卖出' }} - - {{ order.symbol }} - - {{ getStatusText(order.status) }} - - - - 撤单 - - - - - - {{ order.type === 'limit' ? '价格' : '市价' }} - {{ order.type === 'limit' ? order.price : '-' }} - - - 数量 - {{ order.amount }} - - - 成交 - {{ order.filled }} - - - 总额 - {{ order.total }} USDT - - - - - {{ order.time }} - - - - diff --git a/src/views/trade/config.ts b/src/views/trade/config.ts index 8446e7f..f9b71a0 100644 --- a/src/views/trade/config.ts +++ b/src/views/trade/config.ts @@ -53,3 +53,39 @@ export const confirmOrderSubmitSchema = confirmOrderSchema.transform(data => ({ quantity: data.quantity.toString(), price: data.price?.toString() ?? "", })); + +export enum OrderStatusEnum { + PENDING = "pending", + OPEN = "open", + PARTIALLY_FILLED = "partially_filled", + FILLED = "filled", + CANCELED = "canceled", + REJECTED = "rejected", +} + +export const orderStatusMap = { + [OrderStatusEnum.PENDING]: { + color: "warning", + text: "待处理", + }, + [OrderStatusEnum.OPEN]: { + color: "primary", + text: "已挂单", + }, + [OrderStatusEnum.PARTIALLY_FILLED]: { + color: "tertiary", + text: "部分成交", + }, + [OrderStatusEnum.FILLED]: { + color: "success", + text: "已完成", + }, + [OrderStatusEnum.CANCELED]: { + color: "medium", + text: "已取消", + }, + [OrderStatusEnum.REJECTED]: { + color: "danger", + text: "已拒绝", + }, +};