feat:Users添加默认显示,避免样式偏移

This commit is contained in:
zhongzm
2025-07-18 17:23:45 +08:00
parent 4c777245fc
commit 7432f1e237

View File

@@ -135,6 +135,14 @@ async function fnGetSkim() {
// (skimState.udmSubNum += res.total), // (skimState.udmSubNum += res.total),
// }, // },
// ], // ],
[
'UDM',
{
request: (neId: string) => listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }),
process: (res: any) =>
res.code === RESULT_CODE_SUCCESS && (skimState.udmSubNum = res.total),
},
],
[ [
'SMF', 'SMF',
{ {
@@ -216,7 +224,7 @@ async function fnGetSkim() {
// 重置 // 重置
Object.assign(skimState, { Object.assign(skimState, {
// udmSubNum: 0, udmSubNum: 0,
smfUeNum: 0, smfUeNum: 0,
imsUeNum: 0, imsUeNum: 0,
gnbNum: 0, gnbNum: 0,
@@ -240,11 +248,27 @@ async function fnGetSkim() {
skimState.eNbSumNum = tempEnbSumNum; skimState.eNbSumNum = tempEnbSumNum;
// UDM // UDM
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => { // UDM - 使用await确保同步处理
if (res.code === RESULT_CODE_SUCCESS) { // try {
skimState.udmSubNum = res.total; // const udmRes = await listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 });
} // if (udmRes.code === RESULT_CODE_SUCCESS) {
}); // skimState.udmSubNum = udmRes.total;
// } else {
// skimState.udmSubNum = 0;
// }
// } catch (error) {
// skimState.udmSubNum = 0;
// }
// UDM
// listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
// if (res.code === RESULT_CODE_SUCCESS) {
// skimState.udmSubNum = res.total;
// } else {
// skimState.udmSubNum = 0;
// }
// }).catch(() => {
// skimState.udmSubNum = 0;
// });
} }
@@ -317,13 +341,22 @@ let udmOtions = ref<Record<string, any>[]>([]);
let onlineOtions = ref<Record<string, any>[]>([]); let onlineOtions = ref<Record<string, any>[]>([]);
/**用户数量-选择UDM */ /**用户数量-选择UDM */
function fnSelectUDM(e: any) { async function fnSelectUDM(e: any) {
udmNeId.value = e.key; udmNeId.value = e.key;
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => { try {
const res = await listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 });
// 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.total; skimState.udmSubNum = res.total;
}else{
skimState.udmSubNum = 0;
}
// }).catch(() => {
// skimState.udmSubNum = 0;
// });
} catch (error) {
skimState.udmSubNum = 0;
} }
});
} }
/**资源控制-选择NE */ /**资源控制-选择NE */
function fnSelectNeRe(e: any) { function fnSelectNeRe(e: any) {
@@ -371,9 +404,17 @@ onMounted(() => {
}); });
udmOtions.value = arr1; udmOtions.value = arr1;
onlineOtions.value = onlineArr; onlineOtions.value = onlineArr;
// if (arr1.length > 0) {
// fnSelectUDM({ key: arr1[0].value });
// }
// 确保设置正确的udmNeId
if (arr1.length > 0) { if (arr1.length > 0) {
fnSelectUDM({ key: arr1[0].value }); udmNeId.value = arr1[0].value;
} }
// 移除单独的fnSelectUDM调用让fnGetSkim统一处理
// if (arr1.length > 0) {
// fnSelectUDM({ key: arr1[0].value });
// }
if (onlineArr.length > 0) { if (onlineArr.length > 0) {
fnSelectNeRe({ key: onlineArr[0].value }); fnSelectNeRe({ key: onlineArr[0].value });