fix: 接口变更/请求方法为大写

This commit is contained in:
TsMask
2025-02-20 10:42:34 +08:00
parent 8bfa73a67a
commit 7322759545
83 changed files with 568 additions and 1388 deletions

View File

@@ -1,66 +1,4 @@
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { request } from '@/plugins/http-fetch';
import { parseObjLineToHump } from '@/utils/parse-utils';
import { parseDateToStr } from '@/utils/date-utils';
/**
* 查询自定义指标
* @param query 查询参数
* @returns object
*/
// export async function listCustom(query: Record<string, any>) {
// let totalSQL = 'select count(*) as total from pm_custom_title where 1=1 ';
// let rowsSQL = 'select * from pm_custom_title where 1=1 ';
// // 查询
// let querySQL = '';
// if (query.neType) {
// querySQL += ` and ne_type like '%${query.neType}%' `;
// }
// // 排序
// let sortSql = ' order by update_time ';
// if (query.sortOrder === 'asc') {
// sortSql += ' asc ';
// } else {
// sortSql += ' desc ';
// }
// // 分页
// const pageNum = (query.pageNum - 1) * query.pageSize;
// const limtSql = ` limit ${pageNum},${query.pageSize} `;
// // 发起请求
// const result = await request({
// url: `/api/rest/databaseManagement/v1/select/omc_db/pm_custom_title`,
// method: 'get',
// params: {
// totalSQL: totalSQL + querySQL,
// rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
// },
// });
// // 解析数据
// if (result.code === RESULT_CODE_SUCCESS) {
// const data: DataList = {
// total: 0,
// rows: [],
// code: result.code,
// msg: result.msg,
// };
// result.data.data.forEach((item: any) => {
// const itemData = item['pm_custom_title'];
// if (Array.isArray(itemData)) {
// if (itemData.length === 1 && itemData[0]['total'] >= 0) {
// data.total = itemData[0]['total'];
// } else {
// data.rows = itemData.map(v => parseObjLineToHump(v));
// }
// }
// });
// return data;
// }
// return result;
// }
/**
* 新 查询自定义指标
@@ -71,7 +9,7 @@ export async function listCustom(query?: Record<string, any>) {
// 发起请求
const result = await request({
url: `/pm/kpiC/title/totalList`,
method: 'get',
method: 'GET',
params: query,
});
return result;
@@ -85,7 +23,7 @@ export async function listCustom(query?: Record<string, any>) {
export async function getCustom(id: string | number) {
return request({
url: `/pm/kpiC/title/${id}`,
method: 'get',
method: 'GET',
});
}
@@ -97,7 +35,7 @@ export async function getCustom(id: string | number) {
export function addCustom(data: Record<string, any>) {
return request({
url: `/pm/kpiC/title`,
method: 'post',
method: 'POST',
data: data,
});
}
@@ -110,7 +48,7 @@ export function addCustom(data: Record<string, any>) {
export function updateCustom(data: Record<string, any>) {
return request({
url: `/pm/kpiC/title/${data.id}`,
method: 'put',
method: 'PUT',
data: data,
});
}
@@ -122,6 +60,6 @@ export function updateCustom(data: Record<string, any>) {
export async function delCustom(data: Record<string, any>) {
return request({
url: `/pm/kpiC/title/${data.id}`,
method: 'delete',
method: 'DELETE',
});
}