From 3ed6b5c8184d7484a9be0eaac43345e44730f5f4 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Mon, 29 Jan 2024 17:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=9F=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neUser/ue.ts | 23 ++++++--------- src/views/dashboard/overview/index.vue | 39 ++++++++++++++++++++------ 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/api/neUser/ue.ts b/src/api/neUser/ue.ts index 84c8cb18..46755e46 100644 --- a/src/api/neUser/ue.ts +++ b/src/api/neUser/ue.ts @@ -62,10 +62,9 @@ export async function listUE(query: Record) { return data; } - - +// /** - * 查询SMF在线用户数 + * 首页查询SMF在线用户数 * @param query 查询参数 * @returns neId */ @@ -74,16 +73,10 @@ export async function listUENum(neId: String) { 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; + if (result.code === RESULT_CODE_SUCCESS) { + let data = result.data.data; + return Object.assign(result, { + data: parseObjLineToHump(data['ueNum']), + }); } -} \ No newline at end of file +} diff --git a/src/views/dashboard/overview/index.vue b/src/views/dashboard/overview/index.vue index cbd179c8..f15c797b 100644 --- a/src/views/dashboard/overview/index.vue +++ b/src/views/dashboard/overview/index.vue @@ -10,11 +10,14 @@ import AlarnTypeBar from './components/AlarnTypeBar/index.vue'; import UPFFlow from './components/UPFFlow/index.vue'; import { listSub } from '@/api/neUser/sub'; import { listUENum } from '@/api/neUser/ue'; +import { listBase5G } from '@/api/neUser/base5G'; + import { graphNodeClickID } from './hooks/useTopology'; import { upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow'; import { useFullscreen } from '@vueuse/core'; import useWS from './hooks/useWS'; import useAppStore from '@/store/modules/app'; +import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; const appStore = useAppStore(); const { t } = useI18n(); const { wsSend, cdrEventSend, ueEventSend, upfTFSend } = useWS(); @@ -23,16 +26,16 @@ const { wsSend, cdrEventSend, ueEventSend, upfTFSend } = useWS(); let onlineInfo: { /**签约用户数量 */ subNum: number; - /**告警清除类型 */ + /**在线用户数 */ ueNum: any; - /**告警清除类型 */ - activeAckState: DictType[]; + /**基站数量 */ + nbNum: number; /**原始严重程度 */ activeAlarmSeverity: DictType[]; } = reactive({ subNum: 0, ueNum: 0, - activeAckState: [], + nbNum: 0, activeAlarmSeverity: [], }); @@ -49,14 +52,34 @@ onMounted(() => { pageNum: '1', pageSize: '20', }), + listBase5G({ + // + neName: 'AMF', + id: '001', + pageNum: 1, + /**每页条数 */ + pageSize: 20, + }), listUENum('001'), ]) .then(resArr => { if (resArr[0].status === 'fulfilled') { onlineInfo.subNum = resArr[0].value.total; } - if (resArr[1].status === 'fulfilled') { - console.log(resArr); + + if ( + resArr[1].status === 'fulfilled' && + resArr[1].value.code === RESULT_CODE_SUCCESS && + Array.isArray(resArr[1].value.rows) + ) { + onlineInfo.nbNum = resArr[1].value.rows.length; + } + + if ( + resArr[2].status === 'fulfilled' && + resArr[2].value?.code === RESULT_CODE_SUCCESS + ) { + onlineInfo.ueNum = resArr[2].value?.data; } }) .finally(() => { @@ -100,7 +123,7 @@ onMounted(() => {
-

1000

+

{{ onlineInfo.ueNum }}

{{ t('views.dashboard.overview.skim.session') }} @@ -114,7 +137,7 @@ onMounted(() => {
-

2

+

{{ onlineInfo.nbNum }}

{{ t('views.dashboard.overview.skim.base') }}