From 2515caed35a015bdf1636c275f81e68d5d7f0ea4 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 22 Jan 2026 00:51:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(iot):=E3=80=90=E7=BD=91=E5=85=B3=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=EF=BC=9A20%=E3=80=91=E5=A2=9E=E5=8A=A0=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E8=AE=BE=E5=A4=87=E7=BB=91=E5=AE=9A=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=EF=BC=88=E6=9C=AA=E5=AE=8C=E6=88=90=EF=BC=89=EF=BC=8C=E5=9F=BA?= =?UTF-8?q?=E4=BA=8E=20breezy-doodling-starlight.md=20=E8=A7=84=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/device/index.ts | 26 +++ .../device/detail/DeviceDetailsSubDevice.vue | 210 ++++++++++++++++++ src/views/iot/device/device/detail/index.vue | 9 +- 3 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 src/views/iot/device/device/detail/DeviceDetailsSubDevice.vue diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index 1804628c..be5193c6 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -158,5 +158,31 @@ export const DeviceApi = { // 发送设备消息 sendDeviceMessage: async (params: IotDeviceMessageSendReqVO) => { return await request.post({ url: `/iot/device/message/send`, data: params }) + }, + + // 绑定子设备到网关 + bindDeviceGateway: async (data: { ids: number[]; gatewayId: number }) => { + return await request.put({ url: `/iot/device/bind-gateway`, data }) + }, + + // 解绑子设备与网关 + unbindDeviceGateway: async (data: { ids: number[] }) => { + return await request.put({ url: `/iot/device/unbind-gateway`, data }) + }, + + // 获取网关的子设备列表 + getSubDeviceList: async (gatewayId: number) => { + return await request.get({ + url: `/iot/device/sub-device-list`, + params: { gatewayId } + }) + }, + + // 获取可绑定到网关的子设备列表 + getBindableSubDeviceList: async (gatewayId?: number) => { + return await request.get({ + url: `/iot/device/bindable-sub-device-list`, + params: { gatewayId } + }) } } diff --git a/src/views/iot/device/device/detail/DeviceDetailsSubDevice.vue b/src/views/iot/device/device/detail/DeviceDetailsSubDevice.vue new file mode 100644 index 00000000..16a406c4 --- /dev/null +++ b/src/views/iot/device/device/detail/DeviceDetailsSubDevice.vue @@ -0,0 +1,210 @@ + + + + diff --git a/src/views/iot/device/device/detail/index.vue b/src/views/iot/device/device/detail/index.vue index 3ec756b5..f8949ecd 100644 --- a/src/views/iot/device/device/detail/index.vue +++ b/src/views/iot/device/device/detail/index.vue @@ -17,7 +17,13 @@ :thing-model-list="thingModelList" /> - + + + @@ -50,6 +56,7 @@ import DeviceDetailsThingModel from './DeviceDetailsThingModel.vue' import DeviceDetailsMessage from './DeviceDetailsMessage.vue' import DeviceDetailsSimulator from './DeviceDetailsSimulator.vue' import DeviceDetailConfig from './DeviceDetailConfig.vue' +import DeviceDetailsSubDevice from './DeviceDetailsSubDevice.vue' defineOptions({ name: 'IoTDeviceDetail' })