From 6b99fdb41fec199ea8f825ee7d69a7ad74dfe9ed Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 29 Mar 2025 12:07:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E3=80=91IoT:=20=E5=9C=BA=E6=99=AF=E8=81=94=E5=8A=A8=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/device/index.ts | 11 ++++ src/api/iot/product/product/index.ts | 5 ++ .../components/action/ActionExecutor.vue | 62 ++++++++++++++++-- .../components/listener/DeviceListener.vue | 65 ++++++++++++++++++- 4 files changed, 136 insertions(+), 7 deletions(-) diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index 252ea433c..b32eaf642 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -165,5 +165,16 @@ export const DeviceApi = { // 获取设备MQTT连接参数 getMqttConnectionParams: async (deviceId: number) => { return await request.get({ url: `/iot/device/mqtt-connection-params`, params: { deviceId } }) + }, + + // 根据ProductKey和DeviceNames获取设备列表 + getDevicesByProductKeyAndNames: async (productKey: string, deviceNames: string[]) => { + return await request.get({ + url: `/iot/device/get-by-product-key-and-names`, + params: { + productKey, + deviceNames: deviceNames.join(',') + } + }) } } diff --git a/src/api/iot/product/product/index.ts b/src/api/iot/product/product/index.ts index 496fb049b..f03339d1a 100644 --- a/src/api/iot/product/product/index.ts +++ b/src/api/iot/product/product/index.ts @@ -78,5 +78,10 @@ export const ProductApi = { // 查询产品(精简)列表 getSimpleProductList() { return request.get({ url: '/iot/product/simple-list' }) + }, + + // 根据ProductKey获取产品信息 + getProductByKey: async (productKey: string) => { + return await request.get({ url: `/iot/product/get-by-key`, params: { productKey } }) } } diff --git a/src/views/iot/rule/scene/components/action/ActionExecutor.vue b/src/views/iot/rule/scene/components/action/ActionExecutor.vue index c4433b602..3d9e4d4ac 100644 --- a/src/views/iot/rule/scene/components/action/ActionExecutor.vue +++ b/src/views/iot/rule/scene/components/action/ActionExecutor.vue @@ -1,6 +1,6 @@