From 8be1a8968e928a8a4344f5bd7f436b8bbcf8a324 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 21 Aug 2024 17:36:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=87=E7=AD=BE=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=87=B4=E5=85=A8=E5=B1=80=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/neUser/base5G/index.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/views/neUser/base5G/index.vue b/src/views/neUser/base5G/index.vue index e3f5bba9..162b0be9 100644 --- a/src/views/neUser/base5G/index.vue +++ b/src/views/neUser/base5G/index.vue @@ -225,11 +225,19 @@ onMounted(() => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.data.length > 0) { // 过滤不可用的网元 - neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( - (item: any) => { - return ['AMF', 'MME'].includes(item.value); + for (const item of neInfoStore.getNeCascaderOptions) { + if (!['AMF', 'MME'].includes(item.value)) continue; + const v = JSON.parse(JSON.stringify(item)); + + if (v.label === 'AMF') { + v.label = '5G'; } - ); + if (v.label === 'MME') { + v.label = '4G'; + } + neCascaderOptions.value.push(v); + } + if (neCascaderOptions.value.length === 0) { message.warning({ content: t('common.noData'), @@ -238,14 +246,8 @@ onMounted(() => { return; } - neCascaderOptions.value.forEach((item: any) => { - if (item.label === 'AMF') { - item.label = '5G'; - } else if (item.label === 'MME') item.label = '4G'; - }); - // 无查询参数neType时 默认选择AMF - const queryNeType = (route.query.neType as string) || 'AMF'; + const queryNeType = (route.query.neType as string) || '5G'; const item = neCascaderOptions.value.find( s => s.value === queryNeType );