del: 移除部分旧/apt/rest/直连接口
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export async function listUEInfoByIMS(query: Record<string, any>) {
|
||||
query.nbId = query.id;
|
||||
const result = await request({
|
||||
url: '/api/rest/ueManagement/v1/elementType/ims/objectType/ueInfo',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
});
|
||||
const data = {
|
||||
data: { total: 0, rows: [] as any },
|
||||
code: result.code,
|
||||
msg: result.msg,
|
||||
};
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) {
|
||||
const rows = parseObjLineToHump(result.data.data);
|
||||
data.data.total = rows.length;
|
||||
data.data.rows = rows;
|
||||
}
|
||||
|
||||
// 测试数据
|
||||
// data.rows = [
|
||||
// {
|
||||
// activeTime: '2023-11-29 17:04:54',
|
||||
// barring: 0,
|
||||
// impu: 'sip:12307551232@ims.mnc000.mcc460.3gppnetwork.org',
|
||||
// imsi: '460001230000002',
|
||||
// msisdn: '12307551232',
|
||||
// regState: 1,
|
||||
// },
|
||||
// ];
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页查询IMS在线用户数
|
||||
* @param query 查询参数
|
||||
* @returns neId
|
||||
*/
|
||||
export async function listUENumByIMS(neId: String) {
|
||||
const result = await request({
|
||||
url: `/api/rest/ueManagement/v1/elementType/ims/objectType/ueNum?neId=${neId}`,
|
||||
method: 'GET',
|
||||
});
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
let num = result.data['ueNum'] || 0;
|
||||
if (num === 0) {
|
||||
num = result.data.data['ueNum'] || 0;
|
||||
}
|
||||
return Object.assign(result, { data: num });
|
||||
}
|
||||
|
||||
// 模拟数据
|
||||
// { "ueNum": 0 }
|
||||
// result.data = 0
|
||||
return result;
|
||||
}
|
||||
@@ -2,80 +2,6 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
|
||||
/**
|
||||
* Todo 废弃
|
||||
* 查询黄金指标数据
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export async function listgoldData(query: Record<string, any>) {
|
||||
let totalSQL = 'select count(*) as total from gold_kpi where 1=1 ';
|
||||
let rowsSQL =
|
||||
'SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 ';
|
||||
|
||||
// 查询
|
||||
let querySQL = '';
|
||||
if (query.neType) {
|
||||
querySQL += ` and gold_kpi.ne_type like '%${query.neType}%' `;
|
||||
}
|
||||
if (query.beginTime) {
|
||||
querySQL += ` and start_time >= '${query.beginTime}' `;
|
||||
}
|
||||
if (query.endTime) {
|
||||
querySQL += ` and end_time <= '${query.endTime}' `;
|
||||
}
|
||||
|
||||
// 排序
|
||||
let sortSql = ' order by ';
|
||||
if (query.sortField) {
|
||||
sortSql += ` ${query.sortField} `;
|
||||
} else {
|
||||
sortSql += ` start_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/gold_kpi`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
|
||||
},
|
||||
timeout: 60_000,
|
||||
});
|
||||
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
const data = {
|
||||
data: { total: 0, rows: [] as any },
|
||||
code: result.code,
|
||||
msg: result.msg,
|
||||
};
|
||||
result.data.data.forEach((item: any) => {
|
||||
const itemData = item['gold_kpi'];
|
||||
if (Array.isArray(itemData)) {
|
||||
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
|
||||
data.data.total = itemData[0]['total'];
|
||||
} else {
|
||||
data.data.rows = itemData.map(v => parseObjLineToHump(v));
|
||||
}
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询黄金指标数据
|
||||
* @param query 查询参数
|
||||
@@ -107,80 +33,3 @@ export async function getKPITitle(neType: string) {
|
||||
// 解析数据//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Todo 废弃
|
||||
* 查询UPF上下行速率数据
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export async function listUPFData(timeArr: any) {
|
||||
const initTime: Date = new Date();
|
||||
const twentyFourHoursAgo: Date = new Date(
|
||||
initTime.getTime() - 10 * 60 * 1000
|
||||
);
|
||||
|
||||
return await Promise.allSettled([
|
||||
// 获取参数规则
|
||||
request({
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/gold_kpi`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
SQL: `SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 and gold_kpi.kpi_id ='UPF.03' AND timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 10 MINUTE) AND NOW()`,
|
||||
},
|
||||
timeout: 60_000,
|
||||
}),
|
||||
// 获取对应信息
|
||||
request({
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/gold_kpi`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
SQL: `SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 and gold_kpi.kpi_id ='UPF.06' AND timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 10 MINUTE) AND NOW()`,
|
||||
},
|
||||
timeout: 60_000,
|
||||
}),
|
||||
]).then(resArr => {
|
||||
let upData: any = [];
|
||||
let downData: any = [];
|
||||
|
||||
// 规则数据
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
const itemV: any = resArr[0].value;
|
||||
// 解析数据
|
||||
if (
|
||||
itemV.code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(itemV.data?.data)
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
let data = itemData[0]['gold_kpi'];
|
||||
if (Array.isArray(data)) {
|
||||
try {
|
||||
upData = data.map(v => parseObjLineToHump(v));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resArr[1].status === 'fulfilled') {
|
||||
const itemV = resArr[1].value;
|
||||
// 解析数据
|
||||
if (
|
||||
itemV.code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(itemV.data?.data)
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
const data = itemData[0]['gold_kpi'];
|
||||
if (Array.isArray(data)) {
|
||||
try {
|
||||
downData = data.map(v => parseObjLineToHump(v));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return { upData, downData };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { message } from 'ant-design-vue/es';
|
||||
import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/es/table';
|
||||
import { listUEInfoByIMS } from '@/api/neUser/ims';
|
||||
import useNeInfoStore from '@/store/modules/neinfo';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
|
||||
Reference in New Issue
Block a user