feat:基站数修复以及资源模块下拉框修复
This commit is contained in:
@@ -115,17 +115,19 @@ function fnGetNeState() {
|
|||||||
|
|
||||||
/**获取概览信息 */
|
/**获取概览信息 */
|
||||||
async function fnGetSkim() {
|
async function fnGetSkim() {
|
||||||
|
let tempGnbSumNum = 0;
|
||||||
|
let tempEnbSumNum = 0;
|
||||||
const neHandlers = new Map([
|
const neHandlers = new Map([
|
||||||
// [
|
[
|
||||||
// 'UDM',
|
'UDM',
|
||||||
// {
|
{
|
||||||
// request: (neId: string) =>
|
request: (neId: string) =>
|
||||||
// listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }),
|
listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }),
|
||||||
// process: (res: any) =>
|
process: (res: any) =>
|
||||||
// res.code === RESULT_CODE_SUCCESS &&
|
res.code === RESULT_CODE_SUCCESS &&
|
||||||
// (skimState.udmSubNum += res.data.total),
|
(skimState.udmSubNum += res.data.total),
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
[
|
[
|
||||||
'SMF',
|
'SMF',
|
||||||
{
|
{
|
||||||
@@ -154,47 +156,102 @@ async function fnGetSkim() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// [
|
||||||
|
// 'AMF',
|
||||||
|
// {
|
||||||
|
// request: (neId: string) => listAMFNblist({ neId }),
|
||||||
|
// process: (res: any) => {
|
||||||
|
// if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
|
// skimState.gnbNum += res.data.length;
|
||||||
|
// skimState.gnbUeNum += res.data.reduce(
|
||||||
|
// (sum: number, item: any) => sum + item.ueNum,
|
||||||
|
// 0
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
[
|
[
|
||||||
'AMF',
|
'AMF',
|
||||||
{
|
{
|
||||||
request: (neId: string) => listAMFNblist({ neId }),
|
request: (neId: string) => listAMFNblist({ neId }),
|
||||||
process: (res: any) => {
|
process: async (res: any, neId: any) => {
|
||||||
|
console.log(neId)
|
||||||
if (res.code === RESULT_CODE_SUCCESS&& Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS&& Array.isArray(res.data)) {
|
||||||
skimState.gnbNum += res.data.length;
|
skimState.gnbNum += res.data.length;
|
||||||
skimState.gnbUeNum += res.data.reduce(
|
skimState.gnbUeNum += res.data.reduce(
|
||||||
(sum: number, item: any) => sum + item.ueNum,
|
(sum: number, item: any) => sum + item.ueNum,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
const amfNbRes = await listAMFNbStatelist({ neId });
|
||||||
|
console.log(amfNbRes)
|
||||||
|
if (
|
||||||
|
amfNbRes.code === RESULT_CODE_SUCCESS &&
|
||||||
|
Array.isArray(amfNbRes.data)
|
||||||
|
) {
|
||||||
|
// skimState.gNbSumNum += amfNbRes.data.length;
|
||||||
|
tempGnbSumNum += amfNbRes.data.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// [
|
||||||
|
// 'MME',
|
||||||
|
// {
|
||||||
|
// request: (neId: string) => listMMENblist({ neId }),
|
||||||
|
// process: (res: any) => {
|
||||||
|
// if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
|
// skimState.enbNum += res.data.length;
|
||||||
|
// skimState.enbUeNum += res.data.reduce(
|
||||||
|
// (sum: number, item: any) => sum + item.ueNum,
|
||||||
|
// 0
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
[
|
[
|
||||||
'MME',
|
'MME',
|
||||||
{
|
{
|
||||||
request: (neId: string) => listMMENblist({ neId }),
|
request: (neId: string) => listMMENblist({ neId }),
|
||||||
process: (res: any) => {
|
process: async (res: any, neId: any) => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
skimState.enbNum += res.data.length;
|
skimState.enbNum += res.data.length;
|
||||||
skimState.enbUeNum += res.data.reduce(
|
skimState.enbUeNum += res.data.reduce(
|
||||||
(sum: number, item: any) => sum + item.ueNum,
|
(sum: number, item: any) => sum + item.ueNum,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const mmeNbRes = await listMMENbStatelist({ neId });
|
||||||
|
console.log(mmeNbRes)
|
||||||
|
if (
|
||||||
|
mmeNbRes.code === RESULT_CODE_SUCCESS &&
|
||||||
|
Array.isArray(mmeNbRes.data)
|
||||||
|
) {
|
||||||
|
// skimState.eNbSumNum += mmeNbRes.data.length;
|
||||||
|
console.log(mmeNbRes)
|
||||||
|
tempEnbSumNum += mmeNbRes.data.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
console.log(neCascaderOptions)
|
||||||
|
|
||||||
const requests = neCascaderOptions.value.flatMap(
|
const requests = neCascaderOptions.value.flatMap(
|
||||||
(ne: any) =>
|
(ne: any) =>
|
||||||
ne.children
|
ne.children
|
||||||
?.map((child: any) => {
|
?.map((child: any) => {
|
||||||
|
console.log(child.neId)
|
||||||
const handler = neHandlers.get(child.neType);
|
const handler = neHandlers.get(child.neType);
|
||||||
return handler
|
return handler
|
||||||
? {
|
? {
|
||||||
promise: handler.request(child.neId),
|
promise: handler.request(child.neId),
|
||||||
process: handler.process,
|
process: handler.process,
|
||||||
|
neId: child.neId, // 这里加上neId
|
||||||
|
|
||||||
}
|
}
|
||||||
: null;
|
: null;
|
||||||
})
|
})
|
||||||
@@ -213,20 +270,33 @@ async function fnGetSkim() {
|
|||||||
enbNum: 0,
|
enbNum: 0,
|
||||||
enbUeNum: 0,
|
enbUeNum: 0,
|
||||||
});
|
});
|
||||||
results.forEach((result, index) => {
|
// results.forEach((result, index) => {
|
||||||
|
// if (result.status === 'fulfilled') {
|
||||||
|
// requests[index].process(result.value);
|
||||||
|
// } else {
|
||||||
|
// requests[index].process(0);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
const processPromises = results.map((result: any, index: any) => {
|
||||||
|
const req = requests[index];
|
||||||
if (result.status === 'fulfilled') {
|
if (result.status === 'fulfilled') {
|
||||||
requests[index].process(result.value);
|
return req.process(result.value, req.neId);
|
||||||
} else {
|
} else {
|
||||||
requests[index].process(0);
|
return req.process(0, req.neId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await Promise.all(processPromises);
|
||||||
|
skimState.gNbSumNum = tempGnbSumNum;
|
||||||
|
skimState.eNbSumNum = tempEnbSumNum;
|
||||||
|
|
||||||
// UDM
|
// UDM
|
||||||
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
|
// listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
// if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
skimState.udmSubNum = res.data.total;
|
// skimState.udmSubNum = res.data.total;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**初始数据函数 */
|
/**初始数据函数 */
|
||||||
@@ -320,6 +390,7 @@ async function fnSelectUDM(e: any) {
|
|||||||
}
|
}
|
||||||
/**资源控制-选择NE */
|
/**资源控制-选择NE */
|
||||||
function fnSelectNeRe(e: any) {
|
function fnSelectNeRe(e: any) {
|
||||||
|
console.log(e)
|
||||||
graphNodeClickID.value = e.key;
|
graphNodeClickID.value = e.key;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@@ -334,6 +405,7 @@ const getPopupContainer = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 获取网元网元列表
|
// 获取网元网元列表
|
||||||
neListStore.neCascaderOptions.forEach(item => {
|
neListStore.neCascaderOptions.forEach(item => {
|
||||||
|
console.log(item)
|
||||||
if (item.value === 'UPF') {
|
if (item.value === 'UPF') {
|
||||||
neOtions.value = JSON.parse(JSON.stringify(item.children));
|
neOtions.value = JSON.parse(JSON.stringify(item.children));
|
||||||
}
|
}
|
||||||
@@ -347,6 +419,9 @@ onMounted(() => {
|
|||||||
if (udmOtions.value.length > 0) {
|
if (udmOtions.value.length > 0) {
|
||||||
fnSelectUDM({ key: udmOtions.value[0].value });
|
fnSelectUDM({ key: udmOtions.value[0].value });
|
||||||
}
|
}
|
||||||
|
// if (onlineArr.length > 0) {
|
||||||
|
// fnSelectNeRe({ key: onlineArr[0].value });
|
||||||
|
// }
|
||||||
// 过滤不可用的网元
|
// 过滤不可用的网元
|
||||||
neCascaderOptions.value = neListStore.getNeCascaderOptions.filter(
|
neCascaderOptions.value = neListStore.getNeCascaderOptions.filter(
|
||||||
(item: any) => {
|
(item: any) => {
|
||||||
@@ -361,6 +436,35 @@ onMounted(() => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//online Ne
|
||||||
|
let onlineArr: Record<string, any>[] = [];
|
||||||
|
|
||||||
|
// UDM
|
||||||
|
neListStore.neList.forEach((v: any) => {
|
||||||
|
if (
|
||||||
|
v.status &&
|
||||||
|
[
|
||||||
|
'UDM',
|
||||||
|
'UPF',
|
||||||
|
'AUSF',
|
||||||
|
'PCF',
|
||||||
|
'SMF',
|
||||||
|
'AMF',
|
||||||
|
'OMC',
|
||||||
|
'SMSC',
|
||||||
|
'IMS',
|
||||||
|
'MME',
|
||||||
|
].includes(v.neType)
|
||||||
|
) {
|
||||||
|
onlineArr.push({
|
||||||
|
value: v.neType + '_' + v.neId,
|
||||||
|
label: v.neName,
|
||||||
|
rmUid: v.rmUid,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
onlineOtions.value = onlineArr;
|
||||||
|
|
||||||
initFlag = true;
|
initFlag = true;
|
||||||
fnGetSkim().then(() => {
|
fnGetSkim().then(() => {
|
||||||
loadData();
|
loadData();
|
||||||
|
|||||||
Reference in New Issue
Block a user