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: '账户名',