diff --git a/src/views/tenant/ue/index.vue b/src/views/tenant/ue/index.vue index 2b185d96..651ad9b5 100644 --- a/src/views/tenant/ue/index.vue +++ b/src/views/tenant/ue/index.vue @@ -19,6 +19,8 @@ let neOtions = ref[]>([]); /**查询参数 */ let queryParams = reactive({ + /**所有SMF */ + totalType: []>[], /**网元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([]); + /**查询列表, 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[] = []; 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(); }); }); @@ -297,15 +328,6 @@ onMounted(() => { - - - - - @@ -320,7 +342,7 @@ onMounted(() => { - + {{ t('common.search') }} @@ -353,7 +375,7 @@ onMounted(() => { - + @@ -420,7 +442,7 @@ onMounted(() => {