租户SMF在线信息无需再选具体网元

This commit is contained in:
lai
2024-07-09 10:38:14 +08:00
parent 78c86be8a0
commit e8fefab74e

View File

@@ -19,6 +19,8 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**所有SMF */
totalType: <Record<string, any>[]>[],
/**网元ID */
neId: undefined,
/**IMSI */
@@ -29,20 +31,21 @@ let queryParams = reactive({
/**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
pageSize: 200,
});
/**查询参数重置 */
function fnQueryReset() {
queryParams = Object.assign(queryParams, {
totalType: [],
imsi: '',
msisdn: '',
pageNum: 1,
pageSize: 20,
pageSize: 200,
});
tablePagination.current = 1;
tablePagination.pageSize = 20;
fnGetList();
fnGetAllList();
}
/**表格状态类型 */
@@ -156,7 +159,7 @@ let tablePagination = reactive({
tablePagination.pageSize = pageSize;
queryParams.pageNum = page;
queryParams.pageSize = pageSize;
fnGetList();
fnGetAllList();
},
});
@@ -224,34 +227,59 @@ function fnModalCancel() {
modalState.visibleByView = false;
}
//接收响应信息
let promises = ref<any[]>([]);
/**查询列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
function fnGetAllList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if (pageNum) {
queryParams.pageNum = pageNum;
}
listUEInfoBySMF(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
}
tablePagination.total = res.total;
tableState.data = res.rows;
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.data = [];
promises.value = [];
//同时获取45G基站信息 且在每条信息中添加45G字段(原始数据没有) 已经筛选后的
queryParams.totalType.map((item: any) => {
promises.value.push(
listUEInfoBySMF({
neId: item.neId,
imsi: queryParams.imsi,
msisdn: queryParams.msisdn,
pageNum: queryParams.pageNum,
pageSize: 10000,
})
);
});
Promise.allSettled(promises.value).then(results => {
results.forEach(result => {
if (result.status === 'fulfilled') {
const allUeData = result.value;
if (
allUeData.code === RESULT_CODE_SUCCESS &&
Array.isArray(allUeData.rows)
) {
// 处理成功结果
tablePagination.total += allUeData.total;
tableState.data = [...tableState.data, ...allUeData.rows];
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.loading = false;
fnGetAllList(queryParams.pageNum - 1);
}
} else {
tablePagination.total = 0;
tableState.data = [];
}
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);
}
} else {
tablePagination.total = 0;
tableState.data = [];
}
tableState.loading = false;
});
});
}
@@ -264,10 +292,13 @@ onMounted(() => {
if (res.data.length > 0) {
let arr: Record<string, any>[] = [];
res.data.forEach(i => {
console.log(i);
if (i.neType === 'SMF') {
arr.push({ value: i.neId, label: i.neName });
queryParams.totalType.push(i);
}
});
neOtions.value = arr;
if (arr.length > 0) {
queryParams.neId = arr[0].value;
@@ -282,7 +313,7 @@ onMounted(() => {
})
.finally(() => {
// 获取列表数据
fnGetList();
fnGetAllList();
});
});
</script>
@@ -297,15 +328,6 @@ onMounted(() => {
<!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="8" :md="12" :xs="24">
<a-form-item :label="t('views.neUser.ue.neType')" name="neId ">
<a-select
v-model:value="queryParams.neId"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
</a-col>
<a-col :lg="8" :md="12" :xs="24">
<a-form-item label="IMSI" name="imsi">
<a-input v-model:value="queryParams.imsi" allow-clear></a-input>
@@ -320,7 +342,7 @@ onMounted(() => {
<a-col :lg="8" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList(1)">
<a-button type="primary" @click.prevent="fnGetAllList(1)">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
@@ -353,7 +375,7 @@ onMounted(() => {
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList()">
<a-button type="text" @click.prevent="fnGetAllList()">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>
@@ -420,7 +442,7 @@ onMounted(() => {
<!-- 详情框 -->
<ProModal
width="800px"
:width="800"
:visible="modalState.visibleByView"
:title="modalState.title"
@cancel="fnModalCancel"