Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2、保养计划
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
import type { MachineVO, MachineForm, MachineQuery } from './model';
|
|
|
|
import type { ID, IDS } from '#/api/common';
|
|
import type { PageResult } from '#/api/common';
|
|
|
|
import { commonExport } from '#/api/helper';
|
|
import { requestClient } from '#/api/request';
|
|
|
|
/**
|
|
* 查询设备列表列表
|
|
* @param params
|
|
* @returns 设备列表列表
|
|
*/
|
|
export function machineList(params?: MachineQuery) {
|
|
return requestClient.get<PageResult<MachineVO>>('/property/machine/list', { params });
|
|
}
|
|
|
|
/**
|
|
* 导出设备列表列表
|
|
* @param params
|
|
* @returns 设备列表列表
|
|
*/
|
|
export function machineExport(params?: MachineQuery) {
|
|
return commonExport('/property/machine/export', params ?? {});
|
|
}
|
|
|
|
/**
|
|
* 查询设备列表详情
|
|
* @param id id
|
|
* @returns 设备列表详情
|
|
*/
|
|
export function machineInfo(id: ID) {
|
|
return requestClient.get<MachineVO>(`/property/machine/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 新增设备列表
|
|
* @param data
|
|
* @returns void
|
|
*/
|
|
export function machineAdd(data: MachineForm) {
|
|
return requestClient.postWithMsg<void>('/property/machine', data);
|
|
}
|
|
|
|
/**
|
|
* 更新设备列表
|
|
* @param data
|
|
* @returns void
|
|
*/
|
|
export function machineUpdate(data: MachineForm) {
|
|
return requestClient.putWithMsg<void>('/property/machine', data);
|
|
}
|
|
|
|
/**
|
|
* 删除设备列表
|
|
* @param id id
|
|
* @returns void
|
|
*/
|
|
export function machineRemove(id: ID | IDS) {
|
|
return requestClient.deleteWithMsg<void>(`/property/machine/${id}`);
|
|
}
|