---补充可视化的图
This commit is contained in:
@@ -287,3 +287,34 @@ export async function exportAll(query: Record<string, any>) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 首页活动告警
|
||||
* @param query 查询参数
|
||||
* @returns bolb
|
||||
*/
|
||||
export async function mainGet() {
|
||||
let totalSQL = `select count(*) as value,alarm_type as name from alarm where alarm_status=1 group by alarm_type`;
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: totalSQL,
|
||||
},
|
||||
});
|
||||
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
const itemData = result.data.data;
|
||||
if (Array.isArray(itemData)) {
|
||||
const v = itemData[0]['alarm'];
|
||||
if (Array.isArray(v)) {
|
||||
result.data = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user