ref: v3变更,,完成整合,同步v2.2508.4 -250902

This commit is contained in:
TsMask
2025-09-06 11:27:57 +08:00
parent e943b4dedc
commit 6470ed5bc1
90 changed files with 1724 additions and 1361 deletions

View File

@@ -21,7 +21,7 @@ import {
graphNodeStateNum,
neStateRequestMap,
} from './hooks/useTopology';
import { upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
import { upfNeUId, upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
import { useFullscreen } from '@vueuse/core';
import useWS from './hooks/useWS';
import useAppStore from '@/store/modules/app';
@@ -29,7 +29,8 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { useRouter } from 'vue-router';
import useNeStore from '@/store/modules/ne';
import { message } from 'ant-design-vue';
import { upfWhoId } from './hooks/useWS';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { eventNeUid } from './hooks/useUserActivity';
const router = useRouter();
const appStore = useAppStore();
@@ -84,18 +85,19 @@ function fnGetNeState() {
// 获取节点状态
for (const node of graphState.data.nodes) {
if (notNeNodes.includes(node.id)) continue;
const { neType, neId } = node.neInfo;
if (!neType || !neId) continue;
const { neType, coreUid, neUid } = node.neInfo;
if (!neType || !neUid) continue;
// 请求标记检查避免重复发送
if (neStateRequestMap.value.get(neType)) continue;
neStateRequestMap.value.set(neType, true);
wsSend({
requestId: `neState_${neType}_${neId}`,
requestId: `neState_${coreUid}_${neUid}_${neType}`,
type: 'ne_state',
data: {
coreUid: coreUid,
neType: neType,
neId: neId,
neUid: neUid,
},
});
}
@@ -107,8 +109,8 @@ async function fnGetSkim() {
// [
// 'UDM',
// {
// request: (neId: string) =>
// listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }),
// request: (coreUid: string, neUid: string) =>
// listUDMSub({ coreUid, neUid, pageNum: 1, pageSize: 1 }),
// process: (res: any) =>
// res.code === RESULT_CODE_SUCCESS &&
// (skimState.udmSubNum += res.data.total),
@@ -117,7 +119,10 @@ async function fnGetSkim() {
[
'SMF',
{
request: (neId: string) => listSMFSubNum(neId),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.SMF = neUid;
return listSMFSubNum(coreUid, neUid);
},
process: (res: any) => {
if (
res.code === RESULT_CODE_SUCCESS &&
@@ -131,7 +136,10 @@ async function fnGetSkim() {
[
'IMS',
{
request: (neId: string) => listIMSSessionNum(neId),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.IMS = neUid;
return listIMSSessionNum(coreUid, neUid);
},
process: (res: any) => {
if (
res.code === RESULT_CODE_SUCCESS &&
@@ -145,7 +153,10 @@ async function fnGetSkim() {
[
'AMF',
{
request: (neId: string) => listAMFNblist({ neId }),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.AMF = neUid;
return listAMFNblist({ coreUid, neUid });
},
process: (res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.gnbNum += res.data.length;
@@ -160,7 +171,10 @@ async function fnGetSkim() {
[
'MME',
{
request: (neId: string) => listMMENblist({ neId }),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.MME = neUid;
return listMMENblist({ coreUid, neUid });
},
process: (res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.enbNum += res.data.length;
@@ -181,7 +195,7 @@ async function fnGetSkim() {
const handler = neHandlers.get(child.neType);
return handler
? {
promise: handler.request(child.neId),
promise: handler.request(child.coreUid, child.neUid),
process: handler.process,
}
: null;
@@ -210,7 +224,12 @@ async function fnGetSkim() {
});
// UDM
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
listUDMSub({
coreUid: currentCoreUid(),
neUid: udmNeUid.value,
pageNum: 1,
pageSize: 1,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res.data.total;
}
@@ -254,12 +273,12 @@ function fnToRouter(name: string, query?: any) {
}
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
let upfOtions = ref<Record<string, any>[]>([]);
// UPF实时流量下拉框选择
function fnSelectNe(value: any, option: any) {
upfWhoId.value = value;
reSendUPF(value);
upfNeUId.value = value;
reSendUPF();
// upfTotalFlow.value.map((item: any) => {
// item.requestFlag = false;
// });
@@ -270,12 +289,17 @@ function fnSelectNe(value: any, option: any) {
// loadData();
}
let udmNeId = ref<string>('001');
let udmNeUid = ref<string>('');
let udmOtions = ref<Record<string, any>[]>([]);
/**用户数量-选择UDM */
function fnSelectUDM(e: any) {
udmNeId.value = e.key;
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
udmNeUid.value = e.key;
listUDMSub({
coreUid: currentCoreUid(),
neUid: e.key,
pageNum: 1,
pageSize: 1,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res.data.total;
}
@@ -294,14 +318,14 @@ onMounted(() => {
// 获取网元网元列表
neStore.neCascaderOptions.forEach(item => {
if (item.value === 'UPF') {
neOtions.value = JSON.parse(JSON.stringify(item.children));
upfOtions.value = JSON.parse(JSON.stringify(item.children));
}
if (item.value === 'UDM') {
udmOtions.value = JSON.parse(JSON.stringify(item.children));
}
});
if (neOtions.value.length > 0) {
fnSelectNe(neOtions.value[0].value, neOtions.value[0]);
if (upfOtions.value.length > 0) {
fnSelectNe(upfOtions.value[0].value, upfOtions.value[0]);
}
if (udmOtions.value.length > 0) {
fnSelectUDM({ key: udmOtions.value[0].value });
@@ -382,7 +406,7 @@ onBeforeUnmount(() => {
<a-menu-item
v-for="v in udmOtions"
:key="v.value"
:disabled="udmNeId === v.value"
:disabled="udmNeUid === v.value"
>
{{ v.label }}
</a-menu-item>
@@ -535,8 +559,8 @@ onBeforeUnmount(() => {
t('views.dashboard.overview.upfFlow.title')
}}</span>
<a-select
v-model:value="upfWhoId"
:options="neOtions"
v-model:value="upfNeUId"
:options="upfOtions"
:get-Popup-Container="getPopupContainer"
class="toDeep"
style="width: 100px; color: #fff; margin-left: auto"