feat:太阳能网控设置,新增功能。

This commit is contained in:
tianyongbao
2026-07-01 11:20:31 +08:00
parent c116325a2b
commit 998d5b4928
5 changed files with 670 additions and 0 deletions

38
src/api/iot/index.ts Normal file
View File

@@ -0,0 +1,38 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
export interface SolarPropertyCommand {
id: string | number;
properties: Record<string, any>;
cache?: boolean;
}
export interface SolarPropertyCommandResult {
deviceId: string | number;
serialNum: string;
online: boolean;
statusCode?: number;
properties: Record<string, any>;
mode: 'direct' | 'cached';
cached: boolean;
sent: boolean;
}
export const getDeviceStatus = (devicetype: number, serialnum: string): AxiosPromise<number> => {
return request({
url: '/iot/device/status',
method: 'get',
params: {
devicetype,
serialnum
}
});
};
export const sendSolarPropertyCommand = (data: SolarPropertyCommand): AxiosPromise<SolarPropertyCommandResult> => {
return request({
url: '/iot/device/solar/property-command',
method: 'post',
data
});
};