feat: 看板IMS会话数
This commit is contained in:
@@ -64,6 +64,9 @@ export const graphNodeStateNum = computed(() => {
|
|||||||
return [normal, abnormal];
|
return [normal, abnormal];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**网元状态请求标记 */
|
||||||
|
export const neStateRequestMap = ref<Map<string, boolean>>(new Map());
|
||||||
|
|
||||||
/**neStateParse 网元状态 数据解析 */
|
/**neStateParse 网元状态 数据解析 */
|
||||||
export function neStateParse(neType: string, data: Record<string, any>) {
|
export function neStateParse(neType: string, data: Record<string, any>) {
|
||||||
const { combos, edges, nodes } = graphState.data;
|
const { combos, edges, nodes } = graphState.data;
|
||||||
@@ -151,4 +154,7 @@ export function neStateParse(neType: string, data: Record<string, any>) {
|
|||||||
graphG6.value.setItemState(edge.id, 'line-path', neT.neState.online);
|
graphG6.value.setItemState(edge.id, 'line-path', neT.neState.online);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 请求标记复位
|
||||||
|
neStateRequestMap.value.set(neType, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import UserActivity from './components/UserActivity/index.vue';
|
|||||||
import AlarnTypeBar from './components/AlarnTypeBar/index.vue';
|
import AlarnTypeBar from './components/AlarnTypeBar/index.vue';
|
||||||
import UPFFlow from './components/UPFFlow/index.vue';
|
import UPFFlow from './components/UPFFlow/index.vue';
|
||||||
import { listSub } from '@/api/neUser/sub';
|
import { listSub } from '@/api/neUser/sub';
|
||||||
import { listUENum } from '@/api/neUser/ue';
|
import { listUENumBySMF } from '@/api/neUser/smf';
|
||||||
|
import { listUENumByIMS } from '@/api/neUser/ims';
|
||||||
import { listBase5G } from '@/api/neUser/base5G';
|
import { listBase5G } from '@/api/neUser/base5G';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -15,12 +16,14 @@ import {
|
|||||||
graphState,
|
graphState,
|
||||||
notNeNodes,
|
notNeNodes,
|
||||||
graphNodeStateNum,
|
graphNodeStateNum,
|
||||||
|
neStateRequestMap,
|
||||||
} from './hooks/useTopology';
|
} from './hooks/useTopology';
|
||||||
import { upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
|
import { upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
|
||||||
import { useFullscreen } from '@vueuse/core';
|
import { useFullscreen } from '@vueuse/core';
|
||||||
import useWS from './hooks/useWS';
|
import useWS from './hooks/useWS';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { wsSend, cdrEventSend, ueEventSend, upfTFSend } = useWS();
|
const { wsSend, cdrEventSend, ueEventSend, upfTFSend } = useWS();
|
||||||
@@ -29,15 +32,18 @@ const { wsSend, cdrEventSend, ueEventSend, upfTFSend } = useWS();
|
|||||||
let onlineInfo: {
|
let onlineInfo: {
|
||||||
/**签约用户数量 */
|
/**签约用户数量 */
|
||||||
subNum: number;
|
subNum: number;
|
||||||
/**在线用户数 */
|
/**SMF在线用户数 */
|
||||||
ueNum: any;
|
smfUeNum: number;
|
||||||
|
/**IMS在线用户数 */
|
||||||
|
imsUeNum: number;
|
||||||
/**基站数量 */
|
/**基站数量 */
|
||||||
nbNum: number;
|
nbNum: number;
|
||||||
/**原始严重程度 */
|
/**原始严重程度 */
|
||||||
activeAlarmSeverity: DictType[];
|
activeAlarmSeverity: DictType[];
|
||||||
} = reactive({
|
} = reactive({
|
||||||
subNum: 0,
|
subNum: 0,
|
||||||
ueNum: 0,
|
smfUeNum: 0,
|
||||||
|
imsUeNum: 0,
|
||||||
nbNum: 0,
|
nbNum: 0,
|
||||||
activeAlarmSeverity: [],
|
activeAlarmSeverity: [],
|
||||||
});
|
});
|
||||||
@@ -53,13 +59,17 @@ const stateInterval = ref<any>(null);
|
|||||||
const stateTimeout = ref<any>(null);
|
const stateTimeout = ref<any>(null);
|
||||||
|
|
||||||
/**查询网元状态 */
|
/**查询网元状态 */
|
||||||
async function fnGetState() {
|
function fnGetState() {
|
||||||
clearTimeout(stateTimeout.value);
|
clearTimeout(stateTimeout.value);
|
||||||
// 获取节点状态
|
// 获取节点状态
|
||||||
for (const node of graphState.data.nodes) {
|
for (const node of graphState.data.nodes) {
|
||||||
if (notNeNodes.includes(node.id)) continue;
|
if (notNeNodes.includes(node.id)) continue;
|
||||||
const { neType, neId } = node.neInfo;
|
const { neType, neId } = node.neInfo;
|
||||||
if (!neType || !neId) continue;
|
if (!neType || !neId) continue;
|
||||||
|
// 请求标记检查避免重复发送
|
||||||
|
if (neStateRequestMap.value.get(neType)) continue;
|
||||||
|
neStateRequestMap.value.set(neType, true);
|
||||||
|
|
||||||
wsSend({
|
wsSend({
|
||||||
requestId: `neState_${neType}_${neId}`,
|
requestId: `neState_${neType}_${neId}`,
|
||||||
type: 'ne_state',
|
type: 'ne_state',
|
||||||
@@ -70,7 +80,7 @@ async function fnGetState() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// stateTimeout.value = setTimeout(() => fnGetState(), 5_000);
|
stateTimeout.value = setTimeout(() => fnGetState(), 5_000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**初始数据函数 */
|
/**初始数据函数 */
|
||||||
@@ -110,7 +120,8 @@ onMounted(() => {
|
|||||||
/**每页条数 */
|
/**每页条数 */
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
}),
|
}),
|
||||||
listUENum('001'),
|
listUENumBySMF('001'),
|
||||||
|
listUENumByIMS('001'),
|
||||||
])
|
])
|
||||||
.then(resArr => {
|
.then(resArr => {
|
||||||
if (resArr[0].status === 'fulfilled') {
|
if (resArr[0].status === 'fulfilled') {
|
||||||
@@ -125,11 +136,18 @@ onMounted(() => {
|
|||||||
onlineInfo.nbNum = resArr[1].value.rows.length;
|
onlineInfo.nbNum = resArr[1].value.rows.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (resArr[2].status === 'fulfilled') {
|
||||||
resArr[2].status === 'fulfilled' &&
|
const res = resArr[2].value;
|
||||||
resArr[2].value?.code === RESULT_CODE_SUCCESS
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
) {
|
onlineInfo.smfUeNum = res.data;
|
||||||
onlineInfo.ueNum = resArr[2].value?.data;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resArr[3].status === 'fulfilled') {
|
||||||
|
const res = resArr[3].value;
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
|
onlineInfo.imsUeNum = res.data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -177,19 +195,19 @@ onBeforeUnmount(() => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<h4>{{ onlineInfo.ueNum }}</h4>
|
<h4>{{ onlineInfo.imsUeNum }}</h4>
|
||||||
<span>
|
|
||||||
<UserSwitchOutlined style="color: #6acca3" />
|
|
||||||
Data {{ t('views.dashboard.overview.skim.session') }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<h4>0</h4>
|
|
||||||
<span>
|
<span>
|
||||||
<UserSwitchOutlined style="color: #6acca3" />
|
<UserSwitchOutlined style="color: #6acca3" />
|
||||||
IMS {{ t('views.dashboard.overview.skim.session') }}
|
IMS {{ t('views.dashboard.overview.skim.session') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<h4>{{ onlineInfo.smfUeNum }}</h4>
|
||||||
|
<span>
|
||||||
|
<UserSwitchOutlined style="color: #6acca3" />
|
||||||
|
Data {{ t('views.dashboard.overview.skim.session') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user