From 3dafe8d1f6743429b4cbd990fc066f35f848786c Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Tue, 23 Jul 2024 18:05:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=A1=AB?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/amfUE/index.vue | 30 ++++++++++++++++++++++++++--- src/views/dashboard/mmeUE/index.vue | 30 ++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/views/dashboard/amfUE/index.vue b/src/views/dashboard/amfUE/index.vue index 3ef696dc..6fa1066d 100644 --- a/src/views/dashboard/amfUE/index.vue +++ b/src/views/dashboard/amfUE/index.vue @@ -18,6 +18,7 @@ import saveAs from 'file-saver'; import PQueue from 'p-queue'; import useUserStore from '@/store/modules/user'; import { TENANTADMIN_ROLE_KEY } from '@/constants/admin-constants'; +import { listTenant } from '@/api/system/tenant'; const { t } = useI18n(); const { getDict } = useDictStore(); const ws = new WS(); @@ -42,6 +43,7 @@ let queryRangePicker = ref<[string, string]>(['', '']); /**查询参数 */ let queryParams = reactive({ + tenantNameArr: []>[], /**网元类型 */ neType: 'AMF', neId: '001', @@ -64,6 +66,7 @@ let queryParams = reactive({ function fnQueryReset() { eventTypes.value = []; queryParams = Object.assign(queryParams, { + tenantNameArr: [], eventType: '', imsi: '', tenantName: '', @@ -408,6 +411,11 @@ function wsMessage(res: Record) { } } +//自动完成框不区分大小写 +function filterOption(input: string, option: any) { + return option.value.toUpperCase().indexOf(input.toUpperCase()) >= 0; +} + onMounted(() => { // 初始字典数据 Promise.allSettled([ @@ -440,6 +448,21 @@ onMounted(() => { fnGetList(); }); + + //查询租户 + listTenant({ parentId: 0 }).then(res => { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + queryParams.tenantNameArr = []; //上面置为空数组时会报错 故在此 + res.data.forEach((item: any) => { + if (item.parentId === '0') { + queryParams.tenantNameArr.push({ + value: item.tenantName, + label: item.tenantName, + }); + } + }); + } + }); }); onBeforeUnmount(() => { @@ -487,10 +510,11 @@ onBeforeUnmount(() => { :label="t('views.neUser.sub.tenantName')" name="tenantName " > - + :options="queryParams.tenantNameArr" + :filter-option="filterOption" + > diff --git a/src/views/dashboard/mmeUE/index.vue b/src/views/dashboard/mmeUE/index.vue index 1d4cc235..e7c22012 100644 --- a/src/views/dashboard/mmeUE/index.vue +++ b/src/views/dashboard/mmeUE/index.vue @@ -16,6 +16,7 @@ import { parseDateToStr } from '@/utils/date-utils'; import { OptionsType, WS } from '@/plugins/ws-websocket'; import saveAs from 'file-saver'; import PQueue from 'p-queue'; +import { listTenant } from '@/api/system/tenant'; const { t } = useI18n(); const { getDict } = useDictStore(); @@ -41,6 +42,7 @@ let queryRangePicker = ref<[string, string]>(['', '']); /**查询参数 */ let queryParams = reactive({ + tenantNameArr: []>[], /**网元类型 */ neType: 'MME', neId: '001', @@ -63,6 +65,7 @@ let queryParams = reactive({ function fnQueryReset() { eventTypes.value = []; queryParams = Object.assign(queryParams, { + tenantNameArr:[], eventType: '', imsi: '', tenantName: '', @@ -407,6 +410,11 @@ function wsMessage(res: Record) { } } +//自动完成框不区分大小写 +function filterOption(input: string, option: any) { + return option.value.toUpperCase().indexOf(input.toUpperCase()) >= 0; +} + onMounted(() => { // 初始字典数据 Promise.allSettled([ @@ -429,6 +437,21 @@ onMounted(() => { // 获取列表数据 fnGetList(); }); + + //查询租户 + listTenant({ parentId: 0 }).then(res => { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + queryParams.tenantNameArr = []; //上面置为空数组时会报错 故在此 + res.data.forEach((item: any) => { + if (item.parentId === '0') { + queryParams.tenantNameArr.push({ + value: item.tenantName, + label: item.tenantName, + }); + } + }); + } + }); }); onBeforeUnmount(() => { @@ -476,10 +499,11 @@ onBeforeUnmount(() => { :label="t('views.neUser.sub.tenantName')" name="tenantName " > - + :options="queryParams.tenantNameArr" + :filter-option="filterOption" + >