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() {