fix: 网元特定排序添加SMSC

This commit is contained in:
TsMask
2024-05-14 17:24:50 +08:00
parent 7278e24dce
commit 6d5b9f417c
6 changed files with 29 additions and 43 deletions

View File

@@ -5,6 +5,7 @@ import {
} from '@/constants/result-constants'; } from '@/constants/result-constants';
import { language, request } from '@/plugins/http-fetch'; import { language, request } from '@/plugins/http-fetch';
import { parseObjLineToHump } from '@/utils/parse-utils'; import { parseObjLineToHump } from '@/utils/parse-utils';
import { NE_TYPE_LIST } from '@/constants/ne-constants';
/** /**
* 查询网元列表 * 查询网元列表
@@ -15,24 +16,6 @@ export async function listNeInfo(query: Record<string, any>) {
let totalSQL = 'select count(*) as total from ne_info where 1=1 '; let totalSQL = 'select count(*) as total from ne_info where 1=1 ';
let rowsSQL = 'select * from ne_info where 1=1 '; let rowsSQL = 'select * from ne_info where 1=1 ';
// 系统特定顺序
const specificOrder = [
'OMC',
'MME',
'AMF',
'AUSF',
'UDM',
'SMF',
'PCF',
'UPF',
'NRF',
'NSSF',
'IMS',
'N3IWF',
'NEF',
'LMF',
];
// 查询 // 查询
let querySQL = ''; let querySQL = '';
if (query.neType) { if (query.neType) {
@@ -70,8 +53,8 @@ export async function listNeInfo(query: Record<string, any>) {
data.rows = itemData.map(v => parseObjLineToHump(v)); data.rows = itemData.map(v => parseObjLineToHump(v));
//通过sort进行冒泡排序 //通过sort进行冒泡排序
data.rows.sort((a: any, b: any) => { data.rows.sort((a: any, b: any) => {
const typeA = specificOrder.indexOf(a.neType); const typeA = NE_TYPE_LIST.indexOf(a.neType);
const typeB = specificOrder.indexOf(b.neType); const typeB = NE_TYPE_LIST.indexOf(b.neType);
if (typeA === -1) return 1; // 如果不在特定顺序中,排到后面 if (typeA === -1) return 1; // 如果不在特定顺序中,排到后面
if (typeB === -1) return -1; // 如果不在特定顺序中,排到后面 if (typeB === -1) return -1; // 如果不在特定顺序中,排到后面
return typeA - typeB; return typeA - typeB;

View File

@@ -1,29 +1,14 @@
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { request } from '@/plugins/http-fetch'; import { request } from '@/plugins/http-fetch';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import { NE_TYPE_LIST } from '@/constants/ne-constants';
/** /**
* 查询公告列表 * 查询公告列表
* @param query 查询参数 * @param query 查询参数
* @returns object * @returns object
*/ */
export async function listMain() { export async function listMain() {
// 系统特定顺序
const specificOrder = [
'OMC',
'MME',
'AMF',
'AUSF',
'UDM',
'SMF',
'PCF',
'UPF',
'NRF',
'NSSF',
'IMS',
'N3IWF',
'NEF',
'LMF',
];
const result = await request({ const result = await request({
url: '/api/rest/systemManagement/v1/elementType/all/objectType/systemState', url: '/api/rest/systemManagement/v1/elementType/all/objectType/systemState',
method: 'get', method: 'get',
@@ -66,8 +51,8 @@ export async function listMain() {
}); });
//通过sort进行冒泡排序 //通过sort进行冒泡排序
mergedData.sort((a: any, b: any) => { mergedData.sort((a: any, b: any) => {
const typeA = specificOrder.indexOf(a.name.split('_')[0]); const typeA = NE_TYPE_LIST.indexOf(a.name.split('_')[0]);
const typeB = specificOrder.indexOf(b.name.split('_')[0]); const typeB = NE_TYPE_LIST.indexOf(b.name.split('_')[0]);
if (typeA === -1) return 1; // 如果不在特定顺序中,排到后面 if (typeA === -1) return 1; // 如果不在特定顺序中,排到后面
if (typeB === -1) return -1; // 如果不在特定顺序中,排到后面 if (typeB === -1) return -1; // 如果不在特定顺序中,排到后面
return typeA - typeB; return typeA - typeB;

View File

@@ -7,11 +7,13 @@ export const NE_TYPE_LIST = [
'UDM', 'UDM',
'SMF', 'SMF',
'PCF', 'PCF',
'UPF',
'NRF',
'NSSF', 'NSSF',
'N3IWF', 'NRF',
'UPF',
'LMF',
'NEF',
'MME', 'MME',
'N3IWF',
'MOCNGW', 'MOCNGW',
'SMSC', 'SMSC',
]; ];

View File

@@ -159,7 +159,7 @@ router.beforeEach(async (to, from, next) => {
if (!appStore.loginBackground) { if (!appStore.loginBackground) {
await appStore.fnSysConf(); await appStore.fnSysConf();
} }
console.log(to.path);
// 需要系统引导跳转 // 需要系统引导跳转
if (appStore.bootloader && to.path !== '/quick-start') { if (appStore.bootloader && to.path !== '/quick-start') {
next({ name: 'QuickStart' }); next({ name: 'QuickStart' });

View File

@@ -65,6 +65,8 @@ let state: StateType = reactive({
nssf_ip: '172.60.5.170', nssf_ip: '172.60.5.170',
nrf_ip: '172.60.5.180', nrf_ip: '172.60.5.180',
upf_ip: '172.60.5.190', upf_ip: '172.60.5.190',
lmf_ip: '172.60.5.200',
nef_ip: '172.60.5.210',
mme_ip: '172.60.5.220', mme_ip: '172.60.5.220',
n3iwf_ip: '172.60.5.230', n3iwf_ip: '172.60.5.230',
}, },
@@ -154,6 +156,12 @@ function fnGetData() {
case 'UPF': case 'UPF':
state.from.sbi.upf_ip = item.ip; state.from.sbi.upf_ip = item.ip;
break; break;
case 'LMF':
state.from.sbi.lmf_ip = item.ip;
break;
case 'NEF':
state.from.sbi.nef_ip = item.ip;
break;
case 'MME': case 'MME':
state.from.sbi.mme_ip = item.ip; state.from.sbi.mme_ip = item.ip;
break; break;

View File

@@ -57,6 +57,8 @@ let state: StateType = reactive({
nssf_ip: '172.60.5.170', nssf_ip: '172.60.5.170',
nrf_ip: '172.60.5.180', nrf_ip: '172.60.5.180',
upf_ip: '172.60.5.190', upf_ip: '172.60.5.190',
lmf_ip: '172.60.5.200',
nef_ip: '172.60.5.210',
mme_ip: '172.60.5.220', mme_ip: '172.60.5.220',
n3iwf_ip: '172.60.5.230', n3iwf_ip: '172.60.5.230',
}, },
@@ -135,6 +137,12 @@ function fnGetList() {
case 'UPF': case 'UPF':
state.from.sbi.upf_ip = item.ip; state.from.sbi.upf_ip = item.ip;
break; break;
case 'LMF':
state.from.sbi.lmf_ip = item.ip;
break;
case 'NEF':
state.from.sbi.nef_ip = item.ip;
break;
case 'MME': case 'MME':
state.from.sbi.mme_ip = item.ip; state.from.sbi.mme_ip = item.ip;
break; break;