This commit is contained in:
mmc
2026-05-18 09:58:36 +08:00
parent a4ecc42ce5
commit 49c2c67836
2 changed files with 11 additions and 7 deletions

View File

@@ -95,16 +95,16 @@ export default function AlarmCenterPage() {
}
};
// ====================== 获取统计 ======================
// ====================== 获取统计(带上查询条件) ======================
const fetchStat = async () => {
try {
const res = await getAlarmStatistics();
// 把查询条件一起传给统计接口
const res = await getAlarmStatistics(queryParams);
if (res.code === 200) {
setStatData(res.data || {});
}
} catch (err) { }
};
// ====================== 查看详情 ======================
const showDetail = async (id) => {
setDetailLoading(true);
@@ -184,7 +184,6 @@ export default function AlarmCenterPage() {
// 加载
useEffect(() => {
fetchList();
fetchStat();
}, [pageNum]);
// ====================== 表格列 ======================
@@ -524,8 +523,12 @@ export default function AlarmCenterPage() {
<Button style={{ borderRadius: 8 }} onClick={() => {
setQueryParams({ deviceId: '', alarmLevel: '', handleStatus: '', startTime: '', endTime: '' });
fetchList();
fetchStat();
}}>重置</Button>
<Button type="primary" style={{ borderRadius: 8, background: '#165DFF' }} onClick={fetchList}>
<Button type="primary" style={{ borderRadius: 8, background: '#165DFF' }} onClick={() => {
fetchList(); // 刷新列表
fetchStat(); // 刷新统计
}}>
<SearchOutlined />查询
</Button>
<Button style={{ borderRadius: 8 }} onClick={doExport}>