From 782337952d1f107af797c2d76402ab92e67e4885 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 30 Mar 2025 10:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E5=9C=BA=E6=99=AF=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/device/index.ts | 5 +++-- src/api/iot/product/product/index.ts | 4 ++-- src/api/iot/rule/databridge/index.ts | 1 + src/api/iot/rule/scene/scene.types.ts | 2 +- src/api/system/dept/index.ts | 4 ++-- src/api/system/role/index.ts | 12 +----------- .../rule/scene/components/ThingModelDualView.vue | 4 ++-- .../scene/components/action/ActionExecutor.vue | 7 +------ .../rule/scene/components/action/AlertAction.vue | 16 ++++++++++++---- .../scene/components/action/DataBridgeAction.vue | 2 +- .../components/action/DeviceControlAction.vue | 2 +- src/views/system/dept/index.vue | 2 +- 12 files changed, 28 insertions(+), 33 deletions(-) diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index 6b5fa1564..928635926 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -162,12 +162,13 @@ export const DeviceApi = { return await request.get({ url: `/iot/device/log/page`, params }) }, - // 获取设备MQTT连接参数 + // 获取设备 MQTT 连接参数 getMqttConnectionParams: async (deviceId: number) => { return await request.get({ url: `/iot/device/mqtt-connection-params`, params: { deviceId } }) }, - // 根据ProductKey和DeviceNames获取设备列表 + // 根据 ProductKey 和 DeviceNames 获取设备列表 + // TODO @puhui999:getDeviceListByProductKeyAndNames 哈。项目的风格统一~ getDevicesByProductKeyAndNames: async (productKey: string, deviceNames: string[]) => { return await request.get({ url: `/iot/device/list-by-product-key-and-names`, diff --git a/src/api/iot/product/product/index.ts b/src/api/iot/product/product/index.ts index f03339d1a..5e3552295 100644 --- a/src/api/iot/product/product/index.ts +++ b/src/api/iot/product/product/index.ts @@ -79,8 +79,8 @@ export const ProductApi = { getSimpleProductList() { return request.get({ url: '/iot/product/simple-list' }) }, - - // 根据ProductKey获取产品信息 + + // 根据 ProductKey 获取产品信息 getProductByKey: async (productKey: string) => { return await request.get({ url: `/iot/product/get-by-key`, params: { productKey } }) } diff --git a/src/api/iot/rule/databridge/index.ts b/src/api/iot/rule/databridge/index.ts index 02568ccfe..7c3808947 100644 --- a/src/api/iot/rule/databridge/index.ts +++ b/src/api/iot/rule/databridge/index.ts @@ -125,6 +125,7 @@ export const DataBridgeApi = { }, // 查询数据桥梁(精简)列表 + // TODO @puhui999:getDataBridgeSimpleList 哈。项目的风格统一~ 之前有几个,我写错了。。。 getSimpleDataBridgeList() { return request.get({ url: '/iot/data-bridge/simple-list' }) } diff --git a/src/api/iot/rule/scene/scene.types.ts b/src/api/iot/rule/scene/scene.types.ts index 76cdf9a3d..29cac328f 100644 --- a/src/api/iot/rule/scene/scene.types.ts +++ b/src/api/iot/rule/scene/scene.types.ts @@ -100,7 +100,7 @@ interface ActionAlert { // 执行器配置 interface ActionConfig { - key: any // 解决组件索引重用 + key: any // 解决组件索引重用 TODO @puhui999:看看有没更好的解决方案呢。 type: number // 执行类型 deviceControl?: ActionDeviceControl // 设备控制 alert?: ActionAlert // 告警执行 diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts index 04d5c8807..e228d0f1a 100644 --- a/src/api/system/dept/index.ts +++ b/src/api/system/dept/index.ts @@ -18,8 +18,8 @@ export const getSimpleDeptList = async (): Promise => { } // 查询部门列表 -export const getDeptPage = async (params: PageParam) => { - return await request.get({ url: '/system/dept/list', params }) +export const getDeptList = async () => { + return await request.get({ url: '/system/dept/list' }) } // 查询部门详情 diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts index 3325ddec2..233f7f0cb 100644 --- a/src/api/system/role/index.ts +++ b/src/api/system/role/index.ts @@ -12,11 +12,6 @@ export interface RoleVO { createTime: Date } -export interface UpdateStatusReqVO { - id: number - status: number -} - // 查询角色列表 export const getRolePage = async (params: PageParam) => { return await request.get({ url: '/system/role/page', params }) @@ -42,18 +37,13 @@ export const updateRole = async (data: RoleVO) => { return await request.put({ url: '/system/role/update', data }) } -// 修改角色状态 -export const updateRoleStatus = async (data: UpdateStatusReqVO) => { - return await request.put({ url: '/system/role/update-status', data }) -} - // 删除角色 export const deleteRole = async (id: number) => { return await request.delete({ url: '/system/role/delete?id=' + id }) } // 导出角色 -export const exportRole = (params) => { +export const exportRole = (params: any) => { return request.download({ url: '/system/role/export-excel', params diff --git a/src/views/iot/rule/scene/components/ThingModelDualView.vue b/src/views/iot/rule/scene/components/ThingModelDualView.vue index 24fb60002..13424a4aa 100644 --- a/src/views/iot/rule/scene/components/ThingModelDualView.vue +++ b/src/views/iot/rule/scene/components/ThingModelDualView.vue @@ -1,12 +1,12 @@