fix 告警级别
This commit is contained in:
@@ -7,7 +7,7 @@ export const fetchAlertLevelList = (data?: {
|
||||
keyword?: string;
|
||||
enabled?: string;
|
||||
}) => {
|
||||
return request.get("/Alert/v1/severity/list", data || {});
|
||||
return request.get("/Alert/v1/severity/list", { params: data || {} });
|
||||
};
|
||||
|
||||
/** 获取告警级别详情 */
|
||||
|
||||
@@ -145,8 +145,12 @@ const fetchLevels = async () => {
|
||||
|
||||
const res = await fetchAlertLevelList(params)
|
||||
|
||||
tableData.value = res.details?.data || []
|
||||
pagination.total = res.details?.total || 0
|
||||
// 优先适配分页层字段:total/page/page_size/data,并兼容历史返回结构
|
||||
const pageData = res?.data?.data ?? res?.details?.data ?? res?.data ?? []
|
||||
const pageTotal = res?.data?.total ?? res?.details?.total ?? res?.total ?? 0
|
||||
|
||||
tableData.value = Array.isArray(pageData) ? pageData : []
|
||||
pagination.total = Number(pageTotal) || 0
|
||||
} catch (error) {
|
||||
console.error('获取告警级别列表失败:', error)
|
||||
Message.error('获取告警级别列表失败')
|
||||
|
||||
Reference in New Issue
Block a user