This commit is contained in:
2025-11-16 19:31:07 +08:00
parent b7c9e51f66
commit 17ccd3b50b

View File

@@ -239,13 +239,15 @@ export default {
if (currentTab === 'area') {
const { currentPage, pageSize } = this.areaAlarms.pagination;
const response = await AlarmApi.getAreaThresholdAlarms({ page: currentPage, page_size: pageSize });
this.areaAlarms.list = response.list || [];
this.areaAlarms.pagination.total = response.pagination?.total || 0;
// 从 response.data 中获取 list 和 pagination
this.areaAlarms.list = response.data.list || [];
this.areaAlarms.pagination.total = response.data.pagination?.total || 0;
} else {
const { currentPage, pageSize } = this.deviceAlarms.pagination;
const response = await AlarmApi.getDeviceThresholdAlarms({ page: currentPage, page_size: pageSize });
this.deviceAlarms.list = response.list || [];
this.deviceAlarms.pagination.total = response.pagination?.total || 0;
// 从 response.data 中获取 list 和 pagination
this.deviceAlarms.list = response.data.list || [];
this.deviceAlarms.pagination.total = response.data.pagination?.total || 0;
}
} catch (error) {
this.$message.error('加载告警规则失败: ' + (error.message || '未知错误'));