xx
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user