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 );