From 46f8d918db3c0442d4db79973257e7467c037b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8?= Date: Wed, 27 May 2026 14:53:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=81=9A=E5=B8=82=E5=95=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/mqttClient.ts | 12 +++++------ src/views/order/history/index.vue | 2 +- src/views/order/history/options.ts | 32 +++++++++++++++--------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/utils/mqttClient.ts b/src/utils/mqttClient.ts index e718d29..3f7c76b 100644 --- a/src/utils/mqttClient.ts +++ b/src/utils/mqttClient.ts @@ -99,7 +99,10 @@ class MQTTClient { * 重连事件 * 触发时机:连接断开,客户端尝试自动重连时 */ - this.client.on('reconnect', () => { + this.client.on('reconnect',async () => { + const foreignDeviceNo = sessionStorage.getItem('foreign_device_no') || '' + const mqttKey = await initMqttKeyApi({ device_no: foreignDeviceNo }) + console.log("initMqttKey result:", mqttKey) console.log('🔄 MQTT 正在重连...') }) @@ -107,13 +110,10 @@ class MQTTClient { * 连接关闭事件 * 触发时机:连接被关闭(网络断开、手动断开、服务器踢出) */ - this.client.on('close', async () => { + this.client.on('close', () => { console.log('🔌 MQTT 连接关闭') this.isConnected = false - - const foreignDeviceNo = sessionStorage.getItem('foreign_device_no') || '' - const mqttKey = await initMqttKeyApi({ device_no: foreignDeviceNo }) - console.log("initMqttKey result:", mqttKey) + }) // 返回客户端实例,便于链式调用或外部访问 diff --git a/src/views/order/history/index.vue b/src/views/order/history/index.vue index e6fe7e5..0387e0a 100644 --- a/src/views/order/history/index.vue +++ b/src/views/order/history/index.vue @@ -165,7 +165,7 @@ const handleSearch = () => { const handleReset = () => { searchForm.value = { accountName: '', - orderId: '', + orderId: '2', tradeType: '', dateRange: [initTime.start, initTime.end], subAccountName: '', diff --git a/src/views/order/history/options.ts b/src/views/order/history/options.ts index fd91fd5..b7c647a 100644 --- a/src/views/order/history/options.ts +++ b/src/views/order/history/options.ts @@ -3,22 +3,22 @@ */ export const search = [ // 订单类型 - { - label: '订单', - prop: 'orderId', - type: 'select' as const, - options: [ - { - label: '持仓订单', - value: '1' - }, - { - label: '交易订单', - value: '2' - }, - ], - width: '140px' - }, + // { + // label: '订单', + // prop: 'orderId', + // type: 'select' as const, + // options: [ + // { + // label: '持仓订单', + // value: '1' + // }, + // { + // label: '交易订单', + // value: '2' + // }, + // ], + // width: '140px' + // }, // 账户名 { label: '账户名',