feat(dashboard): export devices

This commit is contained in:
yangsy
2025-11-06 14:27:54 +08:00
parent 511f0050c2
commit 990626b3ff
3 changed files with 140 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
import { ndmClient } from '@/apis/client';
export const ndmExportDevices = async (status?: string) => {
const endpoint = '/api/ndm/ndmIcmpExport/exportByTemplate';
const body = new URLSearchParams();
body.append('status', status ?? '');
const resp = await ndmClient.post<Blob>(endpoint, body, {
responseType: 'blob',
retRaw: true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
});
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};