diff --git a/src/api/faultManage/actAlarm.ts b/src/api/faultManage/actAlarm.ts index ed60a580..5fa6c669 100644 --- a/src/api/faultManage/actAlarm.ts +++ b/src/api/faultManage/actAlarm.ts @@ -290,12 +290,12 @@ export async function exportAll(query: Record) { /** - * 首页活动告警 + * 展示页全部告警 * @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`; + let totalSQL = `select count(*) as value,orig_severity as name from alarm group by orig_severity`; // 发起请求 const result = await request({ diff --git a/src/api/neUser/ue.ts b/src/api/neUser/ue.ts index 759ae6e5..84c8cb18 100644 --- a/src/api/neUser/ue.ts +++ b/src/api/neUser/ue.ts @@ -61,3 +61,29 @@ export async function listUE(query: Record) { // ]; return data; } + + + +/** + * 查询SMF在线用户数 + * @param query 查询参数 + * @returns neId + */ +export async function listUENum(neId: String) { + const result = await request({ + url: `/api/rest/ueManagement/v1/elementType/smf/objectType/ueNum?neId=${neId}`, + method: 'get', + }); + let data: DataList = { + total: 0, + rows: [], + code: result.code, + msg: result.msg, + }; + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { + const rows = parseObjLineToHump(result.data.data); + data.total = rows.length; + data.rows = rows; + } +} \ No newline at end of file diff --git a/src/api/perfManage/goldTarget.ts b/src/api/perfManage/goldTarget.ts index d8bf1c56..ef95c9fd 100644 --- a/src/api/perfManage/goldTarget.ts +++ b/src/api/perfManage/goldTarget.ts @@ -115,3 +115,75 @@ export async function getGoldTitleByNE(neType: string) { // 解析数据 return result; } + + +/** + * 查询UPF上下行速率数据 + * @param query 查询参数 + * @returns object + */ +export async function listUPFData(timeArr:any) { + 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.06' and timestamp BETWEEN '${timeArr[0]}' AND '${timeArr[1]}' `, + }, + 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.03' and timestamp BETWEEN '${timeArr[0]}' AND '${timeArr[1]}' `, + }, + 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}; + }); +} \ No newline at end of file diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index d784cc59..6f31cb19 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -212,6 +212,11 @@ export default { systemStatus:'Status', realNeStatus:'Status', reloadTime:'Refresh Time', + Critical:'Critical', + Major:'Major', + Minor:'Minor', + Warning:'Warning', + Event:'Event' }, error: { err403: { @@ -483,6 +488,17 @@ export default { arrayMore: "Expand", }, }, + dashboard: { + overview:{ + UPFFlow:{ + up:'Uplink Rate', + down:'Downlink Rate' + }, + AlarmTypeBar:{ + alarmTotal:'Total:' + } + } + }, neUser: { auth: { authInfo:'Authentication Info', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 19ea8562..c2b0160c 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -212,6 +212,11 @@ export default { systemStatus:'系统状态', realNeStatus:'网元状态', reloadTime:'刷新时间', + Critical:'严重告警', + Major:'主要告警', + Minor:'次要告警', + Warning:'警告告警', + Event:'事件告警' }, error: { err403: { @@ -483,6 +488,17 @@ export default { arrayMore: "展开", }, }, + dashboard: { + overview:{ + UPFFlow:{ + up:'上行', + down:'下行', + }, + AlarmTypeBar:{ + alarmTotal:'告警总数:' + } + } + }, neUser: { auth: { authInfo:'鉴权信息', diff --git a/src/utils/parse-utils.ts b/src/utils/parse-utils.ts index 6a5ed3a8..05415cc9 100644 --- a/src/utils/parse-utils.ts +++ b/src/utils/parse-utils.ts @@ -118,3 +118,33 @@ export function parseSizeFromKBs(size: number): string { } return (size / Math.pow(num, 3)).toFixed(2) + ' TB/s'; } + +/** + * 字节数转换速率 + * @param sizeByte 数值大小 + * @returns + */ +export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any { + // let realBit:any=((sizeByte * 8) / timeInterval); + // if (realBit >= 0 && realBit < 1000) { + // return [realBit.toFixed(2),' bits/sec']; + // } + + // if (realBit >= 1000 && realBit < 1000*1000) { + // return [(realBit/1000).toFixed(2) ,' Kbits/sec']; + // } + + // if (realBit >= 1000*1000 && realBit < 1000*1000*1000) { + // return [((realBit/1000)/1000).toFixed(2) ,' Mbits/sec']; + // } + + // if (realBit >= 1000*1000*1000) { + // return [((realBit/1000*1000)/1000).toFixed(2) ,' Gbits/sec']; + // } + + // return [((realBit/1000*1000*1000)/1000).toFixed(2) ,' TB/sec']; + + let realBit: any = (sizeByte * 8) / timeInterval; + + return [(realBit / 1000 / 1000).toFixed(2), ' Mbits/sec']; +} diff --git a/src/views/dashboard/overview/components/AlarnTypeBar/index.vue b/src/views/dashboard/overview/components/AlarnTypeBar/index.vue index 6cab9857..8da422e8 100644 --- a/src/views/dashboard/overview/components/AlarnTypeBar/index.vue +++ b/src/views/dashboard/overview/components/AlarnTypeBar/index.vue @@ -1,8 +1,8 @@ @@ -209,3 +222,4 @@ onMounted(() => { height: 100%; } + diff --git a/src/views/dashboard/overview/components/UPFFlow/index.vue b/src/views/dashboard/overview/components/UPFFlow/index.vue index 1da18321..c70e93ef 100644 --- a/src/views/dashboard/overview/components/UPFFlow/index.vue +++ b/src/views/dashboard/overview/components/UPFFlow/index.vue @@ -2,8 +2,9 @@
diff --git a/src/views/dashboard/overview/index.vue b/src/views/dashboard/overview/index.vue index 3f545e43..cee56104 100644 --- a/src/views/dashboard/overview/index.vue +++ b/src/views/dashboard/overview/index.vue @@ -1,5 +1,5 @@