feat(alarm-page): camera snapshot

This commit is contained in:
yangsy
2025-11-20 16:51:31 +08:00
parent 9b3c5c9fc3
commit b5b0c5448d
5 changed files with 79 additions and 4 deletions

View File

@@ -2,3 +2,4 @@ export * from './base';
export * from './device';
export * from './system';
export * from './user';
export * from './vimp';

View File

@@ -0,0 +1 @@
export * from './snap-result';

View File

@@ -0,0 +1,5 @@
export interface SnapResult {
absoluteFilePath: string;
path: string;
url: string;
}

View File

@@ -1,4 +1,4 @@
import { ndmClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult } from '@/apis';
import { ndmClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult, type SnapResult } from '@/apis';
export const postNdmCameraPage = async (stationCode: string, pageQuery: PageParams<NdmCameraPageQuery>, signal?: AbortSignal) => {
const prefix = stationCode ? `/${stationCode}` : '';
@@ -29,3 +29,12 @@ export const putNdmCamera = async (stationCode: string, updateVO: NdmCameraUpdat
}
return await getNdmCameraDetail(stationCode, ndmCamera.id ?? '');
};
export const getSnapByDeviceIdApi = async (deviceId: string) => {
const resp = await ndmClient.get<SnapResult>(`/api/ndm/ndmCamera/getSnapByDeviceId`, { params: { deviceId } });
const [err, snap] = resp;
if (err || !snap) {
throw err;
}
return snap;
};