添加统计数

This commit is contained in:
lai
2024-01-29 17:07:02 +08:00
parent 4d39a4bdee
commit 3ed6b5c818
2 changed files with 39 additions and 23 deletions

View File

@@ -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(() => {
</span>
</div>
<div class="item">
<h4>1000</h4>
<h4>{{ onlineInfo.ueNum }}</h4>
<span>
<UserSwitchOutlined style="color: #6acca3" />
{{ t('views.dashboard.overview.skim.session') }}
@@ -114,7 +137,7 @@ onMounted(() => {
</span>
</div>
<div class="item">
<h4>2</h4>
<h4>{{ onlineInfo.nbNum }}</h4>
<span>
<WifiOutlined style="color: #edcb35" />
{{ t('views.dashboard.overview.skim.base') }}