fix: 接口变更/请求方法为大写
This commit is contained in:
@@ -20,14 +20,14 @@ export async function listAlarm(query: Record<string, any>) {
|
||||
querySQL += ` and alarm_status = '${query.status}' `;
|
||||
}
|
||||
if (query.beginTime) {
|
||||
querySQL += ` and log_time >= '${query.beginTime}' `;
|
||||
querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `;
|
||||
}
|
||||
if (query.endTime) {
|
||||
querySQL += ` and log_time <= '${query.endTime}' `;
|
||||
querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `;
|
||||
}
|
||||
|
||||
// 排序
|
||||
let sortSql = ' order by log_time ';
|
||||
let sortSql = ' order by event_time ';
|
||||
if (query.sortOrder === 'asc') {
|
||||
sortSql += ' asc ';
|
||||
} else {
|
||||
@@ -41,7 +41,7 @@ export async function listAlarm(query: Record<string, any>) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_log`,
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
|
||||
@@ -50,9 +50,8 @@ export async function listAlarm(query: Record<string, any>) {
|
||||
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
const data: DataList = {
|
||||
total: 0,
|
||||
rows: [],
|
||||
const data = {
|
||||
data: { total: 0, rows: [] as any },
|
||||
code: result.code,
|
||||
msg: result.msg,
|
||||
};
|
||||
@@ -60,9 +59,9 @@ export async function listAlarm(query: Record<string, any>) {
|
||||
const itemData = item['alarm_log'];
|
||||
if (Array.isArray(itemData)) {
|
||||
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
|
||||
data.total = itemData[0]['total'];
|
||||
data.data.total = itemData[0]['total'];
|
||||
} else {
|
||||
data.rows = itemData.map(v => parseObjLineToHump(v));
|
||||
data.data.rows = itemData.map(v => parseObjLineToHump(v));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user