From 81fc3bf2ca93f8a89d49af6b24c1cf0a7ff278f3 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Wed, 20 Aug 2025 17:23:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(property):=20=E6=B7=BB=E5=8A=A0=E7=81=AF?= =?UTF-8?q?=E6=8E=A7=E5=BC=80=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/property/meter/lightInfo/index.ts | 18 +++ .../api/property/meter/lightInfo/model.d.ts | 4 +- .../views/property/meter/lightInfo/data.ts | 3 +- .../views/property/meter/lightInfo/index.vue | 125 +++++++----------- 4 files changed, 71 insertions(+), 79 deletions(-) diff --git a/apps/web-antd/src/api/property/meter/lightInfo/index.ts b/apps/web-antd/src/api/property/meter/lightInfo/index.ts index 2fadc30b..967d8973 100644 --- a/apps/web-antd/src/api/property/meter/lightInfo/index.ts +++ b/apps/web-antd/src/api/property/meter/lightInfo/index.ts @@ -59,3 +59,21 @@ export function lightInfoUpdate(data: LightInfoForm) { export function lightInfoRemove(id: ID | IDS) { return requestClient.deleteWithMsg(`/property/lightInfo/${id}`); } + +/** + * 更新灯控开关状态 + * @param data + * @returns void + */ +export function switchSingleLight(data: LightInfoForm) { + return requestClient.postWithMsg('/property/lightInfo/switch', data); +} + +/** + * 批量更新灯控开关状态 + * @param data + * @returns void + */ +export function switchBatchLight(data: LightInfoForm) { + return requestClient.postWithMsg('/property/lightInfo/switch', data); +} diff --git a/apps/web-antd/src/api/property/meter/lightInfo/model.d.ts b/apps/web-antd/src/api/property/meter/lightInfo/model.d.ts index ef05cda9..8afa0016 100644 --- a/apps/web-antd/src/api/property/meter/lightInfo/model.d.ts +++ b/apps/web-antd/src/api/property/meter/lightInfo/model.d.ts @@ -14,7 +14,7 @@ export interface LightInfoVO { /** * 开关状态(0:关,1:开) */ - isOn: number; + isOn: boolean; /** * 灯控模块编码 @@ -62,7 +62,7 @@ export interface LightInfoForm extends BaseEntity { /** * 开关状态(0:关,1:开) */ - isOn?: number; + isOn: boolean; /** * 灯控模块编码 diff --git a/apps/web-antd/src/views/property/meter/lightInfo/data.ts b/apps/web-antd/src/views/property/meter/lightInfo/data.ts index ac1f4be5..301c2b62 100644 --- a/apps/web-antd/src/views/property/meter/lightInfo/data.ts +++ b/apps/web-antd/src/views/property/meter/lightInfo/data.ts @@ -22,7 +22,6 @@ export const columns: VxeGridProps['columns'] = [ title: '位置描述', field: 'locationRemark', }, - { title: '楼 层', field: 'floorName', @@ -30,7 +29,7 @@ export const columns: VxeGridProps['columns'] = [ { title: '开关状态', field: 'isOn', - slots: { default: 'isOn' }, + slots: { default: 'isOn' }, }, { field: 'action', diff --git a/apps/web-antd/src/views/property/meter/lightInfo/index.vue b/apps/web-antd/src/views/property/meter/lightInfo/index.vue index 27854764..3d08c9c0 100644 --- a/apps/web-antd/src/views/property/meter/lightInfo/index.vue +++ b/apps/web-antd/src/views/property/meter/lightInfo/index.vue @@ -1,26 +1,27 @@ @@ -125,55 +117,38 @@ function handleDownloadExcel() {