feat: alarm records query

This commit is contained in:
yangsy
2025-08-20 23:27:24 +08:00
parent c83fea6dec
commit 1707d2c66f
7 changed files with 355 additions and 127 deletions

View File

@@ -1,6 +1,6 @@
export interface Station {
// id: string;
code: string;
name: string;
deviceIdPrefix: string; // 当查询设备告警记录时需要通过deviceId的前4位来判断车站
online: boolean;
}

View File

@@ -2,7 +2,6 @@ import type { BaseModel } from '../../base/model';
import type { ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '../../base/reduce';
export interface NdmDeviceAlarmLogVO extends BaseModel {
[key: string]: any; // 告警数据表格中会加一些别的标记字段
alarmNo: string;
alarmDate: string;
faultLocation: string;

View File

@@ -22,3 +22,21 @@ export const postNdmDeviceAlarmLogPage = async (stationCode: string, pageQuery:
}
return alarmData;
};
export const defaultExportByTemplate = async (stationCode: string, pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>) => {
const endpoint = '/api/ndm/ndmDeviceAlarmLog/defaultExportByTemplate';
if (!stationCode) {
const resp = await userClient.post<BlobPart>(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
}
const resp = await ndmClient.post<BlobPart>(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};