From d3efefe7c519702dab210fa7de55df9b95a31951 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 7 May 2025 15:45:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AE=E7=BD=91=E5=85=83?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=89=B9=E6=9C=89=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 4 +- src/i18n/locales/zh-CN.ts | 2 +- src/layouts/BasicLayout.vue | 42 ++++-- src/router/index.ts | 125 ++---------------- src/router/routers.ts | 111 ++++++++++++++++ src/store/modules/{neinfo.ts => ne_list.ts} | 78 +++++++---- src/store/modules/router.ts | 59 ++++++++- src/typings/router.d.ts | 2 + src/views/dashboard/amfUE/index.vue | 56 ++++---- src/views/dashboard/imsCDR/index.vue | 52 ++++---- src/views/dashboard/mmeUE/index.vue | 54 ++++---- src/views/dashboard/overview/index.vue | 98 ++++++-------- src/views/dashboard/sgwcCDR/index.vue | 54 ++++---- src/views/dashboard/smfCDR/index.vue | 51 ++++--- src/views/dashboard/smfCDRByIMSI/index.vue | 52 ++++---- src/views/dashboard/smscCDR/index.vue | 55 ++++---- src/views/faultManage/active-alarm/index.vue | 16 +-- src/views/faultManage/event/index.vue | 14 +- src/views/faultManage/history-alarm/index.vue | 9 +- src/views/logManage/alarm/index.vue | 16 +-- src/views/logManage/forwarding/index.vue | 15 +-- src/views/mmlManage/neOperate/index.vue | 60 ++++----- src/views/mmlManage/omcOperate/index.vue | 51 +++---- src/views/mmlManage/udmOperate/index.vue | 56 +++----- src/views/ne/neConfig/index.vue | 58 ++++---- src/views/ne/neConfigBackup/index.vue | 28 +--- src/views/ne/neConfigHA/index.vue | 56 +++----- src/views/ne/neFile/index.vue | 24 +--- src/views/ne/neInfo/index.vue | 12 +- src/views/ne/neLicense/index.vue | 27 +--- .../neQuickSetup/components/NeInfoConfig.vue | 15 ++- src/views/ne/neQuickSetup/hooks/usePara5G.ts | 5 +- src/views/ne/neSoftware/index.vue | 34 ++--- src/views/ne/neVersion/index.vue | 29 +--- src/views/neData/base-online/index.vue | 85 +++++------- src/views/neData/base-station/list.vue | 62 ++++----- src/views/neData/base-station/topology.vue | 9 +- src/views/neData/ims-sub/index.vue | 58 ++++---- src/views/neData/pcf-sub/index.vue | 47 +++---- src/views/neData/smf-sub/index.vue | 49 +++---- src/views/neData/udm-auth/index.vue | 47 +++---- src/views/neData/udm-sub/index.vue | 47 +++---- src/views/neData/udm-voip/index.vue | 46 +++---- src/views/neData/udm-volte/index.vue | 59 +++------ src/views/neUser/n3iwf/index.vue | 47 +++---- src/views/neUser/nssf/index.vue | 13 +- src/views/perfManage/customTarget/index.vue | 43 +++--- src/views/perfManage/goldTarget/index.vue | 79 +++++------ src/views/perfManage/kpiCReport/index.vue | 101 ++++++-------- src/views/perfManage/kpiKeyTarget/index.vue | 40 +++--- src/views/perfManage/perfData/index.vue | 6 +- src/views/perfManage/perfThreshold/index.vue | 18 +-- src/views/perfManage/taskManage/index.vue | 32 ++--- src/views/tool/iperf/index.vue | 43 +++--- src/views/tool/ping/index.vue | 37 ++---- .../tool/terminal/components/hostList.vue | 27 ++-- src/views/traceManage/pcap/file.vue | 26 ++-- src/views/traceManage/task/index.vue | 46 +++---- 58 files changed, 1110 insertions(+), 1377 deletions(-) create mode 100644 src/router/routers.ts rename src/store/modules/{neinfo.ts => ne_list.ts} (52%) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index a54c4515..76034127 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -244,7 +244,7 @@ export default { }, error: { err403: { - ttile: 'No access', + ttile: 'No Access', subTitle:'Please do not perform illegal operations, you can go back to the main page or return to the', backHome: 'Back to Home', back: 'Back', @@ -1902,7 +1902,7 @@ export default { pathTip:`The accessed routing address, such as: user, /auth 1. If the network address requires internal access, start with http(s):// Menu behavior (root node): The current window opens the menu behavior, (non-root node) :Embedded window. 2. If the network address requires external access, set the internal address option to No. Menu behavior: Open a new tab 3. If the embedded subpage needs to hide the page, set the display status option to Hide address splicing to embed routing. address`, sonPage:'Subpage address', componentTip:' The component path accessed by views in the page component directory, such as: system/user/index Note: The routing address without the .vue file suffix is the network address and can be filled in as a link', - perms:`Permission identification example: monitor:server:query Permission identification is used in the back-end controller, such as:['monitor:server:query'] Permission identification is used in the front-end Vue page, such as: v-perms:has="['monitor:server:query']"` + perms:"Example of privilege identification:monitor:server:query If network element specific udm#service:query or udm+ims#service:query", }, dict:{ dictInfo:'Dictionary Type Information', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 577ec790..593d21c1 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1902,7 +1902,7 @@ export default { pathTip:`访问的路由地址,如:user、/auth 1. 如网络地址需内部访问 则以 http(s):// 开头菜单行为(根节点):当前窗口打开 菜单行为,(非根节点):内嵌窗口.2. 如网络地址需外部访问则将内部地址选项设为否菜单行为:打开新标签3. 如内嵌子页面需要隐藏页面则将显示状态选项设为隐藏地址拼接以内嵌路由地址`, sonPage:'子页面地址', componentTip:' 页面组件目录 views 访问的组件路径,如:system/user/index 注意:不带 .vue 文件后缀路由地址是网络地址可填入链接', - perms:`权限标识示例:monitor:server:query 后端控制器中使用权限标识,如:['monitor:server:query'] 前端vue页面中使用权限标识,如:v-perms:has="['monitor:server:query']"` + perms:"权限标识示例:monitor:server:query 若是网元特有udm#service:query 或udm+ims#service:query", }, dict:{ dictInfo:'字典类型信息', diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index 49231f06..0353d81b 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -21,6 +21,7 @@ import { import { useRouter } from 'vue-router'; import useLayoutStore from '@/store/modules/layout'; import useAppStore from '@/store/modules/app'; +import useNeListStore from '@/store/modules/ne_list'; import useRouterStore from '@/store/modules/router'; import useTabsStore from '@/store/modules/tabs'; import useI18n from '@/hooks/useI18n'; @@ -33,6 +34,7 @@ import { parseUrlPath } from '@/plugins/file-static-url'; const { proConfig, waterMarkContent } = useLayoutStore(); const { t, currentLocale } = useI18n(); const routerStore = useRouterStore(); +const neListStore = useNeListStore(); const tabsStore = useTabsStore(); const appStore = useAppStore(); const router = useRouter(); @@ -66,18 +68,36 @@ watch( ); // 动态路由添加到菜单面板 -const rootRoute = router.getRoutes().find(r => r.name === 'Root'); -if (rootRoute) { - const children = routerStore.setRootRouterData(rootRoute.children); - const buildRouterData = routerStore.buildRouterData; - if (buildRouterData.length > 0) { - rootRoute.children = children.concat(buildRouterData); - } else { - rootRoute.children = children; +// const rootRoute = router.getRoutes().find(r => r.name === 'Root'); +// if (rootRoute) { +// const children = routerStore.setRootRouterData(rootRoute.children); +// const buildRouterData = routerStore.buildRouterData; +// if (buildRouterData.length > 0) { +// rootRoute.children = children.concat(buildRouterData); +// } else { +// rootRoute.children = children; +// } +// } +// +// const { menuData } = getMenuData(clearMenuItem(router.getRoutes())); +// +const menuData = computed(() => { + const rootRoute = router.getRoutes().find(r => r.name === 'Root'); + if (rootRoute) { + const children = routerStore.setRootRouterData(rootRoute.children); + const buildRouterData = routerStore.buildRouterData; + if (buildRouterData.length > 0) { + rootRoute.children = children.concat(buildRouterData); + } else { + rootRoute.children = children; + } } -} - -const { menuData } = getMenuData(clearMenuItem(router.getRoutes())); + const neTypes = neListStore.getNeSelectOtions.map(v => v.value); + let routes = clearMenuItem(router.getRoutes()); + routes = routerStore.clearMenuItemByNeList(routes, neTypes); + const { menuData } = getMenuData(routes); + return menuData; +}); /**面包屑数据对象,排除根节点和首页不显示 */ const breadcrumb = computed(() => { diff --git a/src/router/index.ts b/src/router/index.ts index 6a2755d3..af5b4e2b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,128 +1,21 @@ +import NProgress from 'nprogress'; +import 'nprogress/nprogress.css'; import { createRouter, createWebHistory, createWebHashHistory, - RouteRecordRaw, } from 'vue-router'; -import NProgress from 'nprogress'; -import 'nprogress/nprogress.css'; -import BasicLayout from '../layouts/BasicLayout.vue'; -import BlankLayout from '../layouts/BlankLayout.vue'; +import { constantRoutes } from './routers'; import { getAccessToken } from '@/plugins/auth-token'; import { validHttp } from '@/utils/regular-utils'; import useUserStore from '@/store/modules/user'; import useAppStore from '@/store/modules/app'; +import useNeListStore from '@/store/modules/ne_list'; import useRouterStore from '@/store/modules/router'; // NProgress Configuration NProgress.configure({ showSpinner: false }); -// import { MetaRecord, MenuDataItem } from 'antdv-pro-layout'; -// mate数据类型 MetaRecord -// 根据/路径构建菜单列表,列表项类型 MenuDataItem -// https://github.com/vueComponent/pro-components/blob/a19279f3a28190bf11e8c36f316c92dbd3387a6d/packages/pro-layout/src/typings.ts#L16 -// 菜单图标来源 https://ant.design/components/icon 自定义iconfont - -/**公共路由 */ -const constantRoutes: RouteRecordRaw[] = [ - { - path: '/', - name: 'Root', - component: BasicLayout, - redirect: '/index', - children: [ - { - path: '/index', - name: 'Index', - meta: { title: 'router.index', icon: 'icon-pcduan' }, - component: () => import('@/views/index.vue'), - }, - { - path: '/account', - name: 'Account', - meta: { - title: 'router.account.index', - hideInMenu: true, - }, - component: BlankLayout, - redirect: '/account/settings', - children: [ - { - path: 'profile', - name: 'Profile', - meta: { title: 'router.account.profile', cache: true }, - component: () => import('@/views/account/profile.vue'), - }, - { - path: 'settings', - name: 'Settings', - meta: { title: 'router.account.settings', cache: true }, - component: () => import('@/views/account/settings.vue'), - }, - ], - }, - ], - }, - { - path: '/login', - name: 'Login', - meta: { title: 'router.login' }, - component: () => import('@/views/login.vue'), - }, - { - path: '/register', - name: 'Register', - meta: { title: 'router.register' }, - component: () => import('@/views/register.vue'), - }, - { - path: '/403', - name: 'NotPermission', - meta: { title: 'router.page403' }, - component: () => import('@/views/error/403.vue'), - }, - { - path: '/help', - name: 'HelpDoc', - meta: { title: 'router.helpDoc' }, - component: () => import('@/views/tool/help/index.vue'), - }, - { - path: '/trace-task-hlr', - name: 'TraceTaskHLR', - meta: { title: 'router.traceTaskHLR' }, - component: () => import('@/views/traceManage/task-hlr/index.vue'), - }, - { - path: '/quick-start', - name: 'QuickStart', - meta: { title: 'router.quickStart' }, - component: () => import('@/views/system/quick-start/index.vue'), - }, - { - path: '/lock-screen', - name: 'LockScreen', - meta: { title: 'router.lockScreen' }, - component: () => import('@/views/tool/lockScreen/index.vue'), - }, - { - path: '/redirect', - name: 'Redirect', - component: BasicLayout, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect/index.vue'), - }, - ], - }, - { - path: '/:pathMatch(.*)*', - meta: { title: 'router.page404' }, - component: () => import('@/views/error/404.vue'), - }, -]; - // 根据.env配置获取是否带井号和基础路径 const hasHash = import.meta.env.VITE_HISTORY_HASH; const bashUrl = import.meta.env.VITE_HISTORY_BASE_URL; @@ -202,14 +95,16 @@ router.beforeEach(async (to, from, next) => { // 有Token if (token) { - // 防止重复访问登录页面 if (to.path === '/login') { + // 防止重复访问登录页面 next({ name: 'Index' }); } else { // 判断当前用户是否有角色信息 const user = useUserStore(); if (user.roles && user.roles.length === 0) { try { + // 获取网元信息 + await useNeListStore().fnNelist(); // 获取用户信息 await user.fnGetInfo(); // 获取路由信息 @@ -230,6 +125,12 @@ router.beforeEach(async (to, from, next) => { await user.fnLogOut(); next({ name: 'Login' }); } + } else if ( + to.meta.neType && + to.meta.neType.length > 0 && + !useNeListStore().fnHasNe(to.meta.neType) + ) { + next({ name: 'NotPermission' }); } else { next(); } diff --git a/src/router/routers.ts b/src/router/routers.ts new file mode 100644 index 00000000..523a82fb --- /dev/null +++ b/src/router/routers.ts @@ -0,0 +1,111 @@ +import type { RouteRecordRaw } from 'vue-router'; +import BasicLayout from '../layouts/BasicLayout.vue'; +import BlankLayout from '../layouts/BlankLayout.vue'; + +// import { MetaRecord, MenuDataItem } from 'antdv-pro-layout'; +// mate数据类型 MetaRecord +// 根据/路径构建菜单列表,列表项类型 MenuDataItem +// https://github.com/vueComponent/pro-components/blob/a19279f3a28190bf11e8c36f316c92dbd3387a6d/packages/pro-layout/src/typings.ts#L16 +// 菜单图标来源 https://ant.design/components/icon 自定义iconfont + +/**公共路由 */ +export const constantRoutes: RouteRecordRaw[] = [ + { + path: '/', + name: 'Root', + component: BasicLayout, + redirect: '/index', + children: [ + { + path: '/index', + name: 'Index', + meta: { title: 'router.index', icon: 'icon-pcduan' }, + component: () => import('@/views/index.vue'), + }, + { + path: '/account', + name: 'Account', + meta: { + title: 'router.account.index', + hideInMenu: true, + }, + component: BlankLayout, + redirect: '/account/settings', + children: [ + { + path: 'profile', + name: 'Profile', + meta: { title: 'router.account.profile', cache: true }, + component: () => import('@/views/account/profile.vue'), + }, + { + path: 'settings', + name: 'Settings', + meta: { title: 'router.account.settings', cache: true }, + component: () => import('@/views/account/settings.vue'), + }, + ], + }, + ], + }, + + { + path: '/help', + name: 'HelpDoc', // 帮助文档 + meta: { title: 'router.helpDoc' }, + component: () => import('@/views/tool/help/index.vue'), + }, + { + path: '/trace-task-hlr', + name: 'TraceTaskHLR', // 跟踪任务HLR + meta: { title: 'router.traceTaskHLR', neType: ['HLR'] }, + component: () => import('@/views/traceManage/task-hlr/index.vue'), + }, + { + path: '/quick-start', + name: 'QuickStart', // 引导开站 + meta: { title: 'router.quickStart' }, + component: () => import('@/views/system/quick-start/index.vue'), + }, + { + path: '/lock-screen', + name: 'LockScreen', // 锁屏 + meta: { title: 'router.lockScreen' }, + component: () => import('@/views/tool/lockScreen/index.vue'), + }, + + { + path: '/login', + name: 'Login', // 登录页 + meta: { title: 'router.login' }, + component: () => import('@/views/login.vue'), + }, + { + path: '/register', + name: 'Register', // 注册页 + meta: { title: 'router.register' }, + component: () => import('@/views/register.vue'), + }, + { + path: '/403', + name: 'NotPermission', // 无权限 + meta: { title: 'router.page403' }, + component: () => import('@/views/error/403.vue'), + }, + { + path: '/redirect', + name: 'Redirect', + component: BasicLayout, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index.vue'), + }, + ], + }, + { + path: '/:pathMatch(.*)*', + meta: { title: 'router.page404' }, + component: () => import('@/views/error/404.vue'), + }, +]; diff --git a/src/store/modules/neinfo.ts b/src/store/modules/ne_list.ts similarity index 52% rename from src/store/modules/neinfo.ts rename to src/store/modules/ne_list.ts index ebf4cd9f..f16a9f18 100644 --- a/src/store/modules/neinfo.ts +++ b/src/store/modules/ne_list.ts @@ -1,29 +1,36 @@ import { defineStore } from 'pinia'; -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +import { + RESULT_CODE_SUCCESS, + RESULT_MSG_SUCCESS, +} from '@/constants/result-constants'; import { listAllNeInfo } from '@/api/ne/neInfo'; import { parseDataToOptions } from '@/utils/parse-tree-utils'; -import { getNePerformanceList } from '@/api/perfManage/taskManage'; -/**网元信息类型 */ -type NeInfo = { +/**网元列表信息类型 */ +type NeList = { /**网元列表 */ neList: Record[]; /**级联options树结构 */ neCascaderOptions: Record[]; /**选择器单级父类型 */ neSelectOtions: Record[]; - /**性能测量数据集 */ - perMeasurementList: Record[]; }; -const useNeInfoStore = defineStore('neinfo', { - state: (): NeInfo => ({ +const useNeListStore = defineStore('ne_list', { + state: (): NeList => ({ neList: [], neCascaderOptions: [], neSelectOtions: [], - perMeasurementList: [], }), getters: { + /** + * 网元列表 + * @param state 内部属性不用传入 + * @returns 级联options + */ + getNeList(state) { + return state.neList; + }, /** * 获取级联options树结构 * @param state 内部属性不用传入 @@ -35,7 +42,7 @@ const useNeInfoStore = defineStore('neinfo', { /** * 选择器单级父类型 * @param state 内部属性不用传入 - * @returns 级联options + * @returns 选择options */ getNeSelectOtions(state) { return state.neSelectOtions; @@ -43,19 +50,23 @@ const useNeInfoStore = defineStore('neinfo', { }, actions: { // 刷新网元列表 - async fnRefreshNelist() { + async fnNelistRefresh() { this.neList = []; - const res = await this.fnNelist(); - return res; + return await this.fnNelist(); }, // 获取网元列表 async fnNelist() { // 有数据不请求 if (this.neList.length > 0) { - return { code: RESULT_CODE_SUCCESS, data: this.neList, msg: 'success' }; + return { + code: RESULT_CODE_SUCCESS, + msg: RESULT_MSG_SUCCESS['en_US'], + data: this.neList, + }; } const res = await listAllNeInfo({ bandStatus: false, + bandHost: false, }); if (res.code === RESULT_CODE_SUCCESS) { // 原始列表 @@ -71,23 +82,38 @@ const useNeInfoStore = defineStore('neinfo', { this.neCascaderOptions = options; // 转选择器单级父类型 - this.neSelectOtions = options.map(item => item); + this.neSelectOtions = options.map(item => { + return { + label: item.label, + value: item.value, + }; + }); } return res; }, - // 获取性能测量数据集列表 - async fnNeTaskPerformance() { - // 有数据不请求 - if (this.perMeasurementList.length > 0) { - return { code: RESULT_CODE_SUCCESS, data: this.perMeasurementList, msg: 'success' }; + // 含有网元 + fnHasNe(metaNeType: string[]) { + if (this.neList.length > 0) { + const neTypes = this.neSelectOtions.map(item => item.value); + let match = false; // 匹配 + for (const netype of metaNeType) { + if (netype.indexOf('+') > -1) { + metaNeType = netype.split('+'); + match = true; + break; + } + } + + if (match) { + // 同时匹配 + return metaNeType.every(item => neTypes.includes(item)); + } + // 有一种 + return metaNeType.some(item => neTypes.includes(item)); } - const res = await getNePerformanceList(); - if (res.code === RESULT_CODE_SUCCESS) { - this.perMeasurementList = res.data; - } - return res; + return false; }, }, }); -export default useNeInfoStore; +export default useNeListStore; diff --git a/src/store/modules/router.ts b/src/store/modules/router.ts index ade7ef3b..4d8f3a6b 100644 --- a/src/store/modules/router.ts +++ b/src/store/modules/router.ts @@ -3,6 +3,7 @@ import type { RouteComponent, RouteLocationRaw, RouteMeta, + RouteRecord, RouteRecordRaw, } from 'vue-router'; import { getRouter } from '@/api/auth'; @@ -54,6 +55,62 @@ const useRouterStore = defineStore('router', { } return []; }, + /** + * 根据网元类型过滤菜单 + * @param routes 经过clearMenuItem(router.getRoutes())处理 + * @param neTypes 网元类型 + * @returns 过滤后的菜单 + */ + clearMenuItemByNeList( + routes: RouteRecord[] | RouteRecordRaw[], + neTypes: string[] + ): RouteRecordRaw[] { + return routes + .map((item: RouteRecord | RouteRecordRaw) => { + const finalItem = { ...item }; + // 过滤网元类型 + if ( + Array.isArray(finalItem.meta?.neType) && + finalItem.meta?.neType.length > 0 + ) { + let metaNeType: string[] = finalItem.meta.neType; + let match = false; // 匹配 + for (const netype of metaNeType) { + if (netype.indexOf('+') > -1) { + metaNeType = netype.split('+'); + match = true; + break; + } + } + + if (match && !metaNeType.every(item => neTypes.includes(item))) { + // 同时匹配 + return null; + } else if (!metaNeType.some(item => neTypes.includes(item))) { + // 有一种 + return null; + } + } + + // 有子菜单进行递归 + if (finalItem.children && finalItem.children.length > 0) { + const children = this.clearMenuItemByNeList( + finalItem.children, + neTypes + ); + // 如果子菜单都被过滤掉了,就不显示 + if (children.length === 0) { + return null; + } + finalItem.children = children; + return finalItem; + } + + delete finalItem.children; + return finalItem; + }) + .filter(item => item) as RouteRecordRaw[]; + }, }, }); @@ -77,7 +134,7 @@ type RecordRaws = { */ function buildRouters(recordRaws: RecordRaws[]): RouteRecordRaw[] { const routers: RouteRecordRaw[] = []; - for (const item of recordRaws) { + for (const item of recordRaws) { // 路由页面组件 let component: RouteComponent = {}; if (item.component) { diff --git a/src/typings/router.d.ts b/src/typings/router.d.ts index d3ab65fb..2b37b763 100644 --- a/src/typings/router.d.ts +++ b/src/typings/router.d.ts @@ -9,5 +9,7 @@ declare module 'vue-router' { permissions?: string[]; /**角色 */ roles?: string[]; + /**网元类型信息 */ + neType?: string[]; } } diff --git a/src/views/dashboard/amfUE/index.vue b/src/views/dashboard/amfUE/index.vue index 764a275d..27a5c1b9 100644 --- a/src/views/dashboard/amfUE/index.vue +++ b/src/views/dashboard/amfUE/index.vue @@ -11,7 +11,7 @@ import { RESULT_CODE_SUCCESS, } from '@/constants/result-constants'; import useDictStore from '@/store/modules/dict'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import { listAMFDataUE, delAMFDataUE, exportAMFDataUE } from '@/api/neData/amf'; import { parseDateToStr } from '@/utils/date-utils'; import { OptionsType, WS } from '@/plugins/ws-websocket'; @@ -22,6 +22,7 @@ import { useClipboard } from '@vueuse/core'; const { copy } = useClipboard({ legacy: true }); const { t } = useI18n(); const { getDict } = useDictStore(); +const neListStore = useNeListStore(); const ws = new WS(); const queue = new PQueue({ concurrency: 1, autoStart: true }); /**网元可选 */ @@ -463,36 +464,29 @@ onMounted(() => { }); // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'AMF') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'AMF') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } else { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + } + + // 获取列表数据 + fnGetList(); }); onBeforeUnmount(() => { @@ -564,7 +558,7 @@ onBeforeUnmount(() => { :label="t('views.dashboard.cdr.time')" name="queryRangePicker" > - { dict.cdrSipCodeCause = resArr[2].value; } }); + // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'IMS') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'IMS') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } else { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + } + + // 获取列表数据 + fnGetList(); }); onBeforeUnmount(() => { diff --git a/src/views/dashboard/mmeUE/index.vue b/src/views/dashboard/mmeUE/index.vue index 22fb90fb..0a5c4aac 100644 --- a/src/views/dashboard/mmeUE/index.vue +++ b/src/views/dashboard/mmeUE/index.vue @@ -12,7 +12,7 @@ import { RESULT_CODE_SUCCESS, } from '@/constants/result-constants'; import useDictStore from '@/store/modules/dict'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import { listMMEDataUE, delMMEDataUE, exportMMEDataUE } from '@/api/neData/mme'; import { parseDateToStr } from '@/utils/date-utils'; import { OptionsType, WS } from '@/plugins/ws-websocket'; @@ -22,6 +22,7 @@ import { useClipboard } from '@vueuse/core'; const { copy } = useClipboard({ legacy: true }); const { t } = useI18n(); const { getDict } = useDictStore(); +const neListStore = useNeListStore(); const ws = new WS(); const queue = new PQueue({ concurrency: 1, autoStart: true }); @@ -471,36 +472,29 @@ onMounted(() => { }); // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'MME') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'MME') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } else { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + } + + // 获取列表数据 + fnGetList(); }); onBeforeUnmount(() => { diff --git a/src/views/dashboard/overview/index.vue b/src/views/dashboard/overview/index.vue index 5f6241f1..2acdb29a 100644 --- a/src/views/dashboard/overview/index.vue +++ b/src/views/dashboard/overview/index.vue @@ -27,13 +27,13 @@ import useWS from './hooks/useWS'; import useAppStore from '@/store/modules/app'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { useRouter } from 'vue-router'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import { message } from 'ant-design-vue'; import { upfWhoId } from './hooks/useWS'; -const neInfoStore = useNeInfoStore(); const router = useRouter(); const appStore = useAppStore(); +const neListStore = useNeListStore(); const { t } = useI18n(); const { wsSend, userActivitySend, upfTFSend, reSendUPF } = useWS(); @@ -289,63 +289,39 @@ const getPopupContainer = () => { }; onMounted(() => { - neInfoStore - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - // UPF - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'UPF') { - arr.push({ value: v.neId, label: v.neName, rmUid: v.rmUid }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - //queryParams.neRealId = arr[0].value; - fnSelectNe(arr[0].value, arr[0]); - } - - // UDM - let arr1: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'UDM') { - arr1.push({ value: v.neId, label: v.neName, rmUid: v.rmUid }); - } - }); - udmOtions.value = arr1; - if (arr1.length > 0) { - fnSelectUDM({ key: arr1[0].value }); - } - - // 过滤不可用的网元 - neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( - (item: any) => { - return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value); - } - ); - if (neCascaderOptions.value.length === 0) { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - return; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - initFlag = true; - fnGetSkim().then(() => { - loadData(); - }); + // 获取网元网元列表 + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'UPF') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + if (item.value === 'UDM') { + udmOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length > 0) { + fnSelectNe(neOtions.value[0].value, neOtions.value[0]); + } + if (udmOtions.value.length > 0) { + fnSelectUDM({ key: udmOtions.value[0].value }); + } + // 过滤不可用的网元 + neCascaderOptions.value = neListStore.getNeCascaderOptions.filter( + (item: any) => { + return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value); + } + ); + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + + initFlag = true; + fnGetSkim().then(() => { + loadData(); + }); }); onBeforeUnmount(() => { @@ -399,7 +375,11 @@ onBeforeUnmount(() => { @@ -392,7 +393,7 @@ onMounted(() => { - + @@ -422,7 +423,7 @@ onMounted(() => { {{ t('views.ne.common.ipAddrTip') }} - + @@ -447,7 +448,7 @@ onMounted(() => { - + diff --git a/src/views/ne/neQuickSetup/hooks/usePara5G.ts b/src/views/ne/neQuickSetup/hooks/usePara5G.ts index fb296f48..4abcbefb 100644 --- a/src/views/ne/neQuickSetup/hooks/usePara5G.ts +++ b/src/views/ne/neQuickSetup/hooks/usePara5G.ts @@ -1,7 +1,8 @@ import { reactive, toRaw } from 'vue'; import { getPara5GFilee, savePara5GFile, updateNeInfo } from '@/api/ne/neInfo'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +const neListStore = useNeListStore(); /**对象信息信息状态类型 */ type StateType = { @@ -37,7 +38,7 @@ export function usePara5G() { /**载入数据*/ function fnReloadData() { state.confirmLoading = true; - Promise.all([getPara5GFilee(), useNeInfoStore().fnRefreshNelist()]).then( + Promise.all([getPara5GFilee(), neListStore.fnNelistRefresh()]).then( resArr => { // 已保存的配置 if (resArr[0].code === RESULT_CODE_SUCCESS) { diff --git a/src/views/ne/neSoftware/index.vue b/src/views/ne/neSoftware/index.vue index 6c3ee20a..d7020a29 100644 --- a/src/views/ne/neSoftware/index.vue +++ b/src/views/ne/neSoftware/index.vue @@ -4,14 +4,14 @@ import { PageContainer } from 'antdv-pro-layout'; import { Modal, TableColumnsType, message } from 'ant-design-vue/es'; import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; -import { NE_TYPE_LIST } from '@/constants/ne-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { listNeSoftware, delNeSoftware } from '@/api/ne/neSoftware'; import { parseDateToStr } from '@/utils/date-utils'; import { downloadFile } from '@/api/tool/file'; import { saveAs } from 'file-saver'; +const neListStore = useNeListStore(); const { t } = useI18n(); // 异步加载组件 @@ -22,9 +22,6 @@ const UploadMoreFile = defineAsyncComponent( () => import('./components/UploadMoreFile.vue') ); -/**网元参数 */ -let neOtions = ref[]>([]); - /**查询参数 */ let queryParams = reactive({ /**网元类型 */ @@ -127,7 +124,7 @@ let tableColumns = ref([ if (!opt.value) return ''; return parseDateToStr(opt.value); }, - width: 150, + width: 200, }, { title: t('common.operate'), @@ -191,7 +188,7 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeSoftware(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { + if (res.code === RESULT_CODE_SUCCESS) { const { total, rows } = res.data; tablePagination.total = total; tableState.data = rows; @@ -335,23 +332,8 @@ function fnRecordMore(type: string | number, row: Record) { } onMounted(() => { - // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - neOtions.value = useNeInfoStore().getNeSelectOtions; - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); - }); + // 获取列表数据 + fnGetList(); }); @@ -369,7 +351,7 @@ onMounted(() => { @@ -505,7 +487,7 @@ onMounted(() => { :data-source="tableState.data" :size="tableState.size" :pagination="tablePagination" - :scroll="{ x: tableColumns.length * 150 }" + :scroll="{ x: tableColumns.length * 180 }" @resizeColumn="(w:number, col:any) => (col.width = w)" :row-selection="{ type: 'checkbox', diff --git a/src/views/ne/neVersion/index.vue b/src/views/ne/neVersion/index.vue index ebc7ea8b..8242cf65 100644 --- a/src/views/ne/neVersion/index.vue +++ b/src/views/ne/neVersion/index.vue @@ -10,8 +10,7 @@ import { } from 'ant-design-vue/es'; import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; -import useNeInfoStore from '@/store/modules/neinfo'; -import { NE_TYPE_LIST } from '@/constants/ne-constants'; +import useNeListStore from '@/store/modules/ne_list'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { listNeVersion, operateNeVersion } from '@/api/ne/neVersion'; import { parseDateToStr } from '@/utils/date-utils'; @@ -19,6 +18,7 @@ import useI18n from '@/hooks/useI18n'; import useDictStore from '@/store/modules/dict'; import useMaskStore from '@/store/modules/mask'; const maskStore = useMaskStore(); +const neListStore = useNeListStore(); const { t } = useI18n(); const { getDict } = useDictStore(); @@ -33,9 +33,6 @@ const UploadMoreFile = defineAsyncComponent( /**字典数据-状态 */ let dictStatus = ref([]); -/**网元参数 */ -let neOtions = ref[]>([]); - /**查询参数 */ let queryParams = reactive({ /**网元类型 */ @@ -151,7 +148,7 @@ let tableColumns = ref([ if (!opt.value) return ''; return parseDateToStr(opt.value); }, - width: 150, + width: 200, }, { title: t('common.operate'), @@ -441,21 +438,9 @@ async function fnRecordUpgrade() { onMounted(() => { // 初始字典数据 - getDict('ne_version_status').then(res => { - dictStatus.value = res; - }); - // 获取网元网元列表 - useNeInfoStore() - .fnNelist() + getDict('ne_version_status') .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - neOtions.value = useNeInfoStore().getNeSelectOtions; - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } + dictStatus.value = res; }) .finally(() => { // 获取列表数据 @@ -478,7 +463,7 @@ onMounted(() => { @@ -607,7 +592,7 @@ onMounted(() => { :data-source="tableState.data" :size="tableState.size" :pagination="tablePagination" - :scroll="{ x: tableColumns.length * 120 }" + :scroll="{ x: tableColumns.length * 150 }" @resizeColumn="(w:number, col:any) => (col.width = w)" :row-selection="{ type: 'checkbox', diff --git a/src/views/neData/base-online/index.vue b/src/views/neData/base-online/index.vue index 9843b1f5..10bc0152 100644 --- a/src/views/neData/base-online/index.vue +++ b/src/views/neData/base-online/index.vue @@ -6,11 +6,11 @@ import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import { useRoute } from 'vue-router'; import { listAMFNblist } from '@/api/neData/amf'; import { listMMENblist } from '@/api/neData/mme'; -const neInfoStore = useNeInfoStore(); +const neListStore = useNeListStore(); const route = useRoute(); const { t } = useI18n(); @@ -264,57 +264,40 @@ function fnGetList(pageNum?: number) { onMounted(() => { // 获取网元网元列表 - neInfoStore - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - // 过滤不可用的网元 - for (const item of neInfoStore.getNeCascaderOptions) { - if (!['AMF', 'MME'].includes(item.value)) continue; - const v = JSON.parse(JSON.stringify(item)); + for (const item of neListStore.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'), - duration: 2, - }); - return; - } - - // 无查询参数neType时 默认选择AMF - const queryNeType = (route.query.neType as string) || '5G'; - const item = neCascaderOptions.value.find( - s => s.value === queryNeType - ); - if (item && item.children) { - const info = item.children[0]; - queryParams.neType = [info.neType, info.neId]; - } else { - const info = neCascaderOptions.value[0].children[0]; - queryParams.neType = [info.neType, info.neId]; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + 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'), + duration: 2, }); + return; + } + + // 无查询参数neType时 默认选择AMF + const queryNeType = (route.query.neType as string) || '5G'; + const item = neCascaderOptions.value.find(s => s.value === queryNeType); + if (item && item.children) { + const info = item.children[0]; + queryParams.neType = [info.neType, info.neId]; + } else { + const info = neCascaderOptions.value[0].children[0]; + queryParams.neType = [info.neType, info.neId]; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/base-station/list.vue b/src/views/neData/base-station/list.vue index 4a233e76..abd347fd 100644 --- a/src/views/neData/base-station/list.vue +++ b/src/views/neData/base-station/list.vue @@ -12,7 +12,7 @@ import { SizeType } from 'ant-design-vue/es/config-provider'; import { ColumnsType } from 'ant-design-vue/es/table'; import { ProModal } from 'antdv-pro-modal'; import UploadModal from '@/components/UploadModal/index.vue'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; const { t, currentLocale } = useI18n(); import { @@ -32,6 +32,8 @@ import saveAs from 'file-saver'; import { readSheet, writeSheet } from '@/utils/execl-utils'; import { useRoute } from 'vue-router'; const route = useRoute(); +const neListStore = useNeListStore(); + // 异步加载组件 const HistoryModal = defineAsyncComponent( () => import('./components/history.vue') @@ -655,40 +657,32 @@ async function fnModalImportTemplate() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - useNeInfoStore().neCascaderOptions.forEach(item => { - if (['AMF', 'MME'].includes(item.value)) { - arr.push(JSON.parse(JSON.stringify(item))); - } - }); - neCascaderOptions.value = arr; - // 无查询参数neType时 默认选择AMF - const queryNeType = (route.query.neType as string) || 'AMF'; - const item = arr.find(s => s.value === queryNeType); - if (item && item.children) { - const info = item.children[0]; - neTypeAndId.value = [info.neType, info.neId]; - } else { - const info = neCascaderOptions.value[0].children[0]; - neTypeAndId.value = [info.neType, info.neId]; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (['AMF', 'MME'].includes(item.value)) { + neCascaderOptions.value.push(JSON.parse(JSON.stringify(item))); + } + }); + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + + // 无查询参数neType时 默认选择AMF + const queryNeType = (route.query.neType as string) || 'AMF'; + const item = neCascaderOptions.value.find(s => s.value === queryNeType); + if (item && item.children) { + const info = item.children[0]; + neTypeAndId.value = [info.neType, info.neId]; + } else { + const info = neCascaderOptions.value[0].children[0]; + neTypeAndId.value = [info.neType, info.neId]; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/base-station/topology.vue b/src/views/neData/base-station/topology.vue index 6c83a55d..617b889a 100644 --- a/src/views/neData/base-station/topology.vue +++ b/src/views/neData/base-station/topology.vue @@ -5,7 +5,7 @@ import { listAMFNbStatelist } from '@/api/neData/amf'; import { parseBasePath } from '@/plugins/file-static-url'; import { edgeLineAnimateState } from '@/views/monitor/topologyBuild/hooks/registerEdge'; import { nodeImageAnimateState } from '@/views/monitor/topologyBuild/hooks/registerNode'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { stateNeInfo } from '@/api/ne/neInfo'; @@ -13,6 +13,7 @@ import { parseDateToStr } from '@/utils/date-utils'; import { useFullscreen } from '@vueuse/core'; import { listMMENbStatelist } from '@/api/neData/mme'; const { t } = useI18n(); +const neListStore = useNeListStore(); /**图DOM节点实例对象 */ const graphG6Dom = useTemplateRef('graphG6Dom'); @@ -358,9 +359,7 @@ function handleRanderGraph(container: HTMLElement | null, data: GraphData) { /** * 获取图组数据渲染到画布 */ -async function fnGraphDataLoad() { - // 加载基础网元 - await useNeInfoStore().fnNelist(); +async function fnGraphDataLoad() { const dataNe = await fnGraphDataBase(); Object.assign(graphData, dataNe); graphG6.value = handleRanderGraph(graphG6Dom.value, dataNe); @@ -381,7 +380,7 @@ async function fnGraphDataBase() { edges: [], }; // 添加基础网元 - for (const item of useNeInfoStore().getNeSelectOtions) { + for (const item of neListStore.getNeSelectOtions) { if ('OMC' === item.value) { if (item.children?.length === 0) continue; // 是否存在OMC保证唯一 diff --git a/src/views/neData/ims-sub/index.vue b/src/views/neData/ims-sub/index.vue index 535e3353..7280b693 100644 --- a/src/views/neData/ims-sub/index.vue +++ b/src/views/neData/ims-sub/index.vue @@ -5,11 +5,12 @@ import { message } from 'ant-design-vue/es'; import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/es/table'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { listIMSSessionList } from '@/api/neData/ims'; const { t } = useI18n(); +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -147,13 +148,13 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listIMSSessionList(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; } - tablePagination.total = res.data.length; - tableState.data = res.data; + tablePagination.total = res.data.length; + tableState.data = res.data; if ( tablePagination.total <= (queryParams.pageNum - 1) * tablePagination.pageSize && @@ -172,33 +173,24 @@ function fnGetList(pageNum?: number) { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'IMS') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'IMS') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); @@ -223,7 +215,11 @@ onMounted(() => { - + diff --git a/src/views/neData/pcf-sub/index.vue b/src/views/neData/pcf-sub/index.vue index 66e96587..3ab67cd7 100644 --- a/src/views/neData/pcf-sub/index.vue +++ b/src/views/neData/pcf-sub/index.vue @@ -6,7 +6,7 @@ import { message, Modal, Form, TableColumnsType } from 'ant-design-vue/es'; import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import UploadModal from '@/components/UploadModal/index.vue'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { addPCFRule, @@ -21,7 +21,7 @@ import { uploadFileToNE } from '@/api/tool/file'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { saveAs } from 'file-saver'; const { t } = useI18n(); - +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -693,33 +693,24 @@ function fnModalDownloadImportTemplate() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'PCF') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'PCF') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/smf-sub/index.vue b/src/views/neData/smf-sub/index.vue index 00e81220..f85baf68 100644 --- a/src/views/neData/smf-sub/index.vue +++ b/src/views/neData/smf-sub/index.vue @@ -7,11 +7,11 @@ import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/es/table'; import { listSMFSubList } from '@/api/neData/smf'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; const { t } = useI18n(); - +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -225,7 +225,7 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listSMFSubList(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { + if (res.code === RESULT_CODE_SUCCESS) { const { total, rows } = res.data; tablePagination.total = total; tableState.data = rows; @@ -247,33 +247,24 @@ function fnGetList(pageNum?: number) { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'SMF') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'SMF') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/udm-auth/index.vue b/src/views/neData/udm-auth/index.vue index 4b759502..7d3fac51 100644 --- a/src/views/neData/udm-auth/index.vue +++ b/src/views/neData/udm-auth/index.vue @@ -8,7 +8,7 @@ import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/es/table'; import UploadModal from '@/components/UploadModal/index.vue'; import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { saveAs } from 'file-saver'; @@ -27,7 +27,7 @@ import { import { uploadFile } from '@/api/tool/file'; import { getNeViewFile } from '@/api/tool/neFile'; const { t } = useI18n(); - +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -739,33 +739,24 @@ function fnModalDownloadImportTemplate() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'UDM') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'UDM') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/udm-sub/index.vue b/src/views/neData/udm-sub/index.vue index 8ef6cd0c..0eb3a9ea 100644 --- a/src/views/neData/udm-sub/index.vue +++ b/src/views/neData/udm-sub/index.vue @@ -8,7 +8,7 @@ import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/es/table'; import UploadModal from '@/components/UploadModal/index.vue'; import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import saveAs from 'file-saver'; @@ -27,7 +27,7 @@ import { import { uploadFile } from '@/api/tool/file'; import { getNeViewFile } from '@/api/tool/neFile'; const { t } = useI18n(); - +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -1130,33 +1130,24 @@ async function fnModalDownloadImportTemplate() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'UDM') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'UDM') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/udm-voip/index.vue b/src/views/neData/udm-voip/index.vue index 6d2288b6..115cc618 100644 --- a/src/views/neData/udm-voip/index.vue +++ b/src/views/neData/udm-voip/index.vue @@ -22,14 +22,13 @@ import { listUDMVOIP, resetUDMVOIP, } from '@/api/neData/udm_voip'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { saveAs } from 'file-saver'; import { uploadFileToNE } from '@/api/tool/file'; - const { t } = useI18n(); - +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -540,31 +539,24 @@ function fnModalDownloadImportTemplate() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS && res.data?.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'UDM') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'UDM') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neData/udm-volte/index.vue b/src/views/neData/udm-volte/index.vue index c96b44ae..296591d2 100644 --- a/src/views/neData/udm-volte/index.vue +++ b/src/views/neData/udm-volte/index.vue @@ -12,17 +12,7 @@ import { import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import UploadModal from '@/components/UploadModal/index.vue'; -import { - addUDMVOIP, - batchAddUDMVOIP, - batchDelUDMVOIP, - delUDMVOIP, - exportUDMVOIP, - importUDMVOIP, - listUDMVOIP, - resetUDMVOIP, -} from '@/api/neData/udm_voip'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { saveAs } from 'file-saver'; @@ -33,12 +23,12 @@ import { batchDelUDMVolteIMS, delUDMVolteIMS, exportUDMVolteIMS, + importUDMVolteIMS, listUDMVolteIMS, resetUDMVolteIMS, } from '@/api/neData/udm_volte_ims'; - const { t } = useI18n(); - +const neListStore = useNeListStore(); /**字典数据 */ let dict: { /**Tag标签类型 0=VoIP, 1=VoLTE */ @@ -554,7 +544,7 @@ function fnModalUploadImportUpload(file: File) { uploadFileToNE('UDM', neID, file, 5) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { - return importUDMVOIP({ + return importUDMVolteIMS({ neId: neID, uploadPath: res.data, }); @@ -601,31 +591,24 @@ function fnModalDownloadImportTemplate() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS && res.data?.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'UDM') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'UDM') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neUser/n3iwf/index.vue b/src/views/neUser/n3iwf/index.vue index 513bf7e9..e4116adc 100644 --- a/src/views/neUser/n3iwf/index.vue +++ b/src/views/neUser/n3iwf/index.vue @@ -6,11 +6,11 @@ import { SizeType } from 'ant-design-vue/es/config-provider'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/es/table'; import { listN3iwf } from '@/api/neUser/n3iwf'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; const { t } = useI18n(); - +const neListStore = useNeListStore(); /**网元参数 */ let neOtions = ref[]>([]); @@ -104,33 +104,24 @@ function fnGetList() { onMounted(() => { // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - let arr: Record[] = []; - res.data.forEach((v: any) => { - if (v.neType === 'N3IWF') { - arr.push({ value: v.neId, label: v.neName }); - } - }); - neOtions.value = arr; - if (arr.length > 0) { - queryParams.neId = arr[0].value; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neListStore.neCascaderOptions.forEach(item => { + if (item.value === 'N3IWF') { + neOtions.value = JSON.parse(JSON.stringify(item.children)); + } + }); + if (neOtions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, }); + return; + } + if (neOtions.value.length > 0) { + queryParams.neId = neOtions.value[0].value; + } + + // 获取列表数据 + fnGetList(); }); diff --git a/src/views/neUser/nssf/index.vue b/src/views/neUser/nssf/index.vue index f1a738af..b92b1e52 100644 --- a/src/views/neUser/nssf/index.vue +++ b/src/views/neUser/nssf/index.vue @@ -1,19 +1,14 @@ @@ -727,7 +719,7 @@ onMounted(() => { @@ -890,7 +882,7 @@ onMounted(() => { @@ -1007,7 +999,7 @@ onMounted(() => { > ) { /**钩子函数,界面打开初始化*/ onMounted(() => { // 获取网元网元列表 - neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - // 过滤不可用的网元 - for (const item of neInfoStore.getNeCascaderOptions) { - neCascaderOptions.value.push(item); - } - - if (neCascaderOptions.value.length === 0) { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - return; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }); + for (const item of neListStore.getNeCascaderOptions) { + neCascaderOptions.value.push(item); // 过滤不可用的网元 + } + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + return; + } }); /**钩子函数,界面关闭*/ diff --git a/src/views/tool/ping/index.vue b/src/views/tool/ping/index.vue index 9190eb17..b3b1882e 100644 --- a/src/views/tool/ping/index.vue +++ b/src/views/tool/ping/index.vue @@ -8,9 +8,9 @@ import { RESULT_CODE_SUCCESS, } from '@/constants/result-constants'; import TerminalSSHView from '@/components/TerminalSSHView/index.vue'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import { pingV } from '@/api/tool/ping'; -const neInfoStore = useNeInfoStore(); +const neListStore = useNeListStore(); const { t } = useI18n(); /**网元参数 */ @@ -187,29 +187,16 @@ function fnMessage(res: Record) { /**钩子函数,界面打开初始化*/ onMounted(() => { // 获取网元网元列表 - neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - // 过滤不可用的网元 - for (const item of neInfoStore.getNeCascaderOptions) { - neCascaderOptions.value.push(item); - } - - if (neCascaderOptions.value.length === 0) { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - return; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } - }); + for (const item of neListStore.getNeCascaderOptions) { + neCascaderOptions.value.push(item); // 过滤不可用的网元 + } + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + return; + } }); /**钩子函数,界面关闭*/ diff --git a/src/views/tool/terminal/components/hostList.vue b/src/views/tool/terminal/components/hostList.vue index 2b014e67..de413ab7 100644 --- a/src/views/tool/terminal/components/hostList.vue +++ b/src/views/tool/terminal/components/hostList.vue @@ -5,14 +5,16 @@ import { ColumnsType } from 'ant-design-vue/es/table'; import { Modal, message } from 'ant-design-vue/es'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { delNeHost, listNeHost } from '@/api/ne/neHost'; +import useNeListStore from '@/store/modules/ne_list'; import useDictStore from '@/store/modules/dict'; import useI18n from '@/hooks/useI18n'; +const neListStore = useNeListStore(); const { getDict } = useDictStore(); const { t } = useI18n(); const EditModal = defineAsyncComponent( () => import('@/views/ne/neHost/components/EditModal.vue') ); -const emit = defineEmits(['modal','link']); +const emit = defineEmits(['modal', 'link']); /**字典数据 */ let dict: { @@ -35,7 +37,7 @@ let queryParams = reactive({ /**分组 */ groupId: undefined, /**名称 */ - title: '', + title: 'OMC', /**当前页数 */ pageNum: 1, /**每页条数 */ @@ -144,7 +146,7 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } listNeHost(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { + if (res.code === RESULT_CODE_SUCCESS) { const { total, rows } = res.data; tablePagination.total = total; tableState.data = rows; @@ -185,7 +187,7 @@ let modalState: ModalStateType = reactive({ function fnModalVisibleByEdit(roleId?: undefined) { modalState.id = roleId; modalState.openByEdit = true; - emit('modal'); + emit('modal'); } /** @@ -286,7 +288,17 @@ onMounted(() => { - + { - + diff --git a/src/views/traceManage/pcap/file.vue b/src/views/traceManage/pcap/file.vue index c250c630..c52bfbb3 100644 --- a/src/views/traceManage/pcap/file.vue +++ b/src/views/traceManage/pcap/file.vue @@ -8,13 +8,13 @@ import { parseDateToStr } from '@/utils/date-utils'; import { getNeDirZip, getNeFile, listNeFiles } from '@/api/tool/neFile'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import ViewDrawer from '@/views/ne/neFile/components/ViewDrawer.vue'; -import useNeInfoStore from '@/store/modules/neinfo'; +import useNeListStore from '@/store/modules/ne_list'; import useTabsStore from '@/store/modules/tabs'; import useI18n from '@/hooks/useI18n'; import saveAs from 'file-saver'; import { useRoute, useRouter } from 'vue-router'; const tabsStore = useTabsStore(); -const neInfoStore = useNeInfoStore(); +const neListStore = useNeListStore(); const { t } = useI18n(); const route = useRoute(); const router = useRouter(); @@ -333,20 +333,10 @@ function fnDrawerOpen(row: Record) { } onMounted(() => { - // 获取网元网元列表 - neInfoStore.fnNelist().then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length === 0) { - message.warning({ - content: t('common.noData'), - duration: 2, - }); - } else if (routeParams.neType && routeParams.neId) { - neTypeSelect.value = [routeParams.neType, routeParams.neId]; - fnNeChange(neTypeSelect.value, undefined); - } - } - }); + if (routeParams.neType && routeParams.neId) { + neTypeSelect.value = [routeParams.neType, routeParams.neId]; + fnNeChange(neTypeSelect.value, undefined); + } }); @@ -366,7 +356,7 @@ onMounted(() => { {{ t('views.logManage.neFile.neType') }}:  { {{ t('common.downloadText') }} - + { ); // 获取网元网元列表 - useNeInfoStore() - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - if (res.data.length > 0) { - // 过滤不可用的网元 - neCascaderOptions.value = neInfoStore.getNeSelectOtions.filter( - (item: any) => { - return ['AMF', 'AUSF', 'SMF', 'UDM', 'PCF'].includes(item.value); - } - ); - if (neCascaderOptions.value.length === 0) { - message.warning({ - content: t('common.noData'), - duration: 3, - }); - return; - } - } - } else { - message.warning({ - content: t('common.noData'), - duration: 3, - }); - } - }) - .finally(() => { - // 获取列表数据 - fnGetList(); + neCascaderOptions.value = neListStore.getNeSelectOtions.filter( + (item: any) => { + return ['AMF', 'AUSF', 'SMF', 'UDM', 'PCF'].includes(item.value); // 过滤不可用的网元 + } + ); + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 3, }); + return; + } + // 获取列表数据 + fnGetList(); });