ref: v3变更,,完成整合,同步v2.2508.4 -250902

This commit is contained in:
TsMask
2025-09-06 11:27:57 +08:00
parent e943b4dedc
commit 6470ed5bc1
90 changed files with 1724 additions and 1361 deletions

View File

@@ -1,2 +1,3 @@
#imsi,msisdn,sess_rules,pcc_rules,hdr_enrich,rfsp,sar,qos_audio,qos_video,online,offline
# !!! Remove lines containing the # symbol when importing files.
#imsi,msisdn,sess_rules,pcc_rules,hdr_enrich,rfsp,sar,qos_audio,qos_video
460996650000580,62357000580,internet|ims_sig,internet|ims_sig,dnn,1,def_sar,qos_audio,qos_video,0,0

View File

@@ -1,2 +1,4 @@
# !!! Remove lines containing the # symbol when importing files.
#imsi,ki,aigoIndex,amf,opc
460996650000580,1234567890ABCDEF1234567890ABCDEF,0,8000
460996650000581,1234567890ABCDEF1234567890ABCDEF,0,8000

View File

@@ -1,2 +1,4 @@
# !!! Remove lines containing the # symbol when importing files.
#IMSI,MSISDN,UeAmbrTpl,NssaiTpl,AreaForbiddenTpl,ServiceAreaRestrictionTpl,RatRestrictions,CnTypeRestrictions,SmfSel,SmData,EPSDat
460996650000580,62357000580,def_ambr,def_nssai,def_arfb,def_sar,0,3,def_snssai,1-000001&content&ims,1,64,24,65,def_eps,1,010200000000,-
460996650000581,62357000581,def_ambr,def_nssai,def_arfb,def_sar,0,3,def_snssai,1-000001&content&ims,1,64,24,65,def_eps,1,010200000000,-

View File

@@ -1,3 +1,4 @@
# !!! Remove lines containing the # symbol when importing files.
#username,password
62357000580,123456
62357000581,123456

View File

@@ -1,3 +1,4 @@
# !!! Remove lines containing the # symbol when importing files.
#vlote=0 MSISDN and IMSI need to be filled in the same way.
#imsi,msisdn,vlote,vni
460996650000580,62357000580,1,ims.mnc000.mcc460.3gppnetwork.org

View File

@@ -209,7 +209,7 @@ export async function origGet(coreUid: string) {
*/
export async function top3Sel(coreUid: string) {
return await request({
url: `/neData/alarm/count/ne`,
url: `/neData/alarm/count/top`,
method: 'GET',
params: {
coreUid: coreUid,

View File

@@ -19,27 +19,61 @@ export async function getMMLByNE(neType: string) {
});
}
/**
* 查询UDM可用cmd命令
* @returns object
*/
export async function getMMLByUDM() {
return request({
url: '/tool/mml/subscriber/list',
method: 'GET',
params: {
neType: 'UDM',
status: 'Active',
pageNum: 1,
pageSize: 1000,
},
timeout: 60_000,
});
}
/**
* 发送网元的mml命令
* @param neType 网元类型
* @param coreUid 网元类型
* @param neId 网元ID
* @param objectType 接口类型
* @param cmdStr 命令串
* @returns
*/
export async function sendMMlByNE(
neType: string,
neId: string,
objectType: string,
export async function sendMML(data: Record<string, any>) {
return request({
url: '/tool/mml/command',
method: 'POST',
data: data,
timeout: 180_000,
});
}
/**
* 发送网元的mml命令
* @param coreUid 网元类型
* @param neUid 网元ID
* @param cmdArr 命令数组
* @returns
*/
export async function sendMMlByGeneral(
coreUid: string,
neUid: string,
cmdArr: string[]
) {
return request({
url: '/tool/mml/command',
method: 'POST',
data: {
neType: neType,
neId: neId,
type: objectType,
coreUid: coreUid,
neUid: neUid,
type: 'General',
command: cmdArr,
},
timeout: 180_000,

View File

@@ -1,39 +0,0 @@
import { request } from '@/plugins/http-fetch';
/**
* 查询UDM可用cmd命令
* @returns object
*/
export async function getMMLByUDM() {
return request({
url: '/tool/mml/subscriber/list',
method: 'GET',
params: {
neType: 'UDM',
status: 'Active',
pageNum: 1,
pageSize: 1000,
},
timeout: 60_000,
});
}
/**
* 发送UDM的mml命令
* @param neId 网元ID
* @param cmdStr 命令串
* @returns
*/
export async function sendMMlByUDM(neId: string, cmdArr: string[]) {
return request({
url: '/tool/mml/command',
method: 'POST',
data: {
neType: 'UDM',
neId: neId,
type: 'General',
command: cmdArr,
},
timeout: 180_000,
});
}

View File

@@ -68,10 +68,11 @@ export function delNeConfigData(params: Record<string, any>) {
/**
* 从参数配置PCF中获取对应信息提供给PCF用户策略输入框
* @param neId
* @param coreUid 核心网标识
* @param neUid 网元标识
* @returns object {pccRules,sessionRules,qosTemplate,headerEnrichTemplate,serviceAreaRestriction}
*/
export async function getPCFRule(neId: any) {
export async function getPCFRule(coreUid: string, neUid: string) {
const paramNameArr = [
'pccRules',
'sessionRules',
@@ -84,7 +85,7 @@ export async function getPCFRule(neId: any) {
reqArr.push(
request({
url: `/ne/config/data`,
params: { neType: 'PCF', neId, paramName },
params: { neType: 'PCF', coreUid, neUid, paramName },
method: 'GET',
})
);

View File

@@ -47,11 +47,11 @@ export function getNeLicenseByNF(coreUid: string, neUid: string) {
* @param neId 网元id
* @returns object
*/
export function codeNeLicense(neType: string, neId: string) {
export function codeNeLicense(coreUid: string, neUid: string) {
return request({
url: `/ne/license/code`,
method: 'GET',
params: { neType, neId },
params: { coreUid, neUid },
});
}

View File

@@ -44,7 +44,7 @@ export function exportAMFDataUE(query: Record<string, any>) {
/**
* AMF-接入基站信息列表
* @param query 查询参数 neId=001&id=1
* @param query 查询参数 coreUid=001&neUid=001&id=1
* @returns object
*/
export function listAMFNblist(query: Record<string, any>) {
@@ -58,12 +58,12 @@ export function listAMFNblist(query: Record<string, any>) {
/**
* AMF-接入基站状态信息列表
* @param query 查询参数 neId=001&state=1
* @param query 查询参数 coreUid=001&neUid=001&state=1
* @returns object
*/
export function listAMFNbStatelist(query: Record<string, any>) {
return request({
url: '/neData/amf/nb/list-cfg',
url: '/neData/amf/nb/addrs',
method: 'GET',
params: query,
timeout: 60_000,
@@ -76,13 +76,18 @@ export function listAMFNbStatelist(query: Record<string, any>) {
* @param data 数据 { "index": 1, "name": "Gnb", "address": "192.168.8.1", "position": "Area-B" }
* @returns object
*/
export function addAMFNbState(neId: string, data: Record<string, any>) {
export function addAMFNbState(
coreUid: string,
neUid: string,
data: Record<string, any>
) {
return request({
url: `/ne/config/data`,
method: 'POST',
data: {
neType: 'AMF',
neId: neId,
neUid: neUid,
coreUid: coreUid,
paramName: 'gnbList',
paramData: data,
loc: `${data.index}`,
@@ -92,17 +97,23 @@ export function addAMFNbState(neId: string, data: Record<string, any>) {
/**
* AMF-接入基站状态信息修改
* @param neId 网元ID
* @param coreUid 核心网标识
* @param neUid 网元标识
* @param data 数据 { "index": 1, "name": "Gnb", "address": "192.168.8.1", "position": "Area-B" }
* @returns object
*/
export function editAMFNbState(neId: string, data: Record<string, any>) {
export function editAMFNbState(
coreUid: string,
neUid: string,
data: Record<string, any>
) {
return request({
url: `/ne/config/data`,
method: 'PUT',
data: {
neType: 'AMF',
neId: neId,
neUid: neUid,
coreUid: coreUid,
paramName: 'gnbList',
paramData: data,
loc: `${data.index}`,
@@ -112,17 +123,23 @@ export function editAMFNbState(neId: string, data: Record<string, any>) {
/**
* AMF-接入基站状态信息删除
* @param neId 网元ID
* @param coreUid 核心网标识
* @param neUid 网元标识
* @param index 数据index
* @returns object
*/
export function delAMFNbState(neId: string, index: string | number) {
export function delAMFNbState(
coreUid: string,
neUid: string,
index: string | number
) {
return request({
url: `/ne/config/data`,
method: 'DELETE',
params: {
neType: 'AMF',
neId: neId,
neUid: neUid,
coreUid: coreUid,
paramName: 'gnbList',
loc: `${index}`,
},

View File

@@ -47,17 +47,17 @@ export function exportIMSDataCDR(query: Record<string, any>) {
* @param query 查询参数
* @returns object
*/
export function listIMSSessionNum(neId: string) {
export function listIMSSessionNum(coreUid: string, neUid: string) {
return request({
url: '/neData/ims/session/num',
method: 'GET',
params: { neId },
params: { coreUid, neUid },
});
}
/**
* IMS-在线会话用户列表信息
* @param query 查询参数 {neId, imsi, msisdn}
* @param query 查询参数 {coreUid, neUid, imsi, msisdn}
* @returns objectv
*/
export function listIMSSessionList(query: Record<string, any>) {

View File

@@ -63,7 +63,7 @@ export function listMMENblist(query: Record<string, any>) {
*/
export function listMMENbStatelist(query: Record<string, any>) {
return request({
url: '/neData/mme/nb/list-cfg',
url: '/neData/mme/nb/addrs',
method: 'GET',
params: query,
timeout: 60_000,
@@ -72,17 +72,23 @@ export function listMMENbStatelist(query: Record<string, any>) {
/**
* MME-接入基站状态信息新增
* @param neId 网元ID
* @param coreUid 核心网标识
* @param neUid 网元标识
* @param data 数据 { "index": 1, "name": "Enb", "address": "192.168.8.1", "position": "Area-B" }
* @returns object
*/
export function addMMENbState(neId: string, data: Record<string, any>) {
export function addMMENbState(
coreUid: string,
neUid: string,
data: Record<string, any>
) {
return request({
url: `/ne/config/data`,
method: 'POST',
data: {
neType: 'MME',
neId: neId,
neUid: neUid,
coreUid: coreUid,
paramName: 'enbList',
paramData: data,
loc: `${data.index}`,
@@ -92,17 +98,23 @@ export function addMMENbState(neId: string, data: Record<string, any>) {
/**
* MME-接入基站状态信息修改
* @param neId 网元ID
* @param coreUid 核心网标识
* @param neUid 网元标识
* @param data 数据 { "index": 1, "name": "Enb", "address": "192.168.8.1", "position": "Area-B" }
* @returns object
*/
export function editMMENbState(neId: string, data: Record<string, any>) {
export function editMMENbState(
coreUid: string,
neUid: string,
data: Record<string, any>
) {
return request({
url: `/ne/config/data`,
method: 'PUT',
data: {
neType: 'MME',
neId: neId,
neUid: neUid,
coreUid: coreUid,
paramName: 'enbList',
paramData: data,
loc: `${data.index}`,
@@ -112,17 +124,23 @@ export function editMMENbState(neId: string, data: Record<string, any>) {
/**
* MME-接入基站状态信息删除
* @param neId 网元ID
* @param coreUid 核心网标识
* @param neUid 网元标识
* @param index 数据index
* @returns object
*/
export function delMMENbState(neId: string, index: string | number) {
export function delMMENbState(
coreUid: string,
neUid: string,
index: string | number
) {
return request({
url: `/ne/config/data`,
method: 'DELETE',
params: {
neType: 'MME',
neId: neId,
neUid: neUid,
coreUid: coreUid,
paramName: 'enbList',
loc: `${index}`,
},

View File

@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
*/
export function listNBState(query: Record<string, any>) {
return request({
url: '/neData/nb-state/list',
url: '/neData/state/nb/list',
method: 'GET',
params: query,
timeout: 60_000,
@@ -21,7 +21,7 @@ export function listNBState(query: Record<string, any>) {
*/
export function exportNBState(query: Record<string, any>) {
return request({
url: '/neData/nb-state/export',
url: '/neData/state/nb/export',
method: 'GET',
params: query,
responseType: 'blob',

View File

@@ -7,10 +7,11 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
* @param query {imsi}
* @returns object
*/
export function listNSSFSubList() {
export function listNSSFSubList(query: Record<string, any>) {
return request({
url: '/neData/nssf/sub/list',
method: 'GET',
params: query,
});
}
@@ -18,9 +19,10 @@ export function listNSSFSubList() {
* NSSF-AMF列表信息
* @returns object
*/
export function listNSSFAmfList() {
export function listNSSFAmfList(query: Record<string, any>) {
return request({
url: '/neData/nssf/amf/list',
method: 'GET',
params: query,
});
}

View File

@@ -47,17 +47,17 @@ export function exportSMFDataCDR(query: Record<string, any>) {
* @param query 查询参数
* @returns object
*/
export function listSMFSubNum(neId: string) {
export function listSMFSubNum(coreUid: string, neUid: string) {
return request({
url: '/neData/smf/sub/num',
method: 'GET',
params: { neId },
params: { coreUid, neUid },
});
}
/**
* SMF-在线订阅用户列表信息
* @param query 查询参数 {neId, pageNum, imsi, msisdn, upstate}
* @param query 查询参数 {coreUid, neUid, pageNum, imsi, msisdn, upstate}
* @returns object
*/
export function listSMFSubList(query: Record<string, any>) {

View File

@@ -2,13 +2,15 @@ import { request } from '@/plugins/http-fetch';
/**
* UDM鉴权用户重载数据
* @param neId 网元ID
* @param coreUid 核心网标识
* @param neUid 网元标识
* @returns object
*/
export function resetUDMAuth(neId: string) {
export function resetUDMAuth(coreUid: string, neUid: string) {
return request({
url: `/neData/udm/auth/resetData/${neId}`,
url: `/neData/udm/auth/reset`,
method: 'PUT',
params: { coreUid, neUid },
timeout: 180_000,
});
}
@@ -23,20 +25,21 @@ export function listUDMAuth(query: Record<string, any>) {
url: '/neData/udm/auth/list',
method: 'GET',
params: query,
timeout: 30_000,
timeout: 60_000,
});
}
/**
* UDM鉴权用户信息
* @param neId 网元ID
* @param neUid 网元标识
* @param imsi IMSI
* @returns object
*/
export function getUDMAuth(neId: string, imsi: string) {
export function getUDMAuth(query: Record<string, any>) {
return request({
url: `/neData/udm/auth/${neId}/${imsi}`,
url: `/neData/udm/auth`,
method: 'GET',
params: query,
});
}
@@ -47,23 +50,9 @@ export function getUDMAuth(neId: string, imsi: string) {
*/
export function addUDMAuth(data: Record<string, any>) {
return request({
url: `/neData/udm/auth/${data.neId}`,
method: 'POST',
data: data,
timeout: 180_000,
});
}
/**
* UDM鉴权用户批量新增
* @param data 鉴权对象
* @param num 数量
* @returns object
*/
export function batchAddUDMAuth(data: Record<string, any>, num: number) {
return request({
url: `/neData/udm/auth/${data.neId}/${num}`,
url: `/neData/udm/auth`,
method: 'POST',
params: { num: data.num },
data: data,
timeout: 180_000,
});
@@ -76,7 +65,7 @@ export function batchAddUDMAuth(data: Record<string, any>, num: number) {
*/
export function updateUDMAuth(data: Record<string, any>) {
return request({
url: `/neData/udm/auth/${data.neId}`,
url: `/neData/udm/auth`,
method: 'PUT',
data: data,
timeout: 180_000,
@@ -85,29 +74,17 @@ export function updateUDMAuth(data: Record<string, any>) {
/**
* UDM鉴权用户删除
* @param coreUid 核心网标识
* @param neId 网元ID
* @param imsi IMSI
* @param num 数量 大于1为批量
* @returns object
*/
export function delUDMAuth(neId: string, imsi: string) {
export function delUDMAuth(query: Record<string, any>) {
return request({
url: `/neData/udm/auth/${neId}/${imsi}`,
method: 'DELETE',
timeout: 180_000,
});
}
/**
* UDM鉴权用户批量删除
* @param neId 网元ID
* @param imsi IMSI
* @param num 数量
* @returns object
*/
export function batchDelUDMAuth(neId: string, imsi: string, num: number) {
return request({
url: `/neData/udm/auth/${neId}/${imsi}/${num}`,
url: `/neData/udm/auth`,
method: 'DELETE',
params: query,
timeout: 180_000,
});
}

View File

@@ -2,13 +2,15 @@ import { request } from '@/plugins/http-fetch';
/**
* UDM签约用户重载数据
* @param neId 网元ID
* @param coreUid 核心网ID
* @param neUid 网元ID
* @returns object
*/
export function resetUDMSub(neId: string) {
export function resetUDMSub(coreUid: string, neUid: string) {
return request({
url: `/neData/udm/sub/resetData/${neId}`,
url: `/neData/udm/sub/reset`,
method: 'PUT',
params: { coreUid, neUid },
timeout: 180_000,
});
}
@@ -23,20 +25,21 @@ export function listUDMSub(query: Record<string, any>) {
url: '/neData/udm/sub/list',
method: 'GET',
params: query,
timeout: 30_000,
timeout: 60_000,
});
}
/**
* UDM签约用户信息
* @param neId 网元ID
* @param neUid 网元标识
* @param imsi IMSI
* @returns object
*/
export function getUDMSub(neId: string, imsi: string) {
export function getUDMSub(query: Record<string, any>) {
return request({
url: `/neData/udm/sub/${neId}/${imsi}`,
url: `/neData/udm/sub`,
method: 'GET',
params: query,
});
}
@@ -47,23 +50,9 @@ export function getUDMSub(neId: string, imsi: string) {
*/
export function addUDMSub(data: Record<string, any>) {
return request({
url: `/neData/udm/sub/${data.neId}`,
method: 'POST',
data: data,
timeout: 180_000,
});
}
/**
* UDM签约用户批量新增
* @param data 签约对象
* @param num 数量
* @returns object
*/
export function batchAddUDMSub(data: Record<string, any>, num: number) {
return request({
url: `/neData/udm/sub/${data.neId}/${num}`,
url: `/neData/udm/sub`,
method: 'POST',
params: { num: data.num },
data: data,
timeout: 180_000,
});
@@ -76,7 +65,7 @@ export function batchAddUDMSub(data: Record<string, any>, num: number) {
*/
export function updateUDMSub(data: Record<string, any>) {
return request({
url: `/neData/udm/sub/${data.neId}`,
url: `/neData/udm/sub`,
method: 'PUT',
data: data,
timeout: 180_000,
@@ -88,25 +77,11 @@ export function updateUDMSub(data: Record<string, any>) {
* @param data 签约对象
* @returns object
*/
export function delUDMSub(neId: string, imsi: string) {
export function delUDMSub(query: Record<string, any>) {
return request({
url: `/neData/udm/sub/${neId}/${imsi}`,
method: 'DELETE',
timeout: 180_000,
});
}
/**
* UDM签约用户批量删除
* @param neId 网元ID
* @param imsi IMSI
* @param num 数量
* @returns object
*/
export function batchDelUDMSub(neId: string, imsi: string, num: number) {
return request({
url: `/neData/udm/sub/${neId}/${imsi}/${num}`,
url: `/neData/udm/sub`,
method: 'DELETE',
params: query,
timeout: 180_000,
});
}

View File

@@ -1,115 +1,83 @@
import { request } from '@/plugins/http-fetch';
/**
* UDMVOIP用户重载数据
* @param neId 网元ID
* UDMVoIP用户重载数据
* @param coreUid 核心网ID
* @param neUid 网元ID
* @returns object
*/
export function resetUDMVOIP(neId: string) {
export function resetUDMVoIP(coreUid: string, neUid: string) {
return request({
url: `/neData/udm/voip/resetData/${neId}`,
url: `/neData/udm/voip/reset`,
method: 'PUT',
params: { coreUid, neUid },
timeout: 180_000,
});
}
/**
* UDMVOIP用户列表
* UDMVoIP用户列表
* @param query 查询参数
* @returns object
*/
export function listUDMVOIP(query: Record<string, any>) {
export function listUDMVoIP(query: Record<string, any>) {
return request({
url: '/neData/udm/voip/list',
method: 'GET',
params: query,
timeout: 30_000,
timeout: 60_000,
});
}
/**
* UDMVOIP用户信息
* @param neId 网元ID
* UDMVoIP用户信息
* @param neUid 网元标识
* @param username username
* @returns object
*/
export function getUDMVOIP(neId: string, username: string) {
export function getUDMVoIP(query: Record<string, any>) {
return request({
url: `/neData/udm/voip/${neId}/${username}`,
url: `/neData/udm/voip`,
method: 'GET',
params: query,
});
}
/**
* UDMVOIP用户新增
* @param data VOIP对象
* UDMVoIP用户新增
* @param data VoIP对象 username password
* @returns object
*/
export function addUDMVOIP(
neId: string,
data: { username: string; password: string }
) {
export function addUDMVoIP(data: Record<string, any>) {
return request({
url: `/neData/udm/voip/${neId}`,
url: `/neData/udm/voip`,
method: 'POST',
params: { num: data.num },
data: data,
timeout: 180_000,
});
}
/**
* UDMVOIP用户批量新增
* @param data VOIP对象
* @param num 数量
* UDMVoIP用户删除
* @param data VoIP对象
* @returns object
*/
export function batchAddUDMVOIP(
neId: string,
data: { username: string; password: string },
num: number
) {
export function delUDMVoIP(query: Record<string, any>) {
return request({
url: `/neData/udm/voip/${neId}/${num}`,
method: 'POST',
data: data,
timeout: 180_000,
});
}
/**
* UDMVOIP用户删除
* @param data VOIP对象
* @returns object
*/
export function delUDMVOIP(neId: string, username: string) {
return request({
url: `/neData/udm/voip/${neId}/${username}`,
url: `/neData/udm/voip`,
method: 'DELETE',
params: query,
timeout: 180_000,
});
}
/**
* UDMVOIP用户批量删除
* @param neId 网元ID
* @param username username
* @param num 数量
* @returns object
*/
export function batchDelUDMVOIP(neId: string, username: string, num: number) {
return request({
url: `/neData/udm/voip/${neId}/${username}/${num}`,
method: 'DELETE',
timeout: 180_000,
});
}
/**
* UDMVOIP用户导出
* UDMVoIP用户导出
* @param data 数据参数
* @returns bolb
*/
export function exportUDMVOIP(data: Record<string, any>) {
export function exportUDMVoIP(data: Record<string, any>) {
return request({
url: '/neData/udm/voip/export',
method: 'GET',
@@ -120,11 +88,11 @@ export function exportUDMVOIP(data: Record<string, any>) {
}
/**
* UDMVOIP用户导入
* UDMVoIP用户导入
* @param data 表单数据对象
* @returns object
*/
export function importUDMVOIP(data: Record<string, any>) {
export function importUDMVoIP(data: Record<string, any>) {
return request({
url: `/neData/udm/voip/import`,
method: 'POST',

View File

@@ -2,13 +2,15 @@ import { request } from '@/plugins/http-fetch';
/**
* UDMVolteIMS用户重载数据
* @param neId 网元ID
* @param coreUid 核心网ID
* @param neUid 网元ID
* @returns object
*/
export function resetUDMVolteIMS(neId: string) {
export function resetUDMVolteIMS(coreUid: string, neUid: string) {
return request({
url: `/neData/udm/volte-ims/resetData/${neId}`,
url: `/neData/udm/volte-ims/reset`,
method: 'PUT',
params: { coreUid, neUid },
timeout: 180_000,
});
}
@@ -23,7 +25,7 @@ export function listUDMVolteIMS(query: Record<string, any>) {
url: '/neData/udm/volte-ims/list',
method: 'GET',
params: query,
timeout: 30_000,
timeout: 60_000,
});
}
@@ -33,10 +35,11 @@ export function listUDMVolteIMS(query: Record<string, any>) {
* @param imsi IMSI
* @returns object
*/
export function getUDMVolteIMS(neId: string, imsi: string) {
export function getUDMVolteIMS(query: Record<string, any>) {
return request({
url: `/neData/udm/volte-ims/${neId}/${imsi}`,
url: `/neData/udm/volte-ims`,
method: 'GET',
params: query,
});
}
@@ -47,23 +50,9 @@ export function getUDMVolteIMS(neId: string, imsi: string) {
*/
export function addUDMVolteIMS(data: Record<string, any>) {
return request({
url: `/neData/udm/volte-ims/${data.neId}`,
method: 'POST',
data: data,
timeout: 180_000,
});
}
/**
* UDMVolteIMS用户批量新增
* @param data 签约对象
* @param num 数量
* @returns object
*/
export function batchAddUDMVolteIMS(data: Record<string, any>, num: number) {
return request({
url: `/neData/udm/volte-ims/${data.neId}/${num}`,
url: `/neData/udm/volte-ims`,
method: 'POST',
params: { num: data.num },
data: data,
timeout: 180_000,
});
@@ -71,38 +60,19 @@ export function batchAddUDMVolteIMS(data: Record<string, any>, num: number) {
/**
* UDMVolteIMS用户删除
* @param neId 网元ID
* @param imsi_msisdn IMSI/MSISDN
* @param tag 标签 0-voip 1-volte
* @returns object
*/
export function delUDMVolteIMS(neId: string, imsi_msisdn: string, tag: string) {
return request({
url: `/neData/udm/volte-ims/${neId}/${imsi_msisdn}`,
method: 'DELETE',
params: { volte: tag },
timeout: 180_000,
});
}
/**
* UDMVolteIMS用户批量删除
* @param neId 网元ID
* @param coreUid 核心网ID
* @param neUid 网元ID
* @param imsi IMSI
* @param msisdn MSISDN
* @param volte 标签 0-voip 1-volte
* @param num 数量
* @param tag 标签 0-voip 1-volte
* @returns object
*/
export function batchDelUDMVolteIMS(
neId: string,
imsi: string,
num: number,
tag: string
) {
export function delUDMVolteIMS(query: Record<string, any>) {
return request({
url: `/neData/udm/volte-ims/${neId}/${imsi}/${num}`,
url: `/neData/udm/volte-ims`,
method: 'DELETE',
params: { volte: tag },
params: query,
timeout: 180_000,
});
}

View File

@@ -277,19 +277,21 @@ export function transferStaticFile(data: Record<string, any>) {
*/
export async function uploadFileToNE(
neType: string,
neId: string,
neuid: string,
coreUid: string,
fileData: File,
chunkSize: number = 1
) {
const uploadChunkRes = await uploadFileChunk(fileData, chunkSize, 'import');
if (uploadChunkRes.code === RESULT_CODE_SUCCESS) {
const transferToNeFileRes = await request({
url: `/ne/action/pushFile`,
url: `/ne/action/file/push`,
method: 'POST',
data: {
uploadPath: uploadChunkRes.data.filePath,
neType,
neId,
neuid,
coreUid,
delTemp: true,
},
timeout: 60_000,

View File

@@ -8,13 +8,3 @@ export function iperfV(data: Record<string, string>) {
params: data,
});
}
// iperf 软件安装
export function iperfI(data: Record<string, string>) {
return request({
url: '/tool/iperf/i',
method: 'POST',
data: data,
timeout: 60_000,
});
}

View File

@@ -36,3 +36,36 @@ export const NE_TYPE_LIST = [
* UDM-adb/kvdb
*/
export const NE_EXPAND_LIST = ['ADB', 'KVDB', 'RTPROXY', 'MF'];
// 组号-其他
export const WS_GROUP_OTHER = '0';
// 组号-跟踪任务网元数据变更 2_traceId
export const WS_GROUP_TRACE_NE = '2';
// 组号-信令跟踪Packet 4_taskNo
export const WS_GROUP_TRACE_PACKET = '4';
// 组号-网元状态 8_neType_neId
export const WS_GROUP_NE_STATE = '8';
// 组号-指标通用 10_coreUid_neUid
export const WS_GROUP_KPI = '10';
// 组号-自定义KPI指标 20_coreUid_neUid
export const WS_GROUP_KPI_C = '20';
// 组号-IMS_CDR会话事件 1005_coreUid_neUid
export const WS_GROUP_IMS_CDR = '1005';
// 组号-SMF_CDR会话事件 1006_coreUid_neUid
export const WS_GROUP_SMF_CDR = '1006';
// 组号-SMSC_CDR会话事件 1007_coreUid_neUid
export const WS_GROUP_SMSC_CDR = '1007';
// 组号-SGWC_CDR会话事件 1008_coreUid_neUid
export const WS_GROUP_SGWC_CDR = '1008';
// 组号-AMF_UE会话事件 1010_coreUid_neUid
export const WS_GROUP_AMF_UE = '1010';
// 组号-MME_UE会话事件 1011_coreUid_neUid
export const WS_GROUP_MME_UE = '1011';
// 组号-AMF_NB状态事件 1014_coreUid_neUid
export const WS_GROUP_AMF_NB = '1014';
// 组号-MME_NB状态事件 1015_coreUid_neUid
export const WS_GROUP_MME_NB = '1015';
// 组号-告警 2000_coreUid_neUid
export const WS_GROUP_ALARM = '2000';
// 组号-告警事件 2002_coreUid_neUid
export const WS_GROUP_ALARM_EVENT = '2002';

View File

@@ -818,7 +818,7 @@ export default {
checkDel:'Check Delete',
importTemplate: 'Download Template',
},
udmVOIP: {
udmVoIP: {
startUsername: 'Starting username',
username: 'username',
usernamePlease: "Please enter your username correctly",
@@ -957,21 +957,6 @@ export default {
smDataTip:'The IP in sm_data=1-000001&internet-1.2.3.4&ims-1.2.3.5: 1.2.3.4 is the static IP assigned to the APN of 5G user internet, and 1.2.3.5 is the static IP assigned to the APN of 5G user ims. If it is dynamic allocation, just remove the IP and the previous connector. Need to support multiple dnn uses & connections',
smDataArrTip:'SST,DNN/APN is required',
},
base5G: {
neType: 'NE Object',
},
n3iwf: {
neType: 'N3IWF Object',
},
ue: {
neType: 'SMF Object',
},
ims: {
neType: 'IMS Object',
},
nssf:{
neType: 'NSSF Object',
},
},
perfManage: {
taskManage:{

View File

@@ -818,7 +818,7 @@ export default {
checkDel:'勾选删除',
importTemplate: '导入模板',
},
udmVOIP: {
udmVoIP: {
startUsername: '起始用户名',
username: '用户名',
usernamePlease: "请正确输入用户名",
@@ -957,21 +957,6 @@ export default {
smDataTip:'sm_data=1-000001&internet-1.2.3.4&ims-1.2.3.5中的IP1.2.3.4为5G用户internet这个APN分配的静态IP1.2.3.5为5G用户ims这个APN分配的静态IP。如果是动态分配把IP以及前面一个连接符去掉即可。需支持多个dnn用&连接',
smDataArrTip:'SST,DNN/APN为必填项',
},
base5G: {
neType: '网元对象',
},
n3iwf: {
neType: 'N3IWF网元对象',
},
ue: {
neType: 'SMF网元对象',
},
ims: {
neType: 'IMS网元对象',
},
nssf:{
neType: 'NSSF网元对象',
},
},
perfManage: {
taskManage:{

View File

@@ -7,9 +7,10 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeStore from '@/store/modules/ne';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import useI18n from '@/hooks/useI18n';
import { getMMLByNE, sendMMlByNE } from '@/api/mmlManage/neOperate';
import { getMMLByNE, sendMML } from '@/api/mmlManage/neOperate';
import { uploadFileToNE } from '@/api/tool/file';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore();
const { t } = useI18n();
@@ -177,8 +178,14 @@ function fnSendMML() {
// 发送
state.from.sendLoading = true;
const [neType, neId] = state.neType;
sendMMlByNE(neType, neId, objectType, cmdArr)
const [neType, neUid] = state.neType;
sendMML({
coreUid: currentCoreUid(),
neUid: neUid,
neType: neType,
type: objectType,
command: cmdArr,
})
.then(res => {
state.from.sendLoading = false;
if (res.code === RESULT_CODE_SUCCESS) {
@@ -210,8 +217,8 @@ function fnUpload(up: UploadRequestOption, name: string) {
onOk() {
const hide = message.loading(t('common.loading'), 0);
state.from.uploadLoading = true;
const [neType, neId] = state.neType;
uploadFileToNE(neType, neId, up.file as File, 5)
const [neType, neUid] = state.neType;
uploadFileToNE(neType, neUid, currentCoreUid(), up.file as File, 5)
.then(res => {
// 文件转存
if (res.code === RESULT_CODE_SUCCESS) {
@@ -459,6 +466,9 @@ function fnAutoCompleteSearch(value: string) {
/**自动完成搜索选择 */
function fnAutoCompleteSelect(_: any, option: any) {
if (Object.keys(option).length === 0) {
return;
}
state.mmlSelect = {
title: option.value,
key: option.key,
@@ -510,7 +520,7 @@ function fnAutoCompleteChange(value: any, _: any) {
key: '',
operation: '',
object: '',
objectType: state.mmlSelect.objectType,
objectType: 'General',
param: [],
};
}
@@ -518,16 +528,16 @@ function fnAutoCompleteChange(value: any, _: any) {
}
/**自动完成按键触发 */
function fnAutoCompleteKeydown(evt: any) {
function fnAutoCompleteKeydown(evt: KeyboardEvent) {
if (evt.key === 'Enter') {
// 阻止默认的换行行为
evt.preventDefault();
// 按下 Shift + Enter 键时换行
if (evt.shiftKey) {
if (evt.shiftKey && evt.target) {
// 插入换行符
const textarea = evt.target;
const start = textarea.selectionStart;
const end = textarea.selectionEnd;
const textarea = evt.target as HTMLInputElement;
const start = textarea.selectionStart || 0;
const end = textarea.selectionEnd || 0;
const text = textarea.value;
textarea.value = text.substring(0, start) + '\n' + text.substring(end);
state.autoCompleteValue = textarea.value;
@@ -541,11 +551,9 @@ function fnAutoCompleteKeydown(evt: any) {
onMounted(() => {
// 获取网元网元列表
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
(item: any) => {
return !['OMC', 'CBC', 'SGWC'].includes(item.value); // 过滤不可用的网元
}
);
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
return !['OMC', 'CBC', 'SGWC'].includes(item.value); // 过滤不可用的网元
});
if (neCascaderOptions.value.length === 0) {
message.warning({
content: t('common.noData'),
@@ -557,10 +565,10 @@ onMounted(() => {
const item = neCascaderOptions.value.find(s => s.value === 'AMF');
if (item && item.children) {
const info = item.children[0];
state.neType = [info.neType, info.neId];
state.neType = [info.neType, info.neUid];
} else {
const info = neCascaderOptions.value[0].children[0];
state.neType = [info.neType, info.neId];
state.neType = [info.neType, info.neUid];
}
// 列表

View File

@@ -10,6 +10,7 @@ import useI18n from '@/hooks/useI18n';
import { getMMLByOMC, sendMMlByOMC } from '@/api/mmlManage/omcOperate';
import { uploadFileToNE } from '@/api/tool/file';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -18,7 +19,7 @@ let neOptions = ref<Record<string, any>[]>([]);
/**对象信息状态类型 */
type StateType = {
/**网元ID */
neId: string | undefined;
neUid: string | undefined;
/**命令数据 tree */
mmlTreeData: any[];
/**命令选中 */
@@ -37,7 +38,7 @@ type StateType = {
/**对象信息状态 */
let state: StateType = reactive({
neId: undefined,
neUid: undefined,
mmlTreeData: [],
mmlSelect: {
title: '',
@@ -108,7 +109,7 @@ function fnSendMML() {
if (state.from.sendLoading) {
return;
}
if (!state.neId) {
if (!state.neUid) {
message.warning({
content: t('views.mmlManage.udmOpesrate.noOMC'),
duration: 5,
@@ -177,7 +178,7 @@ function fnSendMML() {
// 发送
state.from.sendLoading = true;
sendMMlByOMC(state.neId, cmdArr)
sendMMlByOMC(state.neUid, cmdArr)
.then(res => {
state.from.sendLoading = false;
if (res.code === RESULT_CODE_SUCCESS) {
@@ -203,8 +204,8 @@ function fnSendMML() {
/**上传变更 */
function fnUpload(up: UploadRequestOption, name: string) {
const neId = state.neId;
if (!neId) {
const neUid = state.neUid;
if (!neUid) {
message.warning({
content: t('views.mmlManage.udmOpesrate.noOMC'),
duration: 5,
@@ -217,7 +218,7 @@ function fnUpload(up: UploadRequestOption, name: string) {
onOk() {
const hide = message.loading(t('common.loading'), 0);
state.from.uploadLoading = true;
uploadFileToNE('OMC', neId, up.file as File, 5)
uploadFileToNE('OMC', neUid, currentCoreUid(), up.file as File, 5)
.then(res => {
// 文件转存
if (res.code === RESULT_CODE_SUCCESS) {
@@ -518,7 +519,7 @@ onMounted(() => {
return;
}
if (neOptions.value.length > 0) {
state.neId = neOptions.value[0].value;
state.neUid = neOptions.value[0].value;
}
// 获取列表数据
@@ -537,9 +538,9 @@ onMounted(() => {
:title="t('views.mmlManage.cmdTitle')"
>
<a-form layout="vertical" autocomplete="off">
<a-form-item name="neId ">
<a-form-item name="neUid ">
<a-select
v-model:value="state.neId"
v-model:value="state.neUid"
:options="neOptions"
:placeholder="t('common.selectPlease')"
/>

View File

@@ -7,9 +7,10 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeStore from '@/store/modules/ne';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import useI18n from '@/hooks/useI18n';
import { getMMLByUDM, sendMMlByUDM } from '@/api/mmlManage/udmOperate';
import { getMMLByUDM, sendMMlByGeneral } from '@/api/mmlManage/neOperate';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { uploadFileToNE } from '@/api/tool/file';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -18,7 +19,7 @@ let neOptions = ref<Record<string, any>[]>([]);
/**对象信息状态类型 */
type StateType = {
/**网元ID */
neId: string | undefined;
neUid: string | undefined;
/**命令数据 tree */
mmlTreeData: any[];
/**命令选中 */
@@ -37,7 +38,7 @@ type StateType = {
/**对象信息状态 */
let state: StateType = reactive({
neId: undefined,
neUid: undefined,
mmlTreeData: [],
mmlSelect: {
title: '',
@@ -108,7 +109,7 @@ function fnSendMML() {
if (state.from.sendLoading) {
return;
}
if (!state.neId) {
if (!state.neUid) {
message.warning({
content: t('views.mmlManage.udmOpesrate.noUDM'),
duration: 5,
@@ -177,7 +178,7 @@ function fnSendMML() {
// 发送
state.from.sendLoading = true;
sendMMlByUDM(state.neId, cmdArr)
sendMMlByGeneral(currentCoreUid(), state.neUid, cmdArr)
.then(res => {
state.from.sendLoading = false;
if (res.code === RESULT_CODE_SUCCESS) {
@@ -203,8 +204,8 @@ function fnSendMML() {
/**上传变更 */
function fnUpload(up: UploadRequestOption, name: string) {
const neId = state.neId;
if (!neId) {
const neUid = state.neUid;
if (!neUid) {
message.warning({
content: t('views.mmlManage.udmOpesrate.noUDM'),
duration: 5,
@@ -217,7 +218,7 @@ function fnUpload(up: UploadRequestOption, name: string) {
onOk() {
const hide = message.loading(t('common.loading'), 0);
state.from.uploadLoading = true;
uploadFileToNE('UDM', neId, up.file as File, 5)
uploadFileToNE('UDM', neUid, currentCoreUid(), up.file as File, 5)
.then(res => {
// 文件转存
if (res.code === RESULT_CODE_SUCCESS) {
@@ -425,6 +426,9 @@ function fnAutoCompleteSearch(value: string) {
/**自动完成搜索选择 */
function fnAutoCompleteSelect(_: any, option: any) {
if (Object.keys(option).length === 0) {
return;
}
state.mmlSelect = {
title: option.value,
key: option.key,
@@ -518,7 +522,7 @@ onMounted(() => {
return;
}
if (neOptions.value.length > 0) {
state.neId = neOptions.value[0].value;
state.neUid = neOptions.value[0].value;
}
// 获取列表数据
@@ -537,9 +541,9 @@ onMounted(() => {
:title="t('views.mmlManage.cmdTitle')"
>
<a-form layout="vertical" autocomplete="off">
<a-form-item name="neId ">
<a-form-item name="neUid ">
<a-select
v-model:value="state.neId"
v-model:value="state.neUid"
:options="neOptions"
:placeholder="t('common.selectPlease')"
/>

View File

@@ -53,11 +53,11 @@ const graphNodeTooltip = new Tooltip({
${neState.refreshTime ?? '--'}
</span></div>
<div>========================</div>
<div><strong>ID</strong><span>${neState.neId}</span></div>
<div><strong>ID</strong><span>${neState.neUid}</span></div>
<div><strong>${t('views.monitor.topology.name')}</strong><span>
${neState.neName ?? '--'}
</span></div>
<div><strong>IP</strong><span>${neState.neIP}</span></div>
<div><strong>IP</strong><span>${neState.ipAddr}</span></div>
<div><strong>${t('views.monitor.topology.version')}</strong><span>
${neState.version ?? '--'}
</span></div>

View File

@@ -16,7 +16,8 @@ import { CanvasRenderer } from 'echarts/renderers';
import { markRaw } from 'vue';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { upfFlowData, upfFlowParse } from '../../hooks/useUPFTotalFlow';
import { upfNeUId, upfFlowData, upfFlowParse } from '../../hooks/useUPFTotalFlow';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
@@ -206,8 +207,9 @@ function fnGetInitData() {
const nowDate = new Date().getTime();
listKPIData({
coreUid: currentCoreUid(),
neUid: upfNeUId.value,
neType: 'UPF',
neId: '001',
beginTime: nowDate - 5 * 60 * 1000,
endTime: nowDate,
interval: 5, // 5秒
@@ -250,7 +252,9 @@ watch(
);
onMounted(() => {
fnGetInitData();
setTimeout(() => {
fnGetInitData();
}, 1000);
});
</script>

View File

@@ -52,8 +52,8 @@ export const graphNodeStateNum = computed(() => {
let normal = 0;
let abnormal = 0;
for (const item of graphState.data.nodes) {
const neId = item.neState.neId;
if (neId) {
const neUid = item.neState.neUid;
if (neUid) {
if (item.neState.online) {
normal += 1;
} else {

View File

@@ -2,6 +2,9 @@ import { parseDateToStr } from '@/utils/date-utils';
import { parseSizeFromByte, parseSizeFromKbs } from '@/utils/parse-utils';
import { ref } from 'vue';
/**当前选的upf的neUid */
export const upfNeUId = ref<any>('');
type FDType = {
/**时间 */
lineXTime: string[];

View File

@@ -1,5 +1,12 @@
import { ref } from 'vue';
/**当前选的事件的neUid */
export const eventNeUid = ref<Record<string, any>>({
AMF: '',
MME: '',
IMS: '',
});
/**ueEventAMFParse UE会话事件AMF 数据解析 */
function ueEventAMFParse(
item: Record<string, any>

View File

@@ -1,13 +1,15 @@
import { RESULT_CODE_ERROR } from '@/constants/result-constants';
import { OptionsType, WS } from '@/plugins/ws-websocket';
import { onBeforeUnmount, ref } from 'vue';
import { onBeforeUnmount } from 'vue';
import {
eventData,
eventListParse,
eventItemParseAndPush,
userActivityReset,
eventNeUid,
} from './useUserActivity';
import {
upfNeUId,
upfTotalFlow,
upfTFParse,
upfFlowParse,
@@ -15,9 +17,13 @@ import {
} from './useUPFTotalFlow';
import { topologyReset, neStateParse, neStateRequestMap } from './useTopology';
import PQueue from 'p-queue';
/**UPF-的Id */
export const upfWhoId = ref<any>('');
import {
WS_GROUP_AMF_UE,
WS_GROUP_IMS_CDR,
WS_GROUP_KPI,
WS_GROUP_MME_UE,
} from '@/constants/ne-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
/**websocket连接 */
export default function useWS() {
@@ -39,10 +45,11 @@ export default function useWS() {
}
// 网元状态
if (requestId && requestId.startsWith('neState')) {
const neType = requestId.split('_')[1];
const neType = requestId.split('_')[3];
neStateParse(neType, data);
return;
}
const coreUid = currentCoreUid();
// 普通信息
switch (requestId) {
@@ -68,13 +75,13 @@ export default function useWS() {
}
break;
//UPF-总流量数
case `upf_${upfWhoId.value}_0`:
case `upf_${upfNeUId.value}_0`:
upfTFParse('0', data);
break;
case `upf_${upfWhoId.value}_7`:
case `upf_${upfNeUId.value}_7`:
upfTFParse('7', data);
break;
case `upf_${upfWhoId.value}_30`:
case `upf_${upfNeUId.value}_30`:
upfTFParse('30', data);
break;
}
@@ -84,25 +91,25 @@ export default function useWS() {
}
switch (data.groupId) {
// kpiEvent 指标UPF
case `10_UPF_${upfWhoId.value}`:
case `${WS_GROUP_KPI}_${coreUid}_${upfNeUId.value}`:
if (data.data) {
upfFlowParse(data.data);
}
break;
// AMF_UE会话事件
case '1010_001':
case `${WS_GROUP_AMF_UE}_${coreUid}_${eventNeUid.value.AMF}`:
if (data.data) {
queue.add(() => eventItemParseAndPush('amf_ue', data.data));
}
break;
// MME_UE会话事件
case '1011_001':
case `${WS_GROUP_MME_UE}_${coreUid}_${eventNeUid.value.MME}`:
if (data.data) {
queue.add(() => eventItemParseAndPush('mme_ue', data.data));
}
break;
// IMS_CDR会话事件
case '1005_001':
case `${WS_GROUP_IMS_CDR}_${coreUid}_${eventNeUid.value.IMS}`:
if (data.data) {
queue.add(() => eventItemParseAndPush('ims_cdr', data.data));
}
@@ -117,13 +124,13 @@ export default function useWS() {
return;
}
upfTotalFlow.value[day].requestFlag = true;
ws.send({
requestId: `upf_${upfWhoId.value}_${day}`,
requestId: `upf_${upfNeUId.value}_${day}`,
type: 'upf_tf',
data: {
coreUid: currentCoreUid(),
neUid: upfNeUId.value,
neType: 'UPF',
neId: upfWhoId.value,
day: Number(day),
},
});
@@ -136,8 +143,9 @@ export default function useWS() {
requestId: 'amf_1010_001',
type: 'amf_ue',
data: {
coreUid: currentCoreUid(),
neUid: eventNeUid.value.AMF,
neType: 'AMF',
neId: '001',
sortField: 'timestamp',
sortOrder: 'desc',
pageNum: 1,
@@ -149,8 +157,9 @@ export default function useWS() {
requestId: 'mme_1011_001',
type: 'mme_ue',
data: {
coreUid: currentCoreUid(),
neUid: eventNeUid.value.MME,
neType: 'MME',
neId: '001',
sortField: 'timestamp',
sortOrder: 'desc',
pageNum: 1,
@@ -162,8 +171,9 @@ export default function useWS() {
requestId: 'ims_1005_001',
type: 'ims_cdr',
data: {
coreUid: currentCoreUid(),
neUid: eventNeUid.value.IMS,
neType: 'IMS',
neId: '001',
recordType: 'MOC',
sortField: 'timestamp',
sortOrder: 'desc',
@@ -174,8 +184,7 @@ export default function useWS() {
}
/**重新发送至UPF 10_UPF_neId */
function reSendUPF(neId: string) {
upfWhoId.value = neId;
function reSendUPF() {
//初始时时无需还原全部属性以及关闭
if (ws.state() === WebSocket.OPEN) {
ws.close();
@@ -184,6 +193,14 @@ export default function useWS() {
neStateRequestMap.value = new Map();
//topologyReset();
}
const coreUid = currentCoreUid();
let subGroupIDArr: string[] = [];
subGroupIDArr.push(`${WS_GROUP_KPI}_${coreUid}_${upfNeUId.value}`);
subGroupIDArr.push(`${WS_GROUP_AMF_UE}_${coreUid}_${eventNeUid.value.AMF}`);
subGroupIDArr.push(`${WS_GROUP_MME_UE}_${coreUid}_${eventNeUid.value.MME}`);
subGroupIDArr.push(
`${WS_GROUP_IMS_CDR}_${coreUid}_${eventNeUid.value.IMS}`
);
const options: OptionsType = {
url: '/ws',
params: {
@@ -194,7 +211,7 @@ export default function useWS() {
* MME_UE会话事件(GroupID:1011_neId)
* IMS_CDR会话事件(GroupID:1005_neId)
*/
subGroupID: `10_UPF_${neId},1010_001,1011_001,1005_001`,
subGroupID: subGroupIDArr.join(','),
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -209,7 +226,7 @@ export default function useWS() {
userActivityReset();
upfTotalFlowReset();
topologyReset();
upfWhoId.value = '';
upfNeUId.value = '';
});
return {

View File

@@ -21,7 +21,7 @@ import {
graphNodeStateNum,
neStateRequestMap,
} from './hooks/useTopology';
import { upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
import { upfNeUId, upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
import { useFullscreen } from '@vueuse/core';
import useWS from './hooks/useWS';
import useAppStore from '@/store/modules/app';
@@ -29,7 +29,8 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { useRouter } from 'vue-router';
import useNeStore from '@/store/modules/ne';
import { message } from 'ant-design-vue';
import { upfWhoId } from './hooks/useWS';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { eventNeUid } from './hooks/useUserActivity';
const router = useRouter();
const appStore = useAppStore();
@@ -84,18 +85,19 @@ function fnGetNeState() {
// 获取节点状态
for (const node of graphState.data.nodes) {
if (notNeNodes.includes(node.id)) continue;
const { neType, neId } = node.neInfo;
if (!neType || !neId) continue;
const { neType, coreUid, neUid } = node.neInfo;
if (!neType || !neUid) continue;
// 请求标记检查避免重复发送
if (neStateRequestMap.value.get(neType)) continue;
neStateRequestMap.value.set(neType, true);
wsSend({
requestId: `neState_${neType}_${neId}`,
requestId: `neState_${coreUid}_${neUid}_${neType}`,
type: 'ne_state',
data: {
coreUid: coreUid,
neType: neType,
neId: neId,
neUid: neUid,
},
});
}
@@ -107,8 +109,8 @@ async function fnGetSkim() {
// [
// 'UDM',
// {
// request: (neId: string) =>
// listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }),
// request: (coreUid: string, neUid: string) =>
// listUDMSub({ coreUid, neUid, pageNum: 1, pageSize: 1 }),
// process: (res: any) =>
// res.code === RESULT_CODE_SUCCESS &&
// (skimState.udmSubNum += res.data.total),
@@ -117,7 +119,10 @@ async function fnGetSkim() {
[
'SMF',
{
request: (neId: string) => listSMFSubNum(neId),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.SMF = neUid;
return listSMFSubNum(coreUid, neUid);
},
process: (res: any) => {
if (
res.code === RESULT_CODE_SUCCESS &&
@@ -131,7 +136,10 @@ async function fnGetSkim() {
[
'IMS',
{
request: (neId: string) => listIMSSessionNum(neId),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.IMS = neUid;
return listIMSSessionNum(coreUid, neUid);
},
process: (res: any) => {
if (
res.code === RESULT_CODE_SUCCESS &&
@@ -145,7 +153,10 @@ async function fnGetSkim() {
[
'AMF',
{
request: (neId: string) => listAMFNblist({ neId }),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.AMF = neUid;
return listAMFNblist({ coreUid, neUid });
},
process: (res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.gnbNum += res.data.length;
@@ -160,7 +171,10 @@ async function fnGetSkim() {
[
'MME',
{
request: (neId: string) => listMMENblist({ neId }),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.MME = neUid;
return listMMENblist({ coreUid, neUid });
},
process: (res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.enbNum += res.data.length;
@@ -181,7 +195,7 @@ async function fnGetSkim() {
const handler = neHandlers.get(child.neType);
return handler
? {
promise: handler.request(child.neId),
promise: handler.request(child.coreUid, child.neUid),
process: handler.process,
}
: null;
@@ -210,7 +224,12 @@ async function fnGetSkim() {
});
// UDM
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
listUDMSub({
coreUid: currentCoreUid(),
neUid: udmNeUid.value,
pageNum: 1,
pageSize: 1,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res.data.total;
}
@@ -254,12 +273,12 @@ function fnToRouter(name: string, query?: any) {
}
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
let upfOtions = ref<Record<string, any>[]>([]);
// UPF实时流量下拉框选择
function fnSelectNe(value: any, option: any) {
upfWhoId.value = value;
reSendUPF(value);
upfNeUId.value = value;
reSendUPF();
// upfTotalFlow.value.map((item: any) => {
// item.requestFlag = false;
// });
@@ -270,12 +289,17 @@ function fnSelectNe(value: any, option: any) {
// loadData();
}
let udmNeId = ref<string>('001');
let udmNeUid = ref<string>('');
let udmOtions = ref<Record<string, any>[]>([]);
/**用户数量-选择UDM */
function fnSelectUDM(e: any) {
udmNeId.value = e.key;
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
udmNeUid.value = e.key;
listUDMSub({
coreUid: currentCoreUid(),
neUid: e.key,
pageNum: 1,
pageSize: 1,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res.data.total;
}
@@ -294,14 +318,14 @@ onMounted(() => {
// 获取网元网元列表
neStore.neCascaderOptions.forEach(item => {
if (item.value === 'UPF') {
neOtions.value = JSON.parse(JSON.stringify(item.children));
upfOtions.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 (upfOtions.value.length > 0) {
fnSelectNe(upfOtions.value[0].value, upfOtions.value[0]);
}
if (udmOtions.value.length > 0) {
fnSelectUDM({ key: udmOtions.value[0].value });
@@ -382,7 +406,7 @@ onBeforeUnmount(() => {
<a-menu-item
v-for="v in udmOtions"
:key="v.value"
:disabled="udmNeId === v.value"
:disabled="udmNeUid === v.value"
>
{{ v.label }}
</a-menu-item>
@@ -535,8 +559,8 @@ onBeforeUnmount(() => {
t('views.dashboard.overview.upfFlow.title')
}}</span>
<a-select
v-model:value="upfWhoId"
:options="neOtions"
v-model:value="upfNeUId"
:options="upfOtions"
:get-Popup-Container="getPopupContainer"
class="toDeep"
style="width: 100px; color: #fff; margin-left: auto"

View File

@@ -23,6 +23,7 @@ import { markRaw, onMounted, ref } from 'vue';
import { origGet, top3Sel } from '@/api/faultManage/actAlarm';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
@@ -85,7 +86,8 @@ const alarmTypeTypeTop = ref<any>([
//
function initPicture() {
Promise.allSettled([origGet(), top3Sel()])
const coreUid = currentCoreUid()
Promise.allSettled([origGet(coreUid), top3Sel(coreUid)])
.then(resArr => {
if (resArr[0].status === 'fulfilled') {
const res0 = resArr[0].value;

View File

@@ -61,11 +61,11 @@ const graphNodeTooltip = new Tooltip({
${neState.refreshTime ?? '--'}
</span></div>
<div>========================</div>
<div><strong>ID</strong><span>${neState.neId}</span></div>
<div><strong>ID</strong><span>${neState.neUid}</span></div>
<div><strong>${t('views.monitor.topology.name')}</strong><span>
${neState.neName ?? '--'}
</span></div>
<div><strong>IP</strong><span>${neState.neIP ?? '--'}</span></div>
<div><strong>IP</strong><span>${neState.ipAddr ?? '--'}</span></div>
<div><strong>${t('views.monitor.topology.version')}</strong><span>
${neState.version ?? '--'}
</span></div>
@@ -104,15 +104,15 @@ const graphNodeTooltip = new Tooltip({
sameTypeNes.forEach((ne: any, index: number) => {
// 获取该网元的状态信息
const neStateInfo =
neStateMap?.[ne.neId] || (ne.neId === neState.neId ? neState : {});
neStateMap?.[ne.neUid] || (ne.neUid === neState.neUid ? neState : {});
content += `
<div style="margin-top: 8px;"><strong>${t(
'views.monitor.topology.name'
)}${ne.neName || id + '_' + ne.neId}</strong></div>
<div><strong>ID</strong><span>${ne.neId || '--'}</span></div>
)}${ne.neName || id + '_' + ne.neUid}</strong></div>
<div><strong>ID</strong><span>${ne.neUid || '--'}</span></div>
<div><strong>IP</strong><span>${
neStateInfo.neIP || ne.neIP || '--'
neStateInfo.ipAddr || ne.ipAddr || '--'
}</span></div>
<div><strong>${t('views.monitor.topology.version')}</strong><span>
${neStateInfo.version || ne.version || '--'}

View File

@@ -16,8 +16,12 @@ import { CanvasRenderer } from 'echarts/renderers';
import { markRaw } from 'vue';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { upfFlowData, upfFlowParse } from '../../hooks/useUPFTotalFlow';
import { upfWhoId } from '../../hooks/useWS';
import {
upfNeUId,
upfFlowData,
upfFlowParse,
} from '../../hooks/useUPFTotalFlow';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
@@ -207,8 +211,9 @@ function fnGetInitData() {
const nowDate = new Date().getTime();
listKPIData({
coreUid: currentCoreUid(),
neUid: upfNeUId.value,
neType: 'UPF',
neId: '001',
beginTime: nowDate - 5 * 60 * 1000,
endTime: nowDate,
interval: 5, // 5秒
@@ -251,7 +256,9 @@ watch(
);
onMounted(() => {
fnGetInitData();
setTimeout(() => {
fnGetInitData();
}, 1000);
// setInterval(() => {
// upfFlowData.value.lineXTime.push(parseDateToStr(new Date()));

View File

@@ -56,8 +56,8 @@ export const graphNodeStateNum = computed(() => {
let normal = 0;
let abnormal = 0;
for (const item of graphState.data.nodes) {
const neId = item.neState.neId;
if (neId) {
const neUid = item.neState.neUid;
if (neUid) {
if (item.neState.online) {
normal += 1;
} else {
@@ -72,8 +72,8 @@ export const graphNodeStateNum = computed(() => {
export const neStateRequestMap = ref<Map<string, boolean>>(new Map());
/**neStateParse 网元状态 数据解析 */
export function neStateParse(neType: string, data: Record<string, any>,neId: string) {
// console.log('neStateParse',neType, data, neId);
export function neStateParse(neType: string, data: Record<string, any>,neUid: string) {
// console.log('neStateParse',neType, data, neUid);
const { combos, edges, nodes } = graphState.data;
@@ -90,16 +90,16 @@ export function neStateParse(neType: string, data: Record<string, any>,neId: str
...data, // 先展开data对象
refreshTime: parseDateToStr(data.refreshTime, 'HH:mm:ss'),
online: !!data.cpu,
neId: neId
neUid: neUid
};
// 如果是001更新节点状态。neInfo为主要的网元信息
if (node.neInfo && node.neInfo.neId === neId) {
if (node.neInfo && node.neInfo.neUid === neUid) {
Object.assign(node.neState, newNeState);
}
//console.log(node.neState)
// 无论是否为主要网元,都更新状态映射
node.neStateMap[neId] = {...newNeState};
node.neStateMap[neUid] = {...newNeState};
// 通过 ID 查询节点实例
const item = graphG6.value.findById(node.id);
if (item) {

View File

@@ -2,6 +2,9 @@ import { parseDateToStr } from '@/utils/date-utils';
import { parseSizeFromByte, parseSizeFromKbs } from '@/utils/parse-utils';
import { ref } from 'vue';
/**当前选的upf的neUid */
export const upfNeUId = ref<any>('');
type FDType = {
/**时间 */
lineXTime: string[];
@@ -23,7 +26,9 @@ export const upfFlowData = ref<FDType>({
/**UPF-流量数据 数据解析 */
export function upfFlowParse(data: Record<string, string>) {
upfFlowData.value.lineXTime.push(parseDateToStr(+data['timeGroup'], 'HH:mm:ss'));
upfFlowData.value.lineXTime.push(
parseDateToStr(+data['timeGroup'], 'HH:mm:ss')
);
const upN3 = parseSizeFromKbs(+data['UPF.03'], 5);
upfFlowData.value.lineYUp.push(upN3[0]);
const downN6 = parseSizeFromKbs(+data['UPF.06'], 5);

View File

@@ -1,5 +1,12 @@
import { ref } from 'vue';
/**当前选的事件的neUid */
export const eventNeUid = ref<Record<string, any>>({
AMF: '',
MME: '',
IMS: '',
});
/**ueEventAMFParse UE会话事件AMF 数据解析 */
function ueEventAMFParse(
item: Record<string, any>

View File

@@ -6,18 +6,24 @@ import {
eventListParse,
eventItemParseAndPush,
userActivityReset,
eventNeUid,
} from './useUserActivity';
import {
upfTotalFlow,
upfTFParse,
upfFlowParse,
upfTotalFlowReset,
upfNeUId,
} from './useUPFTotalFlow';
import { topologyReset, neStateParse, neStateRequestMap } from './useTopology';
import PQueue from 'p-queue';
/**UPF-的Id */
export const upfWhoId = ref<any>('');
import {
WS_GROUP_KPI,
WS_GROUP_AMF_UE,
WS_GROUP_MME_UE,
WS_GROUP_IMS_CDR,
} from '@/constants/ne-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
/**websocket连接 */
export default function useWS() {
@@ -39,11 +45,12 @@ export default function useWS() {
}
// 网元状态
if (requestId && requestId.startsWith('neState')) {
const neType = requestId.split('_')[1];
const neId = requestId.split('_')[2];
neStateParse(neType, data,neId);
const neType = requestId.split('_')[3];
const neUid = requestId.split('_')[2];
neStateParse(neType, data, neUid);
return;
}
const coreUid = currentCoreUid();
// 普通信息
switch (requestId) {
@@ -69,13 +76,13 @@ export default function useWS() {
}
break;
//UPF-总流量数
case `upf_${upfWhoId.value}_0`:
case `upf_${upfNeUId.value}_0`:
upfTFParse('0', data);
break;
case `upf_${upfWhoId.value}_7`:
case `upf_${upfNeUId.value}_7`:
upfTFParse('7', data);
break;
case `upf_${upfWhoId.value}_30`:
case `upf_${upfNeUId.value}_30`:
upfTFParse('30', data);
break;
}
@@ -85,25 +92,25 @@ export default function useWS() {
}
switch (data.groupId) {
// kpiEvent 指标UPF
case `10_UPF_${upfWhoId.value}`:
case `${WS_GROUP_KPI}_${coreUid}_${upfNeUId.value}`:
if (data.data) {
upfFlowParse(data.data);
}
break;
// AMF_UE会话事件
case '1010_001':
case `${WS_GROUP_AMF_UE}_${coreUid}_${eventNeUid.value.AMF}`:
if (data.data) {
queue.add(() => eventItemParseAndPush('amf_ue', data.data));
}
break;
// MME_UE会话事件
case '1011_001':
case `${WS_GROUP_MME_UE}_${coreUid}_${eventNeUid.value.MME}`:
if (data.data) {
queue.add(() => eventItemParseAndPush('mme_ue', data.data));
}
break;
// IMS_CDR会话事件
case '1005_001':
case `${WS_GROUP_IMS_CDR}_${coreUid}_${eventNeUid.value.IMS}`:
if (data.data) {
queue.add(() => eventItemParseAndPush('ims_cdr', data.data));
}
@@ -120,11 +127,12 @@ export default function useWS() {
upfTotalFlow.value[day].requestFlag = true;
ws.send({
requestId: `upf_${upfWhoId.value}_${day}`,
requestId: `upf_${upfNeUId.value}_${day}`,
type: 'upf_tf',
data: {
coreUid: currentCoreUid(),
neUid: upfNeUId.value,
neType: 'UPF',
neId: upfWhoId.value,
day: Number(day),
},
});
@@ -137,8 +145,9 @@ export default function useWS() {
requestId: 'amf_1010_001',
type: 'amf_ue',
data: {
coreUid: currentCoreUid(),
neUid: eventNeUid.value.AMF,
neType: 'AMF',
neId: '001',
sortField: 'timestamp',
sortOrder: 'desc',
pageNum: 1,
@@ -150,8 +159,9 @@ export default function useWS() {
requestId: 'mme_1011_001',
type: 'mme_ue',
data: {
coreUid: currentCoreUid(),
neUid: eventNeUid.value.MME,
neType: 'MME',
neId: '001',
sortField: 'timestamp',
sortOrder: 'desc',
pageNum: 1,
@@ -163,8 +173,9 @@ export default function useWS() {
requestId: 'ims_1005_001',
type: 'ims_cdr',
data: {
coreUid: currentCoreUid(),
neUid: eventNeUid.value.IMS,
neType: 'IMS',
neId: '001',
recordType: 'MOC',
sortField: 'timestamp',
sortOrder: 'desc',
@@ -174,9 +185,8 @@ export default function useWS() {
});
}
/**重新发送至UPF 10_UPF_neId */
function reSendUPF(neId: string) {
upfWhoId.value = neId;
/**重新发送至UPF 10_UPF_neUid */
function reSendUPF() {
//初始时时无需还原全部属性以及关闭
if (ws.state() === WebSocket.OPEN) {
ws.close();
@@ -185,17 +195,25 @@ export default function useWS() {
neStateRequestMap.value = new Map();
//topologyReset();
}
const coreUid = currentCoreUid();
let subGroupIDArr: string[] = [];
subGroupIDArr.push(`${WS_GROUP_KPI}_${coreUid}_${upfNeUId.value}`);
subGroupIDArr.push(`${WS_GROUP_AMF_UE}_${coreUid}_${eventNeUid.value.AMF}`);
subGroupIDArr.push(`${WS_GROUP_MME_UE}_${coreUid}_${eventNeUid.value.MME}`);
subGroupIDArr.push(
`${WS_GROUP_IMS_CDR}_${coreUid}_${eventNeUid.value.IMS}`
);
const options: OptionsType = {
url: '/ws',
params: {
/**订阅通道组
*
* 指标UPF (GroupID:10_neType_neId)
* AMF_UE会话事件(GroupID:1010_neId)
* MME_UE会话事件(GroupID:1011_neId)
* IMS_CDR会话事件(GroupID:1005_neId)
* 指标UPF (GroupID:10_neType_neUid)
* AMF_UE会话事件(GroupID:1010_neUid)
* MME_UE会话事件(GroupID:1011_neUid)
* IMS_CDR会话事件(GroupID:1005_neUid)
*/
subGroupID: `10_UPF_${neId},1010_001,1011_001,1005_001`,
subGroupID: subGroupIDArr.join(','),
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -210,7 +228,7 @@ export default function useWS() {
userActivityReset();
upfTotalFlowReset();
topologyReset();
upfWhoId.value = '';
upfNeUId.value = '';
});
return {

View File

@@ -16,14 +16,8 @@ import { listIMSSessionNum } from '@/api/neData/ims';
import { listAMFNblist } from '@/api/neData/amf';
import { listMMENblist } from '@/api/neData/mme';
import {
graphNodeClickID,
graphState,
notNeNodes,
graphNodeStateNum,
neStateRequestMap,
} from './hooks/useTopology';
import { upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
import { graphNodeClickID, graphState, notNeNodes } from './hooks/useTopology';
import { upfNeUId, upfTotalFlow, upfTFActive } from './hooks/useUPFTotalFlow';
import { useFullscreen } from '@vueuse/core';
import useWS from './hooks/useWS';
import useAppStore from '@/store/modules/app';
@@ -31,9 +25,10 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { useRouter } from 'vue-router';
import useNeStore from '@/store/modules/ne';
import { message } from 'ant-design-vue';
import { upfWhoId } from './hooks/useWS';
import { listAMFNbStatelist } from '@/api/neData/amf';
import { listMMENbStatelist } from '@/api/neData/mme';
import { eventNeUid } from './hooks/useUserActivity';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore();
const router = useRouter();
@@ -99,14 +94,15 @@ function fnGetNeState() {
if (neInfoList.length === 0) continue;
for (const neInfo of neInfoList) {
if (!neInfo.neType || !neInfo.neId) continue;
if (!neInfo.neType || !neInfo.neUid) continue;
wsSend({
requestId: `neState_${neInfo.neType}_${neInfo.neId}`,
requestId: `neState_${neInfo.coreUid}_${neInfo.neUid}_${neInfo.neType}`,
type: 'ne_state',
data: {
coreUid: neInfo.coreUid,
neType: neInfo.neType,
neId: neInfo.neId,
neUid: neInfo.neUid,
},
});
}
@@ -131,7 +127,10 @@ async function fnGetSkim() {
[
'SMF',
{
request: (neId: string) => listSMFSubNum(neId),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.SMF = neUid;
return listSMFSubNum(coreUid, neUid);
},
process: (res: any) => {
if (
res.code === RESULT_CODE_SUCCESS &&
@@ -145,7 +144,10 @@ async function fnGetSkim() {
[
'IMS',
{
request: (neId: string) => listIMSSessionNum(neId),
request: (coreUid: string, neUid: string) => {
eventNeUid.value.IMS = neUid;
return listIMSSessionNum(coreUid, neUid);
},
process: (res: any) => {
if (
res.code === RESULT_CODE_SUCCESS &&
@@ -174,17 +176,18 @@ async function fnGetSkim() {
[
'AMF',
{
request: (neId: string) => listAMFNblist({ neId }),
process: async (res: any, neId: any) => {
console.log(neId);
request: (coreUid: string, neUid: string) => {
eventNeUid.value.AMF = neUid;
return listAMFNblist({ coreUid, neUid });
},
process: async (res: any, coreUid: any, neUid: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.gnbNum += res.data.length;
skimState.gnbUeNum += res.data.reduce(
(sum: number, item: any) => sum + item.ueNum,
0
);
const amfNbRes = await listAMFNbStatelist({ neId });
console.log(amfNbRes);
const amfNbRes = await listAMFNbStatelist({ coreUid, neUid });
if (
amfNbRes.code === RESULT_CODE_SUCCESS &&
Array.isArray(amfNbRes.data)
@@ -214,8 +217,11 @@ async function fnGetSkim() {
[
'MME',
{
request: (neId: string) => listMMENblist({ neId }),
process: async (res: any, neId: any) => {
request: (coreUid: string, neUid: string) => {
eventNeUid.value.MME = neUid;
return listMMENblist({ coreUid, neUid });
},
process: async (res: any, coreUid: any, neUid: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.enbNum += res.data.length;
skimState.enbUeNum += res.data.reduce(
@@ -223,14 +229,12 @@ async function fnGetSkim() {
0
);
const mmeNbRes = await listMMENbStatelist({ neId });
console.log(mmeNbRes);
const mmeNbRes = await listMMENbStatelist({ coreUid, neUid });
if (
mmeNbRes.code === RESULT_CODE_SUCCESS &&
Array.isArray(mmeNbRes.data)
) {
// skimState.eNbSumNum += mmeNbRes.data.length;
console.log(mmeNbRes);
tempEnbSumNum += mmeNbRes.data.length;
}
}
@@ -244,13 +248,13 @@ async function fnGetSkim() {
(ne: any) =>
ne.children
?.map((child: any) => {
console.log(child.neId);
const handler = neHandlers.get(child.neType);
return handler
? {
promise: handler.request(child.neId),
promise: handler.request(child.coreUid, child.neUid),
process: handler.process,
neId: child.neId, // 这里加上neId
coreUid: child.coreUid,
neUid: child.neUid,
}
: null;
})
@@ -280,9 +284,9 @@ async function fnGetSkim() {
const processPromises = results.map((result: any, index: any) => {
const req = requests[index];
if (result.status === 'fulfilled') {
return req.process(result.value, req.neId);
return req.process(result.value, req.coreUid, req.neUid);
} else {
return req.process(0, req.neId);
return req.process(0, req.coreUid, req.neUid);
}
});
@@ -291,7 +295,12 @@ async function fnGetSkim() {
skimState.eNbSumNum = tempEnbSumNum;
// UDM
listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
listUDMSub({
coreUid: currentCoreUid(),
neUid: udmNeUid.value,
pageNum: 1,
pageSize: 1,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res.data.total;
}
@@ -335,12 +344,12 @@ function fnToRouter(name: string, query?: any) {
}
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
let upfOtions = ref<Record<string, any>[]>([]);
// UPF实时流量下拉框选择
function fnSelectNe(value: any, option: any) {
upfWhoId.value = value;
reSendUPF(value);
upfNeUId.value = value;
reSendUPF();
// upfTotalFlow.value.map((item: any) => {
// item.requestFlag = false;
// });
@@ -353,35 +362,30 @@ function fnSelectNe(value: any, option: any) {
// UPF实时流量下拉菜单选择
function fnSelectUPF(e: any) {
upfWhoId.value = e.key;
reSendUPF(e.key);
upfNeUId.value = e.key;
reSendUPF();
for (var key in upfTotalFlow.value) {
upfTotalFlow.value[key].requestFlag = false;
}
}
let udmNeId = ref<string>('001');
let udmNeUid = ref<string>('001');
let udmOtions = ref<Record<string, any>[]>([]);
let onlineOtions = ref<Record<string, any>[]>([]);
/**用户数量-选择UDM */
async function fnSelectUDM(e: any) {
udmNeId.value = e.key;
udmNeUid.value = e.key;
try {
const res = await listUDMSub({
neId: udmNeId.value,
coreUid: currentCoreUid(),
neUid: udmNeUid.value,
pageNum: 1,
pageSize: 1,
});
console.log(res);
// listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
if (
res.code === RESULT_CODE_SUCCESS &&
typeof res.data.total === 'number'
) {
if (res.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res.data.total;
console.log(res);
} else {
skimState.udmSubNum = 0;
}
@@ -411,14 +415,15 @@ onMounted(() => {
neStore.getNeCascaderOptions.forEach(item => {
console.log(item);
if (item.value === 'UPF') {
neOtions.value = JSON.parse(JSON.stringify(item.children));
upfOtions.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 (upfOtions.value.length > 0) {
fnSelectNe(upfOtions.value[0].value, upfOtions.value[0]);
graphNodeClickID.value = `${upfOtions.value[0].neType}_${upfOtions.value[0].neUid}`;
}
if (udmOtions.value.length > 0) {
fnSelectUDM({ key: udmOtions.value[0].value });
@@ -459,7 +464,7 @@ onMounted(() => {
].includes(v.neType)
) {
onlineArr.push({
value: v.neType + '_' + v.neId,
value: v.neType + '_' + v.neUid,
label: v.neName,
rmUid: v.rmUid,
});
@@ -532,7 +537,7 @@ onBeforeUnmount(() => {
<a-menu-item
v-for="v in udmOtions"
:key="v.value"
:disabled="udmNeId === v.value"
:disabled="udmNeUid === v.value"
>
{{ v.label }}
</a-menu-item>
@@ -631,14 +636,14 @@ onBeforeUnmount(() => {
>
<div class="toDeep-text">
{{
neOtions.find(item => item.value === upfWhoId)?.label ||
upfOtions.find(item => item.value === upfNeUId)?.label ||
'Select UPF'
}}
<DownOutlined style="margin-left: -2px; font-size: 12px" />
</div>
<template #overlay>
<a-menu @click="fnSelectUPF">
<a-menu-item v-for="v in neOtions" :key="v.value">
<a-menu-item v-for="v in upfOtions" :key="v.value">
{{ v.label }}
</a-menu-item>
</a-menu>

View File

@@ -5,12 +5,11 @@ import { message, Form, Modal } from 'ant-design-vue/es';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { NE_TYPE_LIST } from '@/constants/ne-constants';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
import { addNeInfo, updateNeInfo, getNeInfo } from '@/api/ne/neInfo';
import { neHostAuthorizedRSA, testNeHost } from '@/api/ne/neHost';
import useDictStore from '@/store/modules/dict';
import useI18n from '@/hooks/useI18n';
import useI18n from '@/hooks/useI18n';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { getNeInfoByNF } from '@/api/ne/neAction';
const { getDict } = useDictStore();
const { t } = useI18n();
const emit = defineEmits(['ok', 'cancel', 'update:open']);
@@ -19,18 +18,14 @@ const props = defineProps({
type: Boolean,
default: false,
},
id: {
type: Number,
default: 0,
},
coreUid: {
type: String,
default: '',
},
neUid: {
type: String,
default: '',
},
neType: {
type: String,
default: '',
},
});
/**字典数据 */
@@ -210,8 +205,8 @@ function modalStateFromEqualIPV4AndIPV6(
* @param coreUid 核心网ID
* @param neUid 网元ID
*/
function fnModalVisibleByEdit(coreUid: string, neUid: string) {
if (!coreUid || !neUid) {
function fnModalVisibleByEdit(coreUid: string, id: number) {
if (!coreUid || !id) {
modalStateFrom.resetFields();
modalState.title = t('views.ne.neInfo.addTitle');
modalState.openByEdit = true;
@@ -219,7 +214,7 @@ function fnModalVisibleByEdit(coreUid: string, neUid: string) {
if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getNeInfoByNF(coreUid, neUid).then(res => {
getNeInfo(coreUid, id).then(res => {
modalState.confirmLoading = false;
hide();
if (res.code === RESULT_CODE_SUCCESS) {
@@ -334,7 +329,7 @@ function fnNeIPChange(e: any) {
watch(
() => props.open,
val => {
if (val) fnModalVisibleByEdit(props.coreUid, props.neUid);
if (val) fnModalVisibleByEdit(props.coreUid, props.id);
}
);

View File

@@ -99,6 +99,12 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */
let tableColumns: ColumnsType = [
{
title: t('views.ne.common.neUid'),
dataIndex: 'neUid',
align: 'left',
width: 100,
},
{
title: t('views.ne.common.neType'),
dataIndex: 'neType',
@@ -192,7 +198,7 @@ type ModalStateType = {
/**新增框或修改框是否显示 */
openByEdit: boolean;
/**新增框或修改框ID */
/**网元修改框 */
id: number;
coreUid: string;
neUid: string;
neType: string;
@@ -205,6 +211,7 @@ let modalState: ModalStateType = reactive({
openByBackConf: false,
openByOAM: false,
openByEdit: false,
id: 0,
coreUid: '',
neUid: '',
neType: '',
@@ -217,10 +224,12 @@ let modalState: ModalStateType = reactive({
*/
function fnModalVisibleByEdit(row?: Record<string, any>) {
if (!row) {
modalState.id = 0;
modalState.coreUid = '';
modalState.neUid = '';
modalState.neType = '';
} else {
modalState.id = row.id;
modalState.coreUid = row.coreUid;
modalState.neUid = row.neUid;
modalState.neType = row.neType;
@@ -295,7 +304,6 @@ function fnRecordDelete(id: string) {
let msg = t('views.ne.neInfo.delTip');
if (id === '0') {
msg = `${msg} ...${tableState.selectedRowKeys.length}`;
id = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
@@ -743,8 +751,7 @@ onMounted(() => {
<EditModal
v-model:open="modalState.openByEdit"
:core-uid="modalState.coreUid"
:ne-uid="modalState.neUid"
:ne-type="modalState.neType"
:id="modalState.id"
@ok="fnModalEditOk"
@cancel="fnModalEditCancel"
></EditModal>

View File

@@ -269,7 +269,6 @@ function fnModalVisibleByTypeAndId(coreUid: string, neUid: string) {
watch(
() => props.open,
val => {
console.log(props);
if (val && props.coreUid) {
if (props.neUid) {
fnModalVisibleByTypeAndId(props.coreUid, props.neUid);

View File

@@ -230,8 +230,7 @@ type ModalStateType = {
/**新增框或修改框是否显示 */
openByEdit: boolean;
coreUid: string;
neUid: string;
neType: string;
id: number;
/**确定按钮 loading */
confirmLoading: boolean;
};
@@ -240,8 +239,7 @@ type ModalStateType = {
let modalState: ModalStateType = reactive({
openByEdit: false,
coreUid: '',
neUid: '',
neType: '',
id: 0,
confirmLoading: false,
});
@@ -251,8 +249,7 @@ let modalState: ModalStateType = reactive({
*/
function fnModalVisibleByEdit(row: Record<string, any>) {
modalState.coreUid = row.coreUid;
modalState.neUid = row.neUid;
modalState.neType = row.neType;
modalState.id = row.id;
nextTick(() => {
modalState.openByEdit = true;
});
@@ -275,8 +272,7 @@ function fnModalOk(e: any) {
function fnModalCancel() {
modalState.openByEdit = false;
modalState.coreUid = '';
modalState.neUid = '';
modalState.neType = '';
modalState.id = 0;
}
/**刷新网元授权状态 */
@@ -508,8 +504,7 @@ onMounted(() => {
<EditModal
v-model:open="modalState.openByEdit"
:core-uid="modalState.coreUid"
:ne-uid="modalState.neUid"
:ne-type="modalState.neType"
:id="modalState.id"
@ok="fnModalOk"
@cancel="fnModalCancel"
></EditModal>

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { Form, Modal, message } from 'ant-design-vue/es';
import { onMounted, reactive, toRaw } from 'vue';
import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
import { addNeInfo, getNeInfo, updateNeInfo } from '@/api/ne/neInfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { NE_TYPE_LIST } from '@/constants/ne-constants';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
@@ -47,13 +47,13 @@ let modalState: ModalStateType = reactive({
title: '网元',
from: {
id: undefined,
neId: '',
coreUid: currentCoreUid(),
neUid: '',
neType: '',
neName: '',
ip: '',
ipAddr: '',
port: 33030,
pvFlag: 'PNF',
coreUid: currentCoreUid(),
macAddr: '',
dn: '-',
vendorName: '-',
@@ -101,13 +101,13 @@ const modalStateFrom = Form.useForm(
message: t('views.ne.common.neTypePlease'),
},
],
neId: [
neName: [
{
required: true,
message: t('views.ne.common.neUidPlease'),
message: t('views.ne.common.neNamePlease'),
},
],
ip: [
ipAddr: [
{
required: true,
validator: modalStateFromEqualIPV4AndIPV6,
@@ -146,79 +146,50 @@ function fnModalOk() {
const from = toRaw(modalState.from);
modalStateFrom
.validate()
.then(e => {
modalState.confirmLoading = true;
return getNeInfoByNF(from.coreUid, from.neUid);
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
// 补充更新必要信息
from.id = res.data.id;
from.hostIds = res.data.hostIds;
const hostIds = res.data.hostIds.split(',');
if (hostIds.length == 2) {
from.hosts[0].id = parseInt(hostIds[0]);
from.hosts[1].id = parseInt(hostIds[1]);
}
return true;
} else {
// 清除更新必要信息
from.id = undefined;
from.hostIds = '';
for (let index = 0; index < from.hosts.length; index++) {
from.hosts[index].id = undefined;
}
return false;
.then(() => {
// 清除更新必要信息
from.id = undefined;
from.hostIds = '';
for (let index = 0; index < from.hosts.length; index++) {
from.hosts[index].id = undefined;
}
})
.then(isUpdate => {
let confirmTitle = t('views.ne.neQuickSetup.configAddTitle');
let confirmContent = t('views.ne.neQuickSetup.configAddTip');
if (isUpdate) {
confirmTitle = t('views.ne.neQuickSetup.configUpdateTitle');
confirmContent = t('views.ne.neQuickSetup.configUpdateTip');
}
Modal.confirm({
title: confirmTitle,
content: confirmContent,
onCancel: () => {
// 清除更新必要信息
from.id = undefined;
from.hostIds = '';
for (let index = 0; index < from.hosts.length; index++) {
from.hosts[index].id = undefined;
}
},
onOk: () => {
from.rmUid = `4400HX${from.neType}${from.neId}`; // 4400HX1AMF001
from.neName = `${from.neType}_${from.neId}`; // AMF_001
const hide = message.loading(t('common.loading'), 0);
const result =
isUpdate && from.id ? updateNeInfo(from) : addNeInfo(from);
result
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `${t('common.operateOk')}`,
duration: 3,
});
neStore.fnNelistRefresh(); // 刷新缓存的网元信息
stepState.neInfo = from; // 保存网元信息
modalState.stepNext = true; // 开启下一步
} else {
message.error({
content: res.msg,
duration: 3,
});
}
})
.finally(() => {
hide();
modalState.confirmLoading = false;
const hide = message.loading(t('common.loading'), 0);
addNeInfo(from)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `${t('common.operateOk')}`,
duration: 3,
});
},
});
return res.data;
}
message.error({
content: res.msg,
duration: 3,
});
return 0;
})
.then(neId => {
if (neId === 0) {
return;
}
neStore.fnNelistRefresh(); // 刷新缓存的网元信息
getNeInfo(from.coreUid, neId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
stepState.neInfo = res.data; // 保存网元信息
modalState.stepNext = true; // 开启下一步
} else {
message.error({
content: res.msg,
duration: 3,
});
}
});
})
.finally(() => {
hide();
modalState.confirmLoading = false;
});
})
.catch(e => {
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
@@ -327,10 +298,10 @@ onMounted(() => {
if (stepState.neInfo.id) {
Object.assign(modalState.from, stepState.neInfo);
} else {
modalState.from.ip = stepState.neHost.addr;
modalState.from.ipAddr = stepState.neHost.addr;
Object.assign(modalState.from.hosts[0], stepState.neHost);
Object.assign(modalState.from.hosts[1], {
addr: modalState.from.ip,
addr: modalState.from.ipAddr,
user: 'admin',
password: 'admin',
});
@@ -344,119 +315,95 @@ onMounted(() => {
<a-form
name="modalStateFrom"
layout="horizontal"
:label-col="{ span: 6 }"
:label-col="{ span: 3 }"
:wrapper-col="{ span: 9 }"
:labelWrap="true"
>
<a-row>
<a-col :lg="6" :md="6" :xs="24" :offset="6">
<a-form-item
:label="t('views.ne.common.neType')"
name="neType"
v-bind="modalStateFrom.validateInfos.neType"
>
<a-auto-complete
v-model:value="modalState.from.neType"
:options="
NE_TYPE_LIST.filter(s => s !== 'OMC').map(v => ({ value: v }))
"
@change="fnNeTypeChange"
>
<a-input
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="32"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.ne.common.neTypeTip') }}
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-auto-complete>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item
:label="t('views.ne.common.neUid')"
name="neId"
v-bind="modalStateFrom.validateInfos.neId"
>
<a-input
v-model:value="modalState.from.neId"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="24"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.ne.common.neUidTip') }}
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
<a-form-item
:label="t('views.ne.common.ipAddr')"
name="ip"
v-bind="modalStateFrom.validateInfos.ipAddr"
>
<a-input
v-model:value="modalState.from.ipAddr"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="128"
@change="fnNeIPChange"
:disabled="true"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.ne.common.ipAddrTip') }}
</div>
</template>
</a-input>
</a-form-item>
</a-col>
</a-row>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
<a-row>
<a-col :lg="6" :md="6" :xs="24" :offset="6">
<a-form-item
:label="t('views.ne.common.ipAddr')"
name="ip"
v-bind="modalStateFrom.validateInfos.ip"
<a-form-item
:label="t('views.ne.common.port')"
name="port"
v-bind="modalStateFrom.validateInfos.port"
:help="t('views.ne.common.portTip')"
>
<a-input-number
v-model:value="modalState.from.port"
style="width: 100%"
:min="1"
:max="65535"
:maxlength="5"
placeholder="<=65535"
>
</a-input-number>
</a-form-item>
<a-form-item
:label="t('views.ne.common.neType')"
name="neType"
v-bind="modalStateFrom.validateInfos.neType"
>
<a-auto-complete
v-model:value="modalState.from.neType"
:options="
NE_TYPE_LIST.filter(s => s !== 'OMC').map(v => ({ value: v }))
"
@change="fnNeTypeChange"
>
<a-input
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="32"
>
<a-input
v-model:value="modalState.from.ip"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="128"
@change="fnNeIPChange"
:disabled="true"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.ne.common.ipAddrTip') }}
</div>
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item
:label="t('views.ne.common.port')"
name="port"
v-bind="modalStateFrom.validateInfos.port"
>
<a-input-number
v-model:value="modalState.from.port"
style="width: 100%"
:min="1"
:max="65535"
:maxlength="5"
placeholder="<=65535"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>{{ t('views.ne.common.portTip') }}</div>
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input-number>
</a-form-item>
</a-col>
</a-row>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.ne.common.neTypeTip') }}
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-auto-complete>
</a-form-item>
<a-form-item
:label="t('views.ne.common.neName')"
name="neName"
v-bind="modalStateFrom.validateInfos.neName"
>
<a-input
v-model:value="modalState.from.neName"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="24"
>
</a-input>
</a-form-item>
</a-form>
<div class="ne-oper">

View File

@@ -132,7 +132,7 @@ function fnGetList(pageNum?: number) {
tableState.queryParams.pageNum = pageNum;
}
listNeSoftware(toRaw(tableState.queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
@@ -158,7 +158,8 @@ type StateType = {
/**软件包信息数据 */
from: {
neType: string; // 版本需要
neId: string; // 版本需要
coreUid: string; // 版本需要
neUid: string; // 版本需要
name: string; // 软件需要
path: string;
version: string; // 软件需要
@@ -177,7 +178,8 @@ let state: StateType = reactive({
from: {
id: undefined,
neType: '',
neId: '',
coreUid: '',
neUid: '',
name: '',
path: '',
version: '',
@@ -243,8 +245,9 @@ function fnRecordInstall() {
preinput = { pisCSCF: 'y', updateMFetc: 'No', updateMFshare: 'No' };
}
const res = await operateNeVersion({
coreUid: from.coreUid,
neUid: from.neUid,
neType: from.neType,
neId: from.neId,
action: 'install',
preinput: preinput,
});
@@ -287,11 +290,12 @@ function fnStepNext() {
}
onMounted(() => {
const { neType, neId } = stepState.neInfo;
if (neId) {
const { neType,neUid, coreUid } = stepState.neInfo;
if (neType && neUid && coreUid) {
tableState.queryParams.neType = neType;
state.from.neUid = neUid;
state.from.neType = neType;
state.from.neId = neId;
state.from.coreUid = coreUid;
fnGetList(1);
}
});

View File

@@ -16,11 +16,14 @@ type StateType = {
openByFile: boolean;
/**授权信息数据 */
from: {
coreUid: string;
neUid: string;
neType: string;
neId: string;
// 下面是状态检查结果
expire: string;
sn: string;
ueNumber: string;
nbNumber: string;
};
/**确定按钮 loading */
confirmLoading: boolean;
@@ -33,10 +36,14 @@ type StateType = {
let state: StateType = reactive({
openByFile: false,
from: {
coreUid: '',
neUid: '',
neType: '',
neId: '',
// 下面是状态检查结果
expire: '',
sn: '',
ueNumber: '',
nbNumber: '',
},
confirmLoading: false,
timeInterval: null,
@@ -59,6 +66,8 @@ function fnModalOk(e: any) {
if (res.code === RESULT_CODE_SUCCESS && res.data) {
state.from.sn = res.data.sn;
state.from.expire = res.data.expire;
state.from.ueNumber = res.data.ueNumber;
state.from.nbNumber = res.data.ueNumber;
clearInterval(state.timeInterval);
state.timeInterval = null;
@@ -88,18 +97,18 @@ function fnStepEnd() {
}
onMounted(() => {
const { neType, neId } = stepState.neInfo;
if (neId) {
state.from.neType = neType;
state.from.neId = neId;
const { coreUid, neUid } = stepState.neInfo;
if (coreUid && neUid) {
state.from.coreUid = coreUid;
state.from.neUid = neUid;
state.confirmLoading = true;
stateNeLicense(neType, neId)
stateNeLicense(coreUid, neUid)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data) {
state.from.sn = res.data.sn;
state.from.expire = res.data.expire;
} else {
return codeNeLicense(neType, neId);
return codeNeLicense(coreUid, neUid);
}
})
.finally(() => {
@@ -160,9 +169,11 @@ onUnmounted(() => {
</div>
<div v-if="state.from.sn !== ''" style="font-size: 16px">
<p>{{ t('views.ne.common.neType') }}{{ state.from.neType }}</p>
<p>{{ t('views.ne.common.neUid') }}{{ state.from.neId }}</p>
<p>{{ t('views.ne.common.neUid') }}{{ state.from.neUid }}</p>
<p>{{ t('views.ne.common.serialNum') }}{{ state.from.sn }}</p>
<p>{{ t('views.ne.common.expiryDate') }}{{ state.from.expire }}</p>
<p>{{ t('views.ne.common.ueNumber') }}{{ state.from.ueNumber }}</p>
<p>{{ t('views.ne.common.nbNumber') }}{{ state.from.nbNumber }}</p>
</div>
</a-result>
@@ -170,7 +181,8 @@ onUnmounted(() => {
<EditModal
v-model:open="state.openByFile"
:ne-type="state.from.neType"
:ne-id="state.from.neId"
:ne-uid="state.from.neUid"
:core-uid="state.from.coreUid"
:reload="true"
@ok="fnModalOk"
@cancel="fnModalCancel"

View File

@@ -50,61 +50,62 @@ export function usePara5G() {
Array.isArray(resArr[1].data)
) {
for (const item of resArr[1].data) {
const ipAddr = item.ipAddr;
// 公共配置文件sbi的各网元IP
switch (item.neType) {
case 'OMC':
state.from.sbi.omc_ip = item.ip;
state.from.sbi.omc_ip = ipAddr;
Object.assign(state.omcInfo, item); // 主动改OMC_IP
break;
case 'IMS':
state.from.sbi.ims_ip = item.ip;
state.from.sbi.ims_ip = ipAddr;
state.hasNE.ims = true;
break;
case 'AMF':
state.from.sbi.amf_ip = item.ip;
state.from.sbi.amf_ip = ipAddr;
state.hasNE.amf = true;
break;
case 'AUSF':
state.from.sbi.ausf_ip = item.ip;
state.from.sbi.ausf_ip = ipAddr;
break;
case 'UDM':
state.from.sbi.udm_ip = item.ip;
state.from.sbi.udm_ip = ipAddr;
state.from.sbi.db_ip = '0.0.0.0';
break;
case 'SMF':
state.from.sbi.smf_ip = item.ip;
state.from.sbi.smf_ip = ipAddr;
break;
case 'PCF':
state.from.sbi.pcf_ip = item.ip;
state.from.sbi.pcf_ip = ipAddr;
break;
case 'NSSF':
state.from.sbi.nssf_ip = item.ip;
state.from.sbi.nssf_ip = ipAddr;
break;
case 'NRF':
state.from.sbi.nrf_ip = item.ip;
state.from.sbi.nrf_ip = ipAddr;
break;
case 'UPF':
state.from.sbi.upf_ip = item.ip;
state.from.sbi.upf_ip = ipAddr;
state.hasNE.upf = true;
break;
case 'LMF':
state.from.sbi.lmf_ip = item.ip;
state.from.sbi.lmf_ip = ipAddr;
break;
case 'NEF':
state.from.sbi.nef_ip = item.ip;
state.from.sbi.nef_ip = ipAddr;
break;
case 'MME':
state.from.sbi.mme_ip = item.ip;
if (item.ip.includes('.')) {
state.from.external.mmes11_ip = item.ip + '/24';
state.from.sbi.mme_ip = ipAddr;
if (ipAddr.includes('.')) {
state.from.external.mmes11_ip = ipAddr + '/24';
}
state.hasNE.mme = true;
break;
case 'N3IWF':
state.from.sbi.n3iwf_ip = item.ip;
state.from.sbi.n3iwf_ip = ipAddr;
break;
case 'SMSC':
state.from.sbi.smsc_ip = item.ip;
state.from.sbi.smsc_ip = ipAddr;
break;
}
}

View File

@@ -1,10 +1,4 @@
import {
defineAsyncComponent,
onMounted,
reactive,
shallowRef,
watch,
} from 'vue';
import { defineAsyncComponent, reactive, shallowRef, watch } from 'vue';
/**步骤信息状态类型 */
type StepStateType = {

View File

@@ -191,7 +191,7 @@ function fnBeforeUploadFile(file: FileType) {
modalState.from.neType = neType;
// 根据给定的软件名取版本号 ims-r2.2312.x-ub22.deb
const matches = fileName.match(/([0-9.]+[0-9x]+)/);
const matches = fileName.match(/([0-9.]+[0-9a-zA-Z]+)/);
if (matches) {
modalState.from.version = matches[0];
}

View File

@@ -70,7 +70,7 @@ onMounted(() => {
<template #content>
<div>
<strong>{{ t('views.ne.common.neType') }}:&nbsp;</strong>
<span v-for="v in task.neList"> {{ v }} &nbsp;&nbsp; </span>
<span v-for="v in task.neList"> {{ v }} &nbsp; </span>
</div>
<div>
<strong> {{ t('views.traceManage.task.startTime') }}:&nbsp; </strong>

View File

@@ -236,7 +236,6 @@ function fnRecordDelete(id: string) {
if (id === '0') {
const mun = `...${tableState.selectedRowKeys.length}`;
msg = `${t('views.traceManage.task.delTaskTip', { id: mun })} `;
id = tableState.selectedRowKeys.join(',');
}
Modal.confirm({

View File

@@ -19,6 +19,8 @@ import dayjs, { Dayjs } from 'dayjs';
import saveAs from 'file-saver';
import PQueue from 'p-queue';
import { useClipboard } from '@vueuse/core';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_AMF_UE } from '@/constants/ne-constants';
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
const { getDict } = useDictStore();
@@ -65,9 +67,10 @@ let rangePickerPresets = ref([
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
neType: 'AMF',
neId: '001',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
eventType: '',
imsi: '',
sortField: 'timestamp',
@@ -387,6 +390,8 @@ const realTimeData = ref<boolean>(false);
function fnRealTime() {
realTimeData.value = !realTimeData.value;
if (realTimeData.value) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
tableState.seached = false;
// 建立链接
const options: OptionsType = {
@@ -394,9 +399,9 @@ function fnRealTime() {
params: {
/**订阅通道组
*
* AMF_UE会话事件(GroupID:1010_neId)
* AMF_UE会话事件(GroupID:1010_coreUid_neUid)
*/
subGroupID: `1010_${queryParams.neId}`,
subGroupID: `${WS_GROUP_AMF_UE}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -423,8 +428,10 @@ function wsMessage(res: Record<string, any>) {
if (!data?.groupId) {
return;
}
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
// ueEvent AMF_UE会话事件
if (data.groupId === `1010_${queryParams.neId}`) {
if (data.groupId === `${WS_GROUP_AMF_UE}_${coreUid}_${neUid}`) {
const ueEvent = data.data;
queue.add(async () => {
modalState.maxId += 1;
@@ -478,7 +485,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
} else {
message.warning({
content: t('common.noData'),
@@ -508,9 +515,9 @@ onBeforeUnmount(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="AMF" name="neId ">
<a-form-item label="AMF" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnGetList(1)"

View File

@@ -92,7 +92,7 @@ let queryParams = reactive({
/**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
pageSize: 10,
});
/**表格状态类型 */
@@ -169,9 +169,9 @@ let tablePagination = reactive({
/**当前页数 */
current: 1,
/**每页条数 */
pageSize: 20,
pageSize: 10,
/**默认的每页条数 */
defaultPageSize: 20,
defaultPageSize: 10,
/**指定每页可以显示多少条 */
pageSizeOptions: ['10', '20', '50', '100'],
/**只有一页时是否隐藏分页器 */

View File

@@ -10,6 +10,7 @@ import useNeStore from '@/store/modules/ne';
import { useRoute } from 'vue-router';
import { listAMFNblist } from '@/api/neData/amf';
import { listMMENblist } from '@/api/neData/mme';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore();
const route = useRoute();
const { t } = useI18n();
@@ -19,8 +20,10 @@ let neCascaderOptions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: '',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: '',
/**网元类型 */
neType: ['', ''],
/**GNB_ID */
@@ -34,7 +37,6 @@ let queryParams = reactive({
/**查询参数重置 */
function fnQueryReset() {
queryParams = Object.assign(queryParams, {
neId: '',
id: '',
pageNum: 1,
pageSize: 20,
@@ -156,7 +158,8 @@ function fnGetList(pageNum?: number) {
item.children.forEach((child: any) => {
let resq = null;
let s = {
neId: child.neId,
coreUid: queryParams.coreUid,
neUid: child.neUid,
neType: child.neType,
nbId: queryParams.id,
pageNum: queryParams.pageNum,
@@ -173,9 +176,9 @@ function fnGetList(pageNum?: number) {
resq.then(res => {
// 添加 neName 字段到每一项数据
if (res.code === RESULT_CODE_SUCCESS) {
res.data.forEach((row: any) => {
row.neName = `${child.neType}_${child.neId}`;
});
// res.data.forEach((row: any) => {
// row.neName = `${child.neType}_${child.neUid}`;
// });
}
return res;
})
@@ -218,7 +221,8 @@ function fnGetList(pageNum?: number) {
let toBack: Record<string, any> = {
neType: queryParams.neType[0],
neId: queryParams.neType[1],
neUid: queryParams.neType[1],
coreUid: queryParams.coreUid,
nbId: queryParams.id,
pageNum: queryParams.pageNum,
pageSize: queryParams.pageSize,
@@ -290,10 +294,10 @@ onMounted(() => {
const item = neCascaderOptions.value.find(s => s.value === queryNeType);
if (item && item.children) {
const info = item.children[0];
queryParams.neType = [info.neType, info.neId];
queryParams.neType = [info.neType, info.neUid];
} else {
const info = neCascaderOptions.value[0].children[0];
queryParams.neType = [info.neType, info.neId];
queryParams.neType = [info.neType, info.neUid];
}
// 获取列表数据
@@ -312,7 +316,7 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item name="neId" :label="t('views.neUser.base5G.neType')">
<a-form-item name="neUid" :label="t('views.ne.common.neType')">
<a-cascader
v-model:value="queryParams.neType"
:options="neCascaderOptions"

View File

@@ -9,6 +9,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
import { exportNBState, listNBState } from '@/api/neData/nb-state';
import { Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const emit = defineEmits(['cancel', 'update:open']);
const props = defineProps({
@@ -21,13 +22,15 @@ const props = defineProps({
default: false,
},
/**网元ID */
neId: {
neUid: {
type: String,
default: false,
default: '',
required: true,
},
neType: {
coreUid: {
type: String,
default: false,
default: '',
required: true,
},
});
@@ -51,9 +54,10 @@ const nbStateOptions = ref<DictType[]>([
/**查询参数 */
let queryParams = reactive({
/**网元 */
neType: '',
neId: '',
/**核心网标识 */
coreUid: props.coreUid,
/**网元标识 */
neUid: props.neUid,
/**排序字段 */
sortField: 'id',
sortOrder: 'desc',
@@ -209,7 +213,10 @@ function fnExportList() {
content: t('common.operateOk'),
duration: 3,
});
saveAs(res.data, `nb_state_history_records_export_${Date.now()}.xlsx`);
saveAs(
res.data,
`nb_state_history_records_export_${Date.now()}.xlsx`
);
} else {
message.error({
content: `${res.msg}`,
@@ -245,7 +252,7 @@ function fnGetList(pageNum?: number) {
}
listNBState(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
@@ -278,8 +285,8 @@ watch(
() => props.open,
val => {
if (val) {
queryParams.neType = props.neType;
queryParams.neId = props.neId;
queryParams.coreUid = props.coreUid;
queryParams.neUid = props.neUid;
// 获取列表数据
fnGetList();
}

View File

@@ -31,6 +31,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import saveAs from 'file-saver';
import { readSheet, writeSheet } from '@/utils/execl-utils';
import { useRoute } from 'vue-router';
import { currentCoreUid } from '@/hooks/useCoreUid';
const route = useRoute();
const neStore = useNeStore();
@@ -60,8 +61,10 @@ let neCascaderOptions = ref<Record<string, any>[]>([]);
let neTypeAndId = ref<string[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: '',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: '',
/**IMSI */
state: undefined,
});
@@ -208,8 +211,8 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
* @param index ID
*/
function fnRecordDelete(index: string) {
const [neType, neId] = neTypeAndId.value;
if (!neId) return;
const [neType, neUid] = neTypeAndId.value;
if (!neUid) return;
let msg = `Delete index as:${index}`;
if (index === '0') {
msg = `Remove the index checkbox:${tableState.selectedRowKeys.length}`;
@@ -219,6 +222,7 @@ function fnRecordDelete(index: string) {
title: t('common.tipTitle'),
content: msg,
onOk() {
const coreUid = currentCoreUid();
const reqArr = [];
if (index === '0') {
if (tableState.selectedRowKeys.length <= 0) {
@@ -226,18 +230,18 @@ function fnRecordDelete(index: string) {
}
for (const v of tableState.selectedRowKeys) {
if (neType === 'MME') {
reqArr.push(delMMENbState(neId, v));
reqArr.push(delMMENbState(coreUid, neUid, v));
}
if (neType === 'AMF') {
reqArr.push(delAMFNbState(neId, v));
reqArr.push(delAMFNbState(coreUid, neUid, v));
}
}
} else {
if (neType === 'MME') {
reqArr.push(delMMENbState(neId, index));
reqArr.push(delMMENbState(coreUid, neUid, index));
}
if (neType === 'AMF') {
reqArr.push(delAMFNbState(neId, index));
reqArr.push(delAMFNbState(coreUid, neUid, index));
}
}
if (reqArr.length <= 0) return;
@@ -266,8 +270,8 @@ function fnRecordDelete(index: string) {
function fnGetList() {
if (tableState.loading) return;
tableState.loading = true;
const [neType, neId] = neTypeAndId.value;
queryParams.neId = neId;
const [neType, neUid] = neTypeAndId.value;
queryParams.neUid = neUid;
let req = null;
if (neType === 'MME') {
req = listMMENbStatelist(toRaw(queryParams));
@@ -402,8 +406,9 @@ function fnModalVisibleByEdit(edit?: string | number) {
* 进行表达规则校验
*/
function fnModalOk() {
const [neType, neId] = neTypeAndId.value;
if (!neId) return;
const [neType, neUid] = neTypeAndId.value;
if (!neUid) return;
const coreUid = currentCoreUid();
const from = JSON.parse(JSON.stringify(modalState.from));
modalStateFrom
.validate()
@@ -413,13 +418,13 @@ function fnModalOk() {
let result: any = null;
if (neType === 'MME') {
result = from.state
? editMMENbState(neId, from)
: addMMENbState(neId, from);
? editMMENbState(coreUid, neUid, from)
: addMMENbState(coreUid, neUid, from);
}
if (neType === 'AMF') {
result = from.state
? editAMFNbState(neId, from)
: addAMFNbState(neId, from);
? editAMFNbState(coreUid, neUid, from)
: addAMFNbState(coreUid, neUid, from);
}
if (result === null) {
return;
@@ -534,7 +539,7 @@ function fnModalImportClose() {
/**对话框表格信息导入上传 */
function fnModalImportUpload(file: File) {
const hide = message.loading(t('common.loading'), 0);
const [neType, neId] = neTypeAndId.value;
const [neType, neUid] = neTypeAndId.value;
modalState.importMsgArr = [];
// 获取最大index
@@ -560,6 +565,7 @@ function fnModalImportUpload(file: File) {
return;
}
// 开始导入
const coreUid = currentCoreUid();
modalState.confirmLoading = true;
for (const row of rows) {
const rowId = row[t('common.rowId')];
@@ -575,7 +581,8 @@ function fnModalImportUpload(file: File) {
// 定义则更新名称位置
if (neType === 'MME') {
result = await editMMENbState(
neId,
coreUid,
neUid,
Object.assign({}, hasAddress, {
name,
position,
@@ -584,7 +591,8 @@ function fnModalImportUpload(file: File) {
}
if (neType === 'AMF') {
result = await editAMFNbState(
neId,
coreUid,
neUid,
Object.assign({}, hasAddress, {
name,
position,
@@ -609,10 +617,10 @@ function fnModalImportUpload(file: File) {
address: `${address}`,
};
if (neType === 'MME') {
result = await addMMENbState(neId, form);
result = await addMMENbState(coreUid, neUid, form);
}
if (neType === 'AMF') {
result = await addAMFNbState(neId, form);
result = await addAMFNbState(coreUid, neUid, form);
}
let msg = `${t('common.rowId')}: ${rowId} ${t(
'views.neData.baseStation.addRadio'
@@ -669,16 +677,16 @@ onMounted(() => {
});
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];
neTypeAndId.value = [info.neType, info.neUid];
} else {
const info = neCascaderOptions.value[0].children[0];
neTypeAndId.value = [info.neType, info.neId];
neTypeAndId.value = [info.neType, info.neUid];
}
// 获取列表数据
@@ -908,7 +916,8 @@ onMounted(() => {
v-model:open="modalState.openByHistory"
:title="t('views.neData.baseStation.history')"
:ne-type="neTypeAndId[0]"
:ne-id="neTypeAndId[1]"
:ne-uid="neTypeAndId[1]"
:core-uid="queryParams.coreUid"
@cancel="fnModalCancel"
></HistoryModal>

View File

@@ -179,11 +179,11 @@ const graphNodeTooltip = new Tooltip({
${nInfo.refreshTime ?? '--'}
</span></div>
<div>========================</div>
<div><strong>ID</strong><span>${nInfo.neId}</span></div>
<div><strong>ID</strong><span>${nInfo.neUid}</span></div>
<div><strong>${t('views.monitor.topology.name')}</strong><span>
${nInfo.neName ?? '--'}
</span></div>
<div><strong>IP</strong><span>${nInfo.neIP}</span></div>
<div><strong>IP</strong><span>${nInfo.ipAddr}</span></div>
<div><strong>${t('views.monitor.topology.version')}</strong><span>
${nInfo.version ?? '--'}
</span></div>
@@ -392,7 +392,12 @@ async function fnGraphDataBase() {
id: 'OMC',
label: omcInfo.neName,
img: parseBasePath('/svg/service_db.svg'),
nInfo: { online: false, neId: omcInfo.neId, neType: omcInfo.neType },
nInfo: {
online: false,
coreUid: omcInfo.coreUid,
neUid: omcInfo.neUid,
neType: omcInfo.neType,
},
nType: 'OMC',
};
// 添加OMC节点
@@ -402,12 +407,17 @@ async function fnGraphDataBase() {
if (['AMF', 'MME'].includes(item.value)) {
if (item.children?.length === 0) continue;
for (const child of item.children) {
const id = `${child.neType}_${child.neId}`;
const id = `${child.coreUid}_${child.neUid}`;
const node = {
id: id,
label: child.neName,
img: parseBasePath('/svg/service.svg'),
nInfo: { online: false, neId: child.neId, neType: child.neType },
nInfo: {
online: false,
coreUid: child.coreUid,
neUid: child.neUid,
neType: child.neType,
},
nType: item.value,
};
// 添加节点
@@ -430,8 +440,9 @@ async function fnGraphDataNb(data: GraphData) {
if (arr === undefined || arr.length === 0) return data;
for (const item of arr) {
if (item.nType === 'AMF') {
const neId = (item.nInfo as any).neId;
const res = await listAMFNbStatelist({ neId });
const coreUid = (item.nInfo as any).coreUid;
const neUid = (item.nInfo as any).neUid;
const res = await listAMFNbStatelist({ coreUid, neUid });
if (res.code !== RESULT_CODE_SUCCESS || !Array.isArray(res.data)) {
continue;
}
@@ -451,8 +462,12 @@ async function fnGraphDataNb(data: GraphData) {
}
}
if (item.nType === 'MME') {
const neId = (item.nInfo as any).neId;
const res = await listMMENbStatelist({ neId });
const coreUid = (item.nInfo as any).coreUid;
const neUid = (item.nInfo as any).neUid;
const res = await listMMENbStatelist({
coreUid,
neUid,
});
if (res.code !== RESULT_CODE_SUCCESS || !Array.isArray(res.data)) {
continue;
}
@@ -535,7 +550,10 @@ async function fnGraphState(reload: boolean = false) {
}
}
if (reload && nInfo.neType === 'MME') {
const res = await listMMENbStatelist({ neId: nInfo.neId });
const res = await listMMENbStatelist({
coreUid: nInfo.coreUid,
neUid: nInfo.neUid,
});
if (res.code == RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
for (const nb of res.data) {
const nbItem = graphData.nodes.find(

View File

@@ -23,6 +23,8 @@ import saveAs from 'file-saver';
import PQueue from 'p-queue';
import { useClipboard } from '@vueuse/core';
import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_IMS_CDR } from '@/constants/ne-constants';
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
const { getDict } = useDictStore();
@@ -70,9 +72,10 @@ let rangePickerPresets = ref([
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
neType: 'IMS',
neId: '001',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
recordType: '',
callerParty: '',
calledParty: '',
@@ -444,6 +447,8 @@ const realTimeData = ref<boolean>(false);
function fnRealTime() {
realTimeData.value = !realTimeData.value;
if (realTimeData.value) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
tableState.seached = false;
//
const options: OptionsType = {
@@ -453,7 +458,7 @@ function fnRealTime() {
*
* IMS_CDR会话事件(GroupID:1005)
*/
subGroupID: `1005_${queryParams.neId}`,
subGroupID: `${WS_GROUP_IMS_CDR}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -480,8 +485,10 @@ function wsMessage(res: Record<string, any>) {
if (!data?.groupId) {
return;
}
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
// cdrEvent CDR
if (data.groupId === `1005_${queryParams.neId}`) {
if (data.groupId === `${WS_GROUP_IMS_CDR}_${coreUid}_${neUid}`) {
const cdrEvent = data.data;
let cdrJSON = {};
try {
@@ -537,7 +544,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
} else {
message.warning({
content: t('common.noData'),
@@ -567,9 +574,9 @@ onBeforeUnmount(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="IMS" name="neId ">
<a-form-item label="IMS" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnQueryReset()"

View File

@@ -9,6 +9,7 @@ import useNeStore from '@/store/modules/ne';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { listIMSSessionList } from '@/api/neData/ims';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
@@ -17,8 +18,10 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: undefined,
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
/**IMSI */
imsi: '',
/**msisdn */
@@ -186,7 +189,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -205,9 +208,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.neUser.ims.neType')" name="neId ">
<a-form-item label="IMS" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>

View File

@@ -19,6 +19,8 @@ import { OptionsType, WS } from '@/plugins/ws-websocket';
import saveAs from 'file-saver';
import PQueue from 'p-queue';
import { useClipboard } from '@vueuse/core';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_MME_UE } from '@/constants/ne-constants';
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
const { getDict } = useDictStore();
@@ -66,9 +68,10 @@ let rangePickerPresets = ref([
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
neType: 'MME',
neId: '001',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
eventType: '',
imsi: '',
sortField: 'timestamp',
@@ -389,16 +392,18 @@ const realTimeData = ref<boolean>(false);
function fnRealTime() {
realTimeData.value = !realTimeData.value;
if (realTimeData.value) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
tableState.seached = false;
// 建立链接
const options: OptionsType = {
url: '/ws',
params: {
/**订阅通道组
/**订阅通道组
*
* MME_UE会话事件(GroupID:1011_neId)
* MME_UE会话事件(GroupID:1011_coreUid_neUid)
*/
subGroupID: `1011_${queryParams.neId}`,
subGroupID: `${WS_GROUP_MME_UE}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -426,7 +431,7 @@ function wsMessage(res: Record<string, any>) {
return;
}
// ueEvent MME_UE会话事件
if (data.groupId === `1011_${queryParams.neId}`) {
if (data.groupId === `${WS_GROUP_MME_UE}_${queryParams.coreUid}_${queryParams.neUid}`) {
const ueEvent = data.data;
queue.add(async () => {
modalState.maxId += 1;
@@ -486,7 +491,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
} else {
message.warning({
content: t('common.noData'),
@@ -516,9 +521,9 @@ onBeforeUnmount(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MME" name="neId ">
<a-form-item label="MME" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnGetList(1)"

View File

@@ -5,10 +5,11 @@ 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 { listN3IWFSubList } from '@/api/neUser/n3iwf';
import { listN3IWFSubList } from '@/api/neData/n3iwf';
import useNeStore from '@/store/modules/ne';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -16,8 +17,10 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: undefined,
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
/**imsi */
imsi: '',
});
@@ -94,7 +97,7 @@ function fnGetList() {
listN3IWFSubList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const { total, rows } = res.data;
tableState.data = rows;
tableState.data = rows;
} else {
tableState.data = [];
}
@@ -117,7 +120,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
//
@@ -136,9 +139,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="8" :md="12" :xs="24">
<a-form-item :label="t('views.neUser.n3iwf.neType')" name="neId ">
<a-form-item label="N3IWF" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>

View File

@@ -1,13 +1,37 @@
<script setup lang="ts">
import { reactive, onMounted } from 'vue';
import { reactive, onMounted, ref, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
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 { listNSSFAmfList } from '@/api/neUser/nssf';
import { listNSSFAmfList } from '@/api/neData/nssf';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
import useNeStore from '@/store/modules/ne';
import { message } from 'ant-design-vue';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
/**imsi */
amfSetId: '',
});
/**查询参数重置 */
function fnQueryReset() {
queryParams = Object.assign(queryParams, {
amfSetId: '',
});
fnGetList(1);
}
/**表格状态类型 */
type TabeStateType = {
@@ -37,14 +61,13 @@ let tableColumns: ColumnsType = [
{
title: 'NF ID',
dataIndex: 'nfId',
align: 'center',
align: 'left',
width: 150,
},
{
title: 'AMF Set ID',
dataIndex: 'amfSetId',
align: 'center',
width: 150,
align: 'left',
},
];
@@ -57,13 +80,13 @@ function fnTableSize({ key }: MenuInfo) {
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
listNSSFAmfList().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
listNSSFAmfList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
//
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
}
const { total, rows } = res.data;
const { total, rows } = res.data;
tableState.data = rows;
} else {
tableState.data = [];
@@ -73,6 +96,23 @@ function fnGetList(pageNum?: number) {
}
onMounted(() => {
//
neStore.neCascaderOptions.forEach(item => {
if (item.value === 'NSSF') {
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.neUid = neOtions.value[0].value;
}
//
fnGetList();
});
@@ -80,6 +120,46 @@ onMounted(() => {
<template>
<PageContainer>
<a-card
v-show="tableState.seached"
:bordered="false"
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
>
<!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="8" :md="12" :xs="24">
<a-form-item label="NSSF" name="neUid ">
<a-select
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="AMF Set ID" name="amfSetId">
<a-input v-model:value="queryParams.amfSetId" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList()">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
<a-button type="default" @click.prevent="fnQueryReset">
<template #icon><ClearOutlined /></template>
{{ t('common.reset') }}
</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-card>
<a-card :bordered="false" :body-style="{ padding: '0px' }">
<!-- 插槽-卡片左侧侧 -->
<template #title> </template>

View File

@@ -1,13 +1,37 @@
<script setup lang="ts">
import { reactive, ref, onMounted } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { reactive, ref, onMounted, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
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 { listNSSFSubList } from '@/api/neUser/nssf';
import { listNSSFSubList } from '@/api/neData/nssf';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
import useNeStore from '@/store/modules/ne';
import { message } from 'ant-design-vue';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
/**imsi */
imsi: '',
});
/**查询参数重置 */
function fnQueryReset() {
queryParams = Object.assign(queryParams, {
imsi: '',
});
fnGetList();
}
/**表格状态类型 */
type TabeStateType = {
@@ -37,20 +61,19 @@ let tableColumns: ColumnsType = [
{
title: 'Subscription ID',
dataIndex: 'subscriptionId',
align: 'center',
align: 'left',
width: 150,
},
{
title: 'NF NSSAI Availability Uri',
dataIndex: 'nfNssaiAvailabilityUri',
align: 'center',
width: 150,
align: 'left',
width: 200,
},
{
title: 'Event',
dataIndex: 'event',
align: 'center',
width: 80,
align: 'left',
},
];
@@ -63,7 +86,7 @@ function fnTableSize({ key }: MenuInfo) {
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
listNSSFSubList().then(res => {
listNSSFSubList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
//
if (tableState.selectedRowKeys.length > 0) {
@@ -79,12 +102,69 @@ function fnGetList(pageNum?: number) {
}
onMounted(() => {
//
neStore.neCascaderOptions.forEach(item => {
if (item.value === 'NSSF') {
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.neUid = neOtions.value[0].value;
}
fnGetList();
});
</script>
<template>
<PageContainer>
<a-card
v-show="tableState.seached"
:bordered="false"
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
>
<!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="8" :md="12" :xs="24">
<a-form-item label="NSSF" name="neUid ">
<a-select
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="IMSI" name="imsi">
<a-input v-model:value="queryParams.imsi" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList()">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
<a-button type="default" @click.prevent="fnQueryReset">
<template #icon><ClearOutlined /></template>
{{ t('common.reset') }}
</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-card>
<a-card :bordered="false" :body-style="{ padding: '0px' }">
<!-- 插槽-卡片左侧侧 -->
<template #title> </template>
@@ -143,7 +223,7 @@ onMounted(() => {
:data-source="tableState.data"
:size="tableState.size"
:pagination="false"
:scroll="{ x: 1200, y: 400 }"
:scroll="{ y: 400 }"
>
</a-table>
</a-card>

View File

@@ -20,6 +20,7 @@ import { getPCFRule } from '@/api/ne/neConfig';
import { uploadFileToNE } from '@/api/tool/file';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { saveAs } from 'file-saver';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -36,8 +37,10 @@ const pcfRuleOption = ref<Record<string, any[]>>({
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: undefined,
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
/**移动编号 */
imsi: '',
/**号码 */
@@ -279,7 +282,9 @@ const modalStateFrom = Form.useForm(
* @param noticeId 网元id, 不传为新增
*/
function fnModalVisibleByEdit(row?: Record<string, any>) {
getPCFRule(queryParams.neId)
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
getPCFRule(coreUid, neUid)
.then((data: any) => {
pcfRuleOption.value = data;
})
@@ -330,7 +335,8 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
*/
function fnModalOk() {
const from = JSON.parse(JSON.stringify(modalState.from));
const neId = queryParams.neId || '-';
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
from.rfsp = Number(from.rfsp) || 0;
// 处理多选框数据
let pccRules = modalState.from.pccRules;
@@ -369,21 +375,24 @@ function fnModalOk() {
if (modalState.isBatch) {
if (modalState.type === 'add') {
result = addPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
num: from.num,
paramData: from,
});
}
if (modalState.type === 'update') {
result = editPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
num: from.num,
paramData: from,
});
}
if (modalState.type === 'delete') {
result = delPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
num: from.num,
imsi: from.imsi,
});
@@ -391,14 +400,16 @@ function fnModalOk() {
} else {
if (modalState.type === 'add') {
result = addPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
num: 0,
paramData: from,
});
}
if (modalState.type === 'update') {
result = editPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
num: 0,
paramData: from,
});
@@ -465,7 +476,9 @@ function fnModalCancel() {
* @param type 类型
*/
function fnModalVisibleByBatch(type: 'delete' | 'add' | 'update') {
getPCFRule(queryParams.neId)
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
getPCFRule(coreUid, neUid)
.then((data: any) => {
pcfRuleOption.value = data;
console.log(data);
@@ -495,8 +508,9 @@ function fnModalVisibleByBatch(type: 'delete' | 'add' | 'update') {
* @param imsi 网元编号ID
*/
function fnRecordDelete(imsi: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
if (!coreUid || !neUid) return;
let imsiMsg = imsi;
if (imsi === '0') {
imsiMsg = `${tableState.selectedRowKeys[0]}... ${tableState.selectedRowKeys.length}`;
@@ -509,7 +523,8 @@ function fnRecordDelete(imsi: string) {
onOk() {
const hide = message.loading(t('common.loading'), 0);
delPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
imsi: imsi,
})
.then(res => {
@@ -535,11 +550,13 @@ function fnRecordDelete(imsi: string) {
/**列表导出 */
function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
if (!coreUid || !neUid) return;
const hide = message.loading(t('common.loading'), 0);
exportPCFRule({
neId: neId,
coreUid: coreUid,
neUid: neUid,
fileType: type,
})
.then(res => {
@@ -548,7 +565,7 @@ function fnExportList(type: string) {
content: t('common.msgSuccess', { msg: t('common.export') }),
duration: 3,
});
saveAs(res.data, `PCFRlue_${neId}_${Date.now()}.${type}`);
saveAs(res.data, `PCFRlue_${neUid}_${Date.now()}.${type}`);
} else {
message.error({
content: `${res.msg}`,
@@ -622,14 +639,15 @@ function fnModalUploadImportClose() {
/**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) {
const neId = queryParams.neId;
if (!neId) {
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
if (!neUid || !coreUid) {
return Promise.reject('Unknown network element');
}
const hide = message.loading(t('common.loading'), 0);
uploadImportState.loading = true;
// 上传文件
uploadFileToNE('PCF', neId, file, 3)
uploadFileToNE('PCF', neUid, coreUid, file, 3)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
return res.data;
@@ -643,7 +661,8 @@ function fnModalUploadImportUpload(file: File) {
if (!filePath) return;
// 文件导入
return importPCFRule({
neId: neId,
neUid: neUid,
coreUid: coreUid,
fileType: 'txt',
filePath: filePath,
});
@@ -706,7 +725,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -725,9 +744,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="PCF" name="neId ">
<a-form-item label="PCF" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnGetList(1)"

View File

@@ -38,6 +38,8 @@ import { message } from 'ant-design-vue';
import useNeStore from '@/store/modules/ne';
import dayjs, { Dayjs } from 'dayjs';
import { parseDateToStr } from '@/utils/date-utils';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_SMF_CDR } from '@/constants/ne-constants';
const { t, currentLocale } = useI18n();
const neStore = useNeStore();
const ws = new WS();
@@ -265,9 +267,10 @@ let rangePickerPresets = ref([
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
neType: 'SMF',
neId: '001',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
subscriberID: '',
dnn: '',
sortField: 'timestamp',
@@ -408,6 +411,8 @@ function fnRanderChartDataLoad() {
}
//
fnRanderChartDataUpdate();
//
fnRealTime();
} else {
message.warning('No Data');
cdrChart.hideLoading();
@@ -481,6 +486,8 @@ function fnRealTime() {
if (ws.state() === WebSocket.OPEN) {
ws.close();
}
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
//
const options: OptionsType = {
url: '/ws',
@@ -489,7 +496,7 @@ function fnRealTime() {
*
* CDR会话事件-SMF (GroupID:1006)
*/
subGroupID: `1006_${queryParams.neId}`,
subGroupID: `${WS_GROUP_SMF_CDR}_${coreUid}_${neUid}`,
},
onmessage: (res: Record<string, any>) => {
const { code, requestId, data } = res;
@@ -503,7 +510,7 @@ function fnRealTime() {
return;
}
// cdrEvent CDR
if (data.groupId === `1006_${queryParams.neId}`) {
if (data.groupId === `${WS_GROUP_SMF_CDR}_${coreUid}_${neUid}`) {
const cdrEvent = data.data;
let cdrJSON: any = {};
try {
@@ -576,7 +583,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
} else {
message.warning({
content: t('common.noData'),
@@ -586,7 +593,6 @@ onMounted(() => {
//
fnRanderChart();
fnRealTime();
});
onBeforeUnmount(() => {
@@ -608,9 +614,9 @@ onBeforeUnmount(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="SMF" name="neId ">
<a-form-item label="SMF" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnRealTime()"
@@ -687,7 +693,11 @@ onBeforeUnmount(() => {
<!-- 图数据 -->
<div ref="cdrChartDom" style="height: 600px; width: 100%"></div>
<a-descriptions :title="t('views.dashboard.chart.datausage')" bordered :column="2">
<a-descriptions
:title="t('views.dashboard.chart.datausage')"
bordered
:column="2"
>
<a-descriptions-item :label="t('views.dashboard.chart.totaluplink')">
{{ state.dataUsage[0] }}
</a-descriptions-item>

View File

@@ -21,6 +21,8 @@ import PQueue from 'p-queue';
import saveAs from 'file-saver';
import dayjs, { type Dayjs } from 'dayjs';
import { useClipboard } from '@vueuse/core';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_SMF_CDR } from '@/constants/ne-constants';
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
const neStore = useNeStore();
@@ -53,9 +55,10 @@ let rangePickerPresets = ref([
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
neType: 'SMF',
neId: '001',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
subscriberID: '',
sortField: 'timestamp',
sortOrder: 'desc',
@@ -441,6 +444,8 @@ const realTimeData = ref<boolean>(false);
function fnRealTime() {
realTimeData.value = !realTimeData.value;
if (realTimeData.value) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
tableState.seached = false;
//
const options: OptionsType = {
@@ -450,7 +455,7 @@ function fnRealTime() {
*
* CDR会话事件-SMF (GroupID:1006)
*/
subGroupID: `1006_${queryParams.neId}`,
subGroupID: `${WS_GROUP_SMF_CDR}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -477,8 +482,10 @@ function wsMessage(res: Record<string, any>) {
if (!data?.groupId) {
return;
}
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
// cdrEvent CDR
if (data.groupId === `1006_${queryParams.neId}`) {
if (data.groupId === `${WS_GROUP_SMF_CDR}_${coreUid}_${neUid}`) {
const cdrEvent = data.data;
let cdrJSON = {};
try {
@@ -517,7 +524,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
} else {
message.warning({
content: t('common.noData'),
@@ -547,9 +554,9 @@ onBeforeUnmount(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="SMF" name="neId ">
<a-form-item label="SMF" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnQueryReset()"

View File

@@ -10,6 +10,7 @@ import { listSMFSubList } from '@/api/neData/smf';
import useNeStore from '@/store/modules/ne';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -17,8 +18,10 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: undefined,
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
/**IMSI */
imsi: '',
/**msisdn */
@@ -260,7 +263,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -279,9 +282,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.neUser.ue.neType')" name="neId ">
<a-form-item label="SMF" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>

View File

@@ -24,6 +24,8 @@ import PQueue from 'p-queue';
import { useClipboard } from '@vueuse/core';
import { hasPermissions } from '@/plugins/auth-user';
import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_SMSC_CDR } from '@/constants/ne-constants';
const { copy } = useClipboard({ legacy: true });
const { getDict } = useDictStore();
const neStore = useNeStore();
@@ -65,9 +67,10 @@ let rangePickerPresets = ref([
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
neType: 'SMSC',
neId: '001',
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元标识 */
neUid: undefined,
recordType: '',
callerParty: '',
calledParty: '',
@@ -408,6 +411,8 @@ const realTimeData = ref<boolean>(false);
function fnRealTime() {
realTimeData.value = !realTimeData.value;
if (realTimeData.value) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
tableState.seached = false;
//
const options: OptionsType = {
@@ -417,7 +422,7 @@ function fnRealTime() {
*
* SMSC_CDR会话事件(GroupID:1007_neId)
*/
subGroupID: `1007_${queryParams.neId}`,
subGroupID: `${WS_GROUP_SMSC_CDR}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: (ev: any) => {
@@ -444,8 +449,10 @@ function wsMessage(res: Record<string, any>) {
if (!data?.groupId) {
return;
}
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
// cdrEvent CDR
if (data.groupId === `1007_${queryParams.neId}`) {
if (data.groupId === `${WS_GROUP_SMSC_CDR}_${coreUid}_${neUid}`) {
const cdrEvent = data.data;
let cdrJSON = {};
try {
@@ -491,7 +498,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
} else {
message.warning({
content: t('common.noData'),
@@ -521,9 +528,9 @@ onBeforeUnmount(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="SMSC" name="neId ">
<a-form-item label="SMSC" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
@change="fnQueryReset()"

View File

@@ -15,8 +15,6 @@ import { saveAs } from 'file-saver';
import {
addUDMAuth,
updateUDMAuth,
batchAddUDMAuth,
batchDelUDMAuth,
delUDMAuth,
getUDMAuth,
exportUDMAuth,
@@ -26,15 +24,19 @@ import {
} from '@/api/neData/udm_auth';
import { uploadFile } from '@/api/tool/file';
import { getNeViewFile } from '@/api/tool/neFile';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { parseDateToStr } from '@/utils/date-utils';
const { t } = useI18n();
const neListStore = useNeStore();
const neStore = useNeStore();
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元ID */
neId: undefined,
neUid: undefined,
/**移动编号 */
imsi: '',
/**排序字段 */
@@ -89,33 +91,43 @@ let tableColumns = ref<ColumnsType>([
{
title: 'IMSI',
dataIndex: 'imsi',
align: 'center',
align: 'left',
sorter: true,
width: 150,
},
{
title: 'AMF',
dataIndex: 'amf',
align: 'center',
align: 'left',
width: 80,
},
// {
// title: 'KI',
// dataIndex: 'ki',
// align: 'center',
// align: 'left',
// width: 10,
// },
// {
// title: 'OPC',
// dataIndex: 'opc',
// align: 'center',
// align: 'left',
// width: 10,
// },
{
title: 'Algo Index',
dataIndex: 'algoIndex',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'Create Time',
dataIndex: 'createTime',
align: 'left',
width: 250,
customRender(opt) {
if (!opt.value) return '';
return parseDateToStr(+opt.value);
},
},
{
title: t('common.operate'),
@@ -205,7 +217,10 @@ let modalState: ModalStateType = reactive({
title: 'UDM鉴权用户',
from: {
num: 1,
id: '',
id: undefined,
coreUid: '',
neUid: '',
neType: 'UDM',
imsi: '',
amf: '8000',
ki: '',
@@ -232,12 +247,12 @@ const modalStateFrom = Form.useForm(
],
imsi: [
{ required: true, message: 'IMSI' + t('common.unableNull') },
{ min: 15, max: 15, message: t('views.neUser.auth.imsiConfirm') },
{ min: 15, message: t('views.neUser.auth.imsiConfirm') },
],
amf: [{ required: true, message: 'AMF' + t('common.unableNull') }],
ki: [
{ required: true, message: 'KI' + t('common.unableNull') },
{ min: 32, max: 32, message: t('views.neUser.auth.kiTip') },
{ min: 32, message: t('views.neUser.auth.kiTip') },
],
algoIndex: [
{ required: true, message: 'algoIndex' + t('common.unableNull') },
@@ -272,8 +287,11 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
const neId = queryParams.neId || '-';
getUDMAuth(neId, row.imsi)
getUDMAuth({
coreUid: row.coreUid,
neUid: row.neUid,
imsi: row.imsi,
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
modalState.from = Object.assign(modalState.from, res.data);
@@ -313,12 +331,10 @@ function fnModalOk() {
modalState.confirmLoading = true;
const from = toRaw(modalState.from);
from.algoIndex = `${from.algoIndex}`;
from.neId = queryParams.neId || '-';
const result = from.id
? updateUDMAuth(from)
: from.num === 1
? addUDMAuth(from)
: batchAddUDMAuth(from, from.num);
from.coreUid = queryParams.coreUid || '-';
from.neUid = queryParams.neUid || '-';
from.neType = 'UDM';
const result = from.id ? updateUDMAuth(from) : addUDMAuth(from);
const hide = message.loading(t('common.loading'), 0);
result
.then(res => {
@@ -382,30 +398,33 @@ function fnBatchDelModalOk() {
.then(e => {
modalState.confirmLoading = true;
const from = toRaw(modalState.BatchDelForm);
const neId = queryParams.neId || '-';
batchDelUDMAuth(neId, from.imsi, from.num).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const timerS = Math.ceil(+from.num / 800) + 1;
notification.success({
message: modalState.title,
description: t('common.operateOk'),
duration: timerS,
});
setTimeout(() => {
modalState.openByBatchDel = false;
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
delUDMAuth({ coreUid, neUid, imsi: from.imsi, num: from.num }).then(
res => {
if (res.code === RESULT_CODE_SUCCESS) {
const timerS = Math.ceil(+from.num / 800) + 1;
notification.success({
message: modalState.title,
description: t('common.operateOk'),
duration: timerS,
});
setTimeout(() => {
modalState.openByBatchDel = false;
modalState.confirmLoading = false;
modalStateBatchDelFrom.resetFields();
fnGetList(1);
}, timerS * 1000);
} else {
modalState.confirmLoading = false;
modalStateBatchDelFrom.resetFields();
fnGetList(1);
}, timerS * 1000);
} else {
modalState.confirmLoading = false;
notification.error({
message: modalState.title,
description: res.msg,
duration: 3,
});
notification.error({
message: modalState.title,
description: res.msg,
duration: 3,
});
}
}
});
);
})
.catch(e => {
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
@@ -435,8 +454,9 @@ function fnModalCancel() {
* @param imsi 编号imsi
*/
function fnRecordDelete(imsi: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
let imsiMsg = imsi;
if (imsi === '0') {
imsiMsg = `${tableState.selectedRowKeys[0]}... ${t(
@@ -451,7 +471,7 @@ function fnRecordDelete(imsi: string) {
onOk() {
modalState.loadDataLoading = true;
const hide = message.loading(t('common.loading'), 0);
delUDMAuth(neId, imsi)
delUDMAuth({ coreUid, neUid, imsi, num: 0 })
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const msgContent = t('common.msgSuccess', {
@@ -483,10 +503,11 @@ function fnRecordDelete(imsi: string) {
function fnRecordExport(type: string = 'txt') {
const selectLen = tableState.selectedRowKeys.length;
if (selectLen <= 0) return;
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMAuth({ type: type, neId: neId, imsis: tableState.selectedRowKeys })
exportUDMAuth({ type, coreUid, neUid, imsis: tableState.selectedRowKeys })
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.msgSuccess', { msg: t('common.export') }), 3);
@@ -502,8 +523,9 @@ function fnRecordExport(type: string = 'txt') {
/**列表导出全部数据 */
function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMAuth(Object.assign({ type: type }, queryParams))
.then(res => {
@@ -521,13 +543,14 @@ function fnExportList(type: string) {
/**重新加载数据 */
function fnLoadData() {
const neId = queryParams.neId;
if (tableState.loading || !neId) return;
const coreUid = queryParams.coreUid;
const neUid = queryParams.neUid;
if (tableState.loading || !neUid || !coreUid) return;
modalState.loadDataLoading = true;
tablePagination.total = 0;
tableState.data = [];
tableState.loading = true; // 表格loading
resetUDMAuth(neId).then(res => {
resetUDMAuth(coreUid, neUid).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const num = res.data;
const timerS = Math.ceil(+num / 800) + 3;
@@ -627,12 +650,12 @@ function fnModalUploadImportTypeChange() {
/**对话框表格信息导入失败原因 */
function fnModalUploadImportFailReason() {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
if (!neUid) return;
const hide = message.loading(t('common.loading'), 0);
getNeViewFile({
neType: 'UDM',
neId: neId,
neUid: neUid,
path: '/tmp',
fileName: 'import_authdata_err_records.txt',
})
@@ -670,8 +693,9 @@ function fnModalUploadImportClose() {
/**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) {
const neId = queryParams.neId;
if (!neId) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) {
return Promise.reject('Unknown network element');
}
const hide = message.loading(t('common.loading'), 0);
@@ -694,7 +718,8 @@ function fnModalUploadImportUpload(file: File) {
if (!filePath) return;
// 文件导入
return importUDMAuth({
neId: neId,
coreUid: coreUid,
neUid: neUid,
uploadPath: filePath,
...uploadImportState.from,
});
@@ -739,7 +764,7 @@ function fnModalDownloadImportTemplate() {
onMounted(() => {
// 获取网元网元列表
neListStore.neCascaderOptions.forEach(item => {
neStore.neCascaderOptions.forEach(item => {
if (item.value === 'UDM') {
neOtions.value = JSON.parse(JSON.stringify(item.children));
}
@@ -752,7 +777,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -771,9 +796,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="UDM" name="neId ">
<a-form-item label="UDM" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
:disabled="modalState.loadDataLoading"
@@ -865,6 +890,7 @@ onMounted(() => {
ok-text="TXT"
ok-type="default"
@confirm="fnExportList('txt')"
v-if="false"
>
<a-button type="dashed">
<template #icon><ExportOutlined /></template>
@@ -890,6 +916,7 @@ onMounted(() => {
ok-type="default"
@confirm="fnRecordExport('txt')"
:disabled="tableState.selectedRowKeys.length <= 0"
v-if="false"
>
<a-button
type="default"

View File

@@ -14,8 +14,6 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import saveAs from 'file-saver';
import {
addUDMSub,
batchAddUDMSub,
batchDelUDMSub,
delUDMSub,
exportUDMSub,
getUDMSub,
@@ -26,6 +24,7 @@ import {
} from '@/api/neData/udm_sub';
import { uploadFile } from '@/api/tool/file';
import { getNeViewFile } from '@/api/tool/neFile';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -33,8 +32,10 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元ID */
neId: undefined,
neUid: undefined,
/**移动编号 */
imsi: '',
/**移动号 */
@@ -92,7 +93,7 @@ let tableColumns = ref<ColumnsType>([
{
title: 'IMSI',
dataIndex: 'imsi',
align: 'center',
align: 'left',
fixed: 'left',
sorter: true,
resizable: true,
@@ -103,7 +104,7 @@ let tableColumns = ref<ColumnsType>([
{
title: 'MSISDN',
dataIndex: 'msisdn',
align: 'center',
align: 'left',
fixed: 'left',
sorter: true,
width: 150,
@@ -111,39 +112,39 @@ let tableColumns = ref<ColumnsType>([
{
title: 'Subscribed AMBR',
dataIndex: 'ambr',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'Subscribed SNSSAIs',
dataIndex: 'nssai',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'Forbidden Areas',
dataIndex: 'arfb',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'Service Area Restrict',
dataIndex: 'sar',
align: 'center',
align: 'left',
width: 100,
},
{
title: '5G',
dataIndex: 'cn',
key: 'cnFlag',
align: 'center',
align: 'left',
width: 100,
},
{
title: '4G',
dataIndex: 'epsFlag',
key: 'epsFlag',
align: 'center',
align: 'left',
width: 100,
},
{
@@ -386,8 +387,8 @@ function fnModalVisibleByBatch() {
* 对话框弹出显示为 新增或者修改
* @param noticeId 网元id, 不传为新增
*/
function fnModalVisibleByEdit(imsi?: string) {
if (!imsi) {
function fnModalVisibleByEdit(row?: Record<string, any>) {
if (!row) {
modalStateFrom.resetFields();
modalState.title = t('common.addText') + t('views.neUser.sub.subInfo');
modalState.openByEdit = true;
@@ -395,8 +396,11 @@ function fnModalVisibleByEdit(imsi?: string) {
if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
const neId = queryParams.neId || '-';
getUDMSub(neId, imsi)
getUDMSub({
coreUid: row.coreUid,
neUid: row.neUid,
imsi: row.imsi,
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
transformFormData(res.data.smData);
@@ -645,12 +649,10 @@ function fnModalOk() {
from.rfspIndex = `${from.rfspIndex}`;
from.regTimer = `${from.regTimer}`;
from.ueUsageType = `${from.ueUsageType}`;
from.neId = queryParams.neId || '-';
const result = from.id
? updateUDMSub(from)
: from.num === 1
? addUDMSub(from)
: batchAddUDMSub(from, from.num);
from.coreUid = queryParams.coreUid || '-';
from.neUid = queryParams.neUid || '-';
from.neType = 'UDM';
const result = from.id ? updateUDMSub(from) : addUDMSub(from);
const hide = message.loading(t('common.loading'), 0);
result
.then(res => {
@@ -660,7 +662,7 @@ function fnModalOk() {
content: t('common.msgSuccess', { msg: modalState.title }),
duration: 3,
});
fnGetList(1);
fnGetList();
} else {
const timerS = Math.ceil(+from.num / 800) + 1;
notification.success({
@@ -722,30 +724,33 @@ function fnBatchDelModalOk() {
.then(e => {
modalState.confirmLoading = true;
const from = toRaw(modalState.BatchDelForm);
const neId = queryParams.neId || '-';
batchDelUDMSub(neId, from.imsi, from.num).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const timerS = Math.ceil(+from.num / 800) + 1;
notification.success({
message: modalState.title,
description: t('common.operateOk'),
duration: timerS,
});
setTimeout(() => {
modalState.openByBatchDel = false;
const neUid = queryParams.neUid || '-';
const coreUid = queryParams.coreUid || '-';
delUDMSub({ coreUid, neUid, imsi: from.imsi, num: from.num }).then(
res => {
if (res.code === RESULT_CODE_SUCCESS) {
const timerS = Math.ceil(+from.num / 800) + 1;
notification.success({
message: modalState.title,
description: t('common.operateOk'),
duration: timerS,
});
setTimeout(() => {
modalState.openByBatchDel = false;
modalState.confirmLoading = false;
modalStateBatchDelFrom.resetFields();
fnGetList();
}, timerS * 1000);
} else {
modalState.confirmLoading = false;
modalStateBatchDelFrom.resetFields();
fnGetList(1);
}, timerS * 1000);
} else {
modalState.confirmLoading = false;
notification.error({
message: modalState.title,
description: res.msg,
duration: 3,
});
notification.error({
message: modalState.title,
description: res.msg,
duration: 3,
});
}
}
});
);
})
.catch(e => {
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
@@ -799,8 +804,9 @@ function fnBatchDelModalCancel() {
* @param imsi 编号imsi
*/
function fnRecordDelete(imsi: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
let imsiMsg = imsi;
if (imsi === '0') {
imsiMsg = `${tableState.selectedRowKeys[0]}... ${t(
@@ -815,7 +821,7 @@ function fnRecordDelete(imsi: string) {
onOk() {
modalState.loadDataLoading = true;
const hide = message.loading(t('common.loading'), 0);
delUDMSub(neId, imsi)
delUDMSub({ coreUid, neUid, imsi, num: 0 })
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const msgContent = t('common.msgSuccess', {
@@ -847,10 +853,11 @@ function fnRecordDelete(imsi: string) {
function fnRecordExport(type: string = 'txt') {
const selectLen = tableState.selectedRowKeys.length;
if (selectLen <= 0) return;
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMSub({ type: type, neId: neId, imsis: tableState.selectedRowKeys })
exportUDMSub({ type, coreUid, neUid, imsis: tableState.selectedRowKeys })
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -872,8 +879,9 @@ function fnRecordExport(type: string = 'txt') {
/**列表导出 */
function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMSub(Object.assign({ type: type }, queryParams))
.then(res => {
@@ -897,13 +905,14 @@ function fnExportList(type: string) {
/**重新加载数据 */
function fnLoadData() {
const neId = queryParams.neId;
if (tableState.loading || !neId) return;
const coreUid = queryParams.coreUid;
const neUid = queryParams.neUid;
if (tableState.loading || !neUid || !coreUid) return;
modalState.loadDataLoading = true;
tablePagination.total = 0;
tableState.data = [];
tableState.loading = true; // 表格loading
resetUDMSub(neId).then(res => {
resetUDMSub(coreUid, neUid).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const num = res.data;
const timerS = Math.ceil(+num / 800) + 3;
@@ -986,12 +995,12 @@ let uploadImportState: ModalUploadImportStateType = reactive({
/**对话框表格信息导入失败原因 */
function fnModalUploadImportFailReason() {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
if (!neUid) return;
const hide = message.loading(t('common.loading'), 0);
getNeViewFile({
neType: 'UDM',
neId: neId,
neUid: neUid,
path: '/tmp',
fileName: 'import_udmuser_err_records.txt',
})
@@ -1027,8 +1036,9 @@ function fnModalUploadImportClose() {
/**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) {
const neId = queryParams.neId;
if (!neId) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) {
return Promise.reject('Unknown network element');
}
const hide = message.loading(t('common.loading'), 0);
@@ -1051,7 +1061,8 @@ function fnModalUploadImportUpload(file: File) {
if (!filePath) return;
// 文件导入
return importUDMSub({
neId: neId,
coreUid: coreUid,
neUid: neUid,
uploadPath: filePath,
});
})
@@ -1143,7 +1154,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -1162,9 +1173,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="UDM" name="neId ">
<a-form-item label="UDM" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
:disabled="modalState.loadDataLoading"
@@ -1407,7 +1418,7 @@ onMounted(() => {
<template #title>{{ t('common.editText') }}</template>
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.imsi)"
@click.prevent="fnModalVisibleByEdit(record)"
>
<template #icon>
<FormOutlined />

View File

@@ -13,14 +13,12 @@ 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,
addUDMVoIP,
delUDMVoIP,
exportUDMVoIP,
importUDMVoIP,
listUDMVoIP,
resetUDMVoIP,
} from '@/api/neData/udm_voip';
import useNeStore from '@/store/modules/ne';
import useI18n from '@/hooks/useI18n';
@@ -28,6 +26,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { saveAs } from 'file-saver';
import { uploadFile } from '@/api/tool/file';
import { getNeViewFile } from '@/api/tool/neFile';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**网元参数 */
@@ -35,8 +34,10 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元ID */
neId: undefined,
neUid: undefined,
/**用户名 */
username: '',
/**排序字段 */
@@ -85,7 +86,7 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */
let tableColumns = ref<TableColumnsType>([
{
title: t('views.neData.udmVOIP.username'),
title: t('views.neData.udmVoIP.username'),
dataIndex: 'username',
sorter: true,
align: 'left',
@@ -175,7 +176,7 @@ type ModalStateType = {
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
openByEdit: false,
title: 'UDMVOIP',
title: 'UDMVoIP',
from: {
num: 1,
username: undefined,
@@ -198,10 +199,10 @@ const modalStateFrom = Form.useForm(
},
],
username: [
{ required: true, message: t('views.neData.udmVOIP.usernamePlease') },
{ required: true, message: t('views.neData.udmVoIP.usernamePlease') },
],
password: [
{ required: true, message: t('views.neData.udmVOIP.passwordPlease') },
{ required: true, message: t('views.neData.udmVoIP.passwordPlease') },
],
})
);
@@ -214,7 +215,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
modalState.isBatch = false;
if (!row) {
modalStateFrom.resetFields(); //重置表单
modalState.title = t('views.neData.udmVOIP.addTitle');
modalState.title = t('views.neData.udmVoIP.addTitle');
modalState.openByEdit = true;
modalState.type = 'add';
}
@@ -226,7 +227,9 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
*/
function fnModalOk() {
const from = JSON.parse(JSON.stringify(modalState.from));
from.neId = queryParams.neId || '-';
from.coreUid = queryParams.coreUid || '-';
from.neUid = queryParams.neUid || '-';
from.neType = 'UDM';
from.username = `${from.username}`;
// 校验规则
@@ -247,21 +250,14 @@ function fnModalOk() {
let result: any = null;
if (modalState.isBatch) {
if (modalState.type === 'add') {
result = batchAddUDMVOIP(
from.neId,
{ username: from.username, password: from.password },
from.num
);
result = addUDMVoIP(from);
}
if (modalState.type === 'delete') {
result = batchDelUDMVOIP(from.neId, from.username, from.num);
result = delUDMVoIP(from);
}
} else {
if (modalState.type === 'add') {
result = addUDMVOIP(from.neId, {
username: from.username,
password: from.password,
});
result = addUDMVoIP(from);
}
}
@@ -326,8 +322,9 @@ function fnModalVisibleByBatch(type: 'delete' | 'add') {
* @param username 网元编号ID
*/
function fnRecordDelete(username: string) {
const neID = queryParams.neId;
if (!neID) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
let msg = username;
if (username === '0') {
msg = `${tableState.selectedRowKeys[0]}... ${tableState.selectedRowKeys.length}`;
@@ -336,10 +333,10 @@ function fnRecordDelete(username: string) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.neData.udmVOIP.delTip', { num: msg }),
content: t('views.neData.udmVoIP.delTip', { num: msg }),
onOk() {
const hide = message.loading(t('common.loading'), 0);
delUDMVOIP(neID, username)
delUDMVoIP({ coreUid, neUid, username, num: 0 })
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3);
@@ -360,17 +357,18 @@ function fnRecordDelete(username: string) {
/**列表导出 */
function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMVOIP(Object.assign({ type: type }, queryParams))
exportUDMVoIP(Object.assign({ type: type }, queryParams))
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.operateOk'),
duration: 2,
});
saveAs(res.data, `UDM_VOIP_${neId}_${Date.now()}.${type}`);
saveAs(res.data, `UDM_VoIP_${Date.now()}.${type}`);
} else {
message.error({
content: `${res.msg}`,
@@ -391,7 +389,7 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum;
tablePagination.current = pageNum;
}
listUDMVOIP(toRaw(queryParams)).then(res => {
listUDMVoIP(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
@@ -409,13 +407,14 @@ function fnGetList(pageNum?: number) {
/**重新加载数据 */
function fnLoadData() {
const neId = queryParams.neId;
if (tableState.loading || !neId) return;
const coreUid = queryParams.coreUid;
const neUid = queryParams.neUid;
if (tableState.loading || !neUid || !coreUid) return;
modalState.loadDataLoading = true;
tablePagination.total = 0;
tableState.data = [];
tableState.loading = true; // 表格loading
resetUDMVOIP(neId).then(res => {
resetUDMVoIP(coreUid, neUid).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const num = res.data;
const timerS = Math.ceil(+num / 800) + 3;
@@ -484,8 +483,9 @@ function fnModalUploadImportClose() {
/**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) {
const neID = queryParams.neId;
if (!neID) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) {
return Promise.reject('Unknown network element');
}
const hide = message.loading(t('common.loading'), 0);
@@ -507,8 +507,9 @@ function fnModalUploadImportUpload(file: File) {
.then((filePath: string) => {
if (!filePath) return;
// 文件导入
return importUDMVOIP({
neId: neID,
return importUDMVoIP({
coreUid: coreUid,
neUid: neUid,
uploadPath: filePath,
});
})
@@ -532,12 +533,12 @@ function fnModalUploadImportUpload(file: File) {
/**对话框表格信息导入失败原因 */
function fnModalUploadImportFailReason() {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
if (!neUid) return;
const hide = message.loading(t('common.loading'), 0);
getNeViewFile({
neType: 'UDM',
neId: neId,
neUid: neUid,
path: '/tmp',
fileName: 'import_imsuser_err_records.txt',
})
@@ -592,7 +593,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -611,9 +612,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="UDM" name="neId ">
<a-form-item label="UDM" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
:disabled="modalState.loadDataLoading"
@@ -623,7 +624,7 @@ onMounted(() => {
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item
:label="t('views.neData.udmVOIP.username')"
:label="t('views.neData.udmVoIP.username')"
name="username"
>
<a-input
@@ -721,7 +722,7 @@ onMounted(() => {
</a-button>
<a-popconfirm
placement="topRight"
:title="t('views.neData.udmVOIP.exportTip')"
:title="t('views.neData.udmVoIP.exportTip')"
ok-text="TXT"
ok-type="default"
@confirm="fnExportList('txt')"
@@ -753,7 +754,7 @@ onMounted(() => {
/>
</a-tooltip>
<TableColumnsDnd
cache-id="udmVOIPData"
cache-id="udmVoIPData"
:columns="tableColumns"
v-model:columns-dnd="tableColumnsDnd"
></TableColumnsDnd>
@@ -865,8 +866,8 @@ onMounted(() => {
<a-form-item
:label="
modalState.isBatch
? t('views.neData.udmVOIP.startUsername')
: t('views.neData.udmVOIP.username')
? t('views.neData.udmVoIP.startUsername')
: t('views.neData.udmVoIP.username')
"
name="username"
v-bind="modalStateFrom.validateInfos.username"
@@ -876,7 +877,7 @@ onMounted(() => {
style="width: 100%"
:min="4"
:maxlength="16"
:placeholder="t('views.neData.udmVOIP.username')"
:placeholder="t('views.neData.udmVoIP.username')"
>
</a-input-number>
</a-form-item>
@@ -902,8 +903,8 @@ onMounted(() => {
<a-form-item
:label="
modalState.isBatch
? t('views.neData.udmVOIP.startUsername')
: t('views.neData.udmVOIP.username')
? t('views.neData.udmVoIP.startUsername')
: t('views.neData.udmVoIP.username')
"
name="username"
v-bind="modalStateFrom.validateInfos.username"
@@ -912,12 +913,12 @@ onMounted(() => {
v-model:value="modalState.from.username"
style="width: 100%"
:maxlength="16"
:placeholder="t('views.neData.udmVOIP.username')"
:placeholder="t('views.neData.udmVoIP.username')"
>
</a-input>
</a-form-item>
<a-form-item
:label="t('views.neData.udmVOIP.password')"
:label="t('views.neData.udmVoIP.password')"
name="password"
v-bind="modalStateFrom.validateInfos.password"
>
@@ -926,7 +927,7 @@ onMounted(() => {
style="width: 100%"
:min="4"
:max="64"
:placeholder="t('views.neData.udmVOIP.password')"
:placeholder="t('views.neData.udmVoIP.password')"
>
</a-input-password>
</a-form-item>

View File

@@ -20,14 +20,13 @@ import { uploadFile } from '@/api/tool/file';
import { getNeViewFile } from '@/api/tool/neFile';
import {
addUDMVolteIMS,
batchAddUDMVolteIMS,
batchDelUDMVolteIMS,
delUDMVolteIMS,
exportUDMVolteIMS,
importUDMVolteIMS,
listUDMVolteIMS,
resetUDMVolteIMS,
} from '@/api/neData/udm_volte_ims';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n();
const neStore = useNeStore();
/**字典数据 */
@@ -52,8 +51,10 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元ID */
neId: undefined,
neUid: undefined,
/**IMSI */
imsi: '',
/**MSISDN */
@@ -286,7 +287,9 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
*/
function fnModalOk() {
const from = JSON.parse(JSON.stringify(modalState.from));
from.neId = queryParams.neId || '-';
from.coreUid = queryParams.coreUid || '-';
from.neUid = queryParams.neUid || '-';
from.neType = 'UDM';
// 如果是VoIP, 则MSISDN和IMSI相同
if (from.tag === '0') {
@@ -312,15 +315,10 @@ function fnModalOk() {
let result: any = null;
if (modalState.isBatch) {
if (modalState.type === 'add') {
result = batchAddUDMVolteIMS(from, from.num);
result = addUDMVolteIMS(from);
}
if (modalState.type === 'delete') {
result = batchDelUDMVolteIMS(
from.neId,
`${from.imsi}_${from.msisdn}`,
from.num,
from.tag
);
result = delUDMVolteIMS(from);
}
} else {
if (modalState.type === 'add') {
@@ -386,13 +384,14 @@ function fnModalVisibleByBatch(type: 'delete' | 'add') {
/**
* 记录删除
* @param id 记录ID
* @param imsi 记录ID
*/
function fnRecordDelete(id: string) {
const neID = queryParams.neId;
if (!neID) return;
let msg = id;
if (id === '0') {
function fnRecordDelete(imsi: string) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
let msg = imsi;
if (imsi === '0') {
msg = `${tableState.selectedRowIMSIs[0].imsi}... ${tableState.selectedRowIMSIs.length}`;
}
@@ -402,27 +401,32 @@ function fnRecordDelete(id: string) {
onOk() {
const hide = message.loading(t('common.loading'), 0);
let reqArr: any[] = [];
if (id === '0') {
const volteArr = tableState.selectedRowIMSIs
.filter(item => item.tag == '1')
.map(item => `${item.imsi}_${item.msisdn}`)
.join(',');
if (volteArr.length > 0) {
reqArr.push(delUDMVolteIMS(neID, volteArr, '1'));
}
const voipArr = tableState.selectedRowIMSIs
.filter(item => item.tag == '0')
.map(item => `${item.imsi}_${item.msisdn}`)
.join(',');
if (voipArr.length > 0) {
reqArr.push(delUDMVolteIMS(neID, voipArr, '0'));
}
if (imsi === '0') {
tableState.selectedRowIMSIs.forEach(item => {
reqArr.push(
delUDMVolteIMS({
coreUid,
neUid,
imsi: item.imsi,
msisdn: item.msisdn,
tag: item.tag,
num: 1,
})
);
});
} else {
const record: any = tableState.data.find((item: any) => item.id === id);
const record: any = tableState.data.find((item: any) => item.imsi === imsi);
if (record) {
reqArr = [
delUDMVolteIMS(neID, `${record.imsi}_${record.msisdn}`, record.tag),
];
reqArr.push(
delUDMVolteIMS({
coreUid,
neUid,
imsi: record.imsi,
msisdn: record.msisdn,
tag: record.tag,
num: 1,
})
);
}
}
Promise.all(reqArr)
@@ -439,8 +443,9 @@ function fnRecordDelete(id: string) {
/**列表导出 */
function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMVolteIMS(Object.assign({ type: type }, queryParams))
.then(res => {
@@ -449,7 +454,7 @@ function fnExportList(type: string) {
content: t('common.operateOk'),
duration: 2,
});
saveAs(res.data, `UDM_VOLTE_${neId}_${Date.now()}.${type}`);
saveAs(res.data, `UDM_VOLTE_${Date.now()}.${type}`);
} else {
message.error({
content: `${res.msg}`,
@@ -488,13 +493,14 @@ function fnGetList(pageNum?: number) {
/**重新加载数据 */
function fnLoadData() {
const neId = queryParams.neId;
if (tableState.loading || !neId) return;
const coreUid = queryParams.coreUid;
const neUid = queryParams.neUid;
if (tableState.loading || !neUid || !coreUid) return;
modalState.loadDataLoading = true;
tablePagination.total = 0;
tableState.data = [];
tableState.loading = true; // 表格loading
resetUDMVolteIMS(neId).then(res => {
resetUDMVolteIMS(coreUid, neUid).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const num = res.data;
const timerS = Math.ceil(+num / 800) + 3;
@@ -563,8 +569,9 @@ function fnModalUploadImportClose() {
/**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) {
const neID = queryParams.neId;
if (!neID) {
const neUid = queryParams.neUid;
const coreUid = queryParams.coreUid;
if (!neUid || !coreUid) {
return Promise.reject('Unknown network element');
}
const hide = message.loading(t('common.loading'), 0);
@@ -587,7 +594,8 @@ function fnModalUploadImportUpload(file: File) {
if (!filePath) return;
// 文件导入
return importUDMVolteIMS({
neId: neID,
coreUid: coreUid,
neUid: neUid,
uploadPath: filePath,
});
})
@@ -611,12 +619,12 @@ function fnModalUploadImportUpload(file: File) {
/**对话框表格信息导入失败原因 */
function fnModalUploadImportFailReason() {
const neId = queryParams.neId;
if (!neId) return;
const neUid = queryParams.neUid;
if (!neUid) return;
const hide = message.loading(t('common.loading'), 0);
getNeViewFile({
neType: 'UDM',
neId: neId,
neUid: neUid,
path: '/tmp',
fileName: 'import_imsuser_err_records.txt',
})
@@ -671,7 +679,7 @@ onMounted(() => {
return;
}
if (neOtions.value.length > 0) {
queryParams.neId = neOtions.value[0].value;
queryParams.neUid = neOtions.value[0].value;
}
// 获取列表数据
@@ -690,9 +698,9 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="UDM" name="neId ">
<a-form-item label="UDM" name="neUid ">
<a-select
v-model:value="queryParams.neId"
v-model:value="queryParams.neUid"
:options="neOtions"
:placeholder="t('common.selectPlease')"
:disabled="modalState.loadDataLoading"
@@ -914,7 +922,7 @@ onMounted(() => {
<template #title>{{ t('common.deleteText') }}</template>
<a-button
type="link"
@click.prevent="fnRecordDelete(record.id)"
@click.prevent="fnRecordDelete(record.imsi)"
>
<template #icon>
<DeleteOutlined />

View File

@@ -2,15 +2,11 @@
import * as echarts from 'echarts/core';
import {
TooltipComponent,
TooltipComponentOption,
GridComponent,
GridComponentOption,
LegendComponent,
LegendComponentOption,
DataZoomComponent,
DataZoomComponentOption,
} from 'echarts/components';
import { LineChart, LineSeriesOption } from 'echarts/charts';
import { LineChart } from 'echarts/charts';
import { UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';
@@ -46,6 +42,8 @@ import { OptionsType, WS } from '@/plugins/ws-websocket';
import { useRoute } from 'vue-router';
import { LineOutlined } from '@ant-design/icons-vue';
import useLayoutStore from '@/store/modules/layout';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_KPI } from '@/constants/ne-constants';
const layoutStore = useLayoutStore();
const neStore = useNeStore();
const route = useRoute();
@@ -154,10 +152,12 @@ function fnTableSize({ key }: MenuInfo) {
/**查询参数 */
let queryParams: any = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */
neType: '',
/**网元标识 */
neId: '',
neUid: '',
/**颗粒度 */
interval: 900,
/**开始时间 */
@@ -345,13 +345,6 @@ function fnGetListTitle() {
maxWidth: 300,
});
}
columns.push({
title: t('views.perfManage.perfData.neName'),
dataIndex: 'neName',
key: 'neName',
align: 'left',
width: 100,
});
columns.push({
title: t('views.perfManage.goldTarget.time'),
dataIndex: 'timeGroup',
@@ -384,7 +377,7 @@ function fnGetList() {
if (tableState.loading) return;
tableState.loading = true;
queryParams.neType = state.neType[0];
queryParams.neId = state.neType[1];
queryParams.neUid = state.neType[1];
//
if (
@@ -416,9 +409,9 @@ function fnGetList() {
kpiStats.value = [];
for (const columns of tableColumns.value) {
if (
columns.key === 'neName' ||
columns.key === 'startIndex' ||
columns.key === 'timeGroup'
['coreUid', 'neUid', 'neType', 'startIndex', 'timeGroup'].includes(
columns.key
)
) {
continue;
}
@@ -537,9 +530,9 @@ function fnRanderChartData() {
for (const columns of tableColumns.value) {
if (
columns.key === 'neName' ||
columns.key === 'startIndex' ||
columns.key === 'timeGroup'
['coreUid', 'neUid', 'neType', 'startIndex', 'timeGroup'].includes(
columns.key
)
) {
continue;
}
@@ -653,6 +646,8 @@ function fnLegendSelected(bool: any) {
/**图表实时统计 */
function fnRealTimeSwitch(bool: any) {
if (bool) {
const coreUid = queryParams.coreUid;
const neUid = queryParams.neUid;
tableState.seached = false;
//
const options: OptionsType = {
@@ -660,9 +655,9 @@ function fnRealTimeSwitch(bool: any) {
params: {
/**
*
* 指标(GroupID:10_neType_neId)
* 指标(GroupID:10_coreUid_neUid)
*/
subGroupID: `10_${queryParams.neType}_${queryParams.neId}`,
subGroupID: `${WS_GROUP_KPI}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: wsError,
@@ -825,14 +820,10 @@ watch(
onMounted(() => {
// AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF
//
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
(item: any) => {
//
return !['OMC', 'NSSF', 'NEF', 'NRF', 'LMF', 'N3IWF'].includes(
item.value
);
}
);
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
//
return !['OMC', 'NSSF', 'NEF', 'NRF', 'LMF', 'N3IWF'].includes(item.value);
});
if (neCascaderOptions.value.length === 0) {
message.warning({
content: t('common.noData'),
@@ -845,15 +836,16 @@ onMounted(() => {
const item = neCascaderOptions.value.find(s => s.value === queryNeType);
if (item && item.children) {
const info = item.children[0];
state.neType = [info.neType, info.neId];
state.neType = [info.neType, info.neUid];
queryParams.neType = info.neType;
queryParams.neId = info.neId;
queryParams.neUid = info.neUid;
} else {
const info = neCascaderOptions.value[0].children[0];
state.neType = [info.neType, info.neId];
state.neType = [info.neType, info.neUid];
queryParams.neType = info.neType;
queryParams.neId = info.neId;
queryParams.neUid = info.neUid;
}
queryParams.coreUid = currentCoreUid();
fnGetListTitle();
//

View File

@@ -29,6 +29,7 @@ import { OptionsType, WS } from '@/plugins/ws-websocket';
import { useDebounceFn } from '@vueuse/core';
import { LineOutlined } from '@ant-design/icons-vue';
import { TableColumnType } from 'ant-design-vue';
import { WS_GROUP_KPI } from '@/constants/ne-constants';
const { t, currentLocale } = useI18n();
const neStore = useNeStore();
//日期快捷选择
@@ -71,12 +72,21 @@ const ALL_NE_TYPES = [
] as const;
type AllChartType = (typeof ALL_NE_TYPES)[number] & string;
// 在 ALL_NE_TYPES 定义之后添加 小写转大写
const neTypeOptions = neStore.getNeCascaderOptions
const neTypeOptions: any = neStore.getNeCascaderOptions
.filter(v => ALL_NE_TYPES.includes(v.value.toLowerCase()))
.map(v => ({
label: v.label,
value: v.value.toLowerCase(),
}));
.map(v => {
let data: Record<string, any> = {
label: v.label,
value: v.value.toLowerCase(),
};
if (v.children.length > 0) {
const ne = v.children[0];
data.coreUid = ne.coreUid;
data.neUid = ne.neUid;
data.neType = ne.neType;
}
return data;
});
// 使用 ref 来使 networkElementTypes 变为响应式,并使用 ALL_NE_TYPES 初始化
const networkElementTypes = ref<AllChartType[]>([...ALL_NE_TYPES]);
@@ -527,9 +537,11 @@ const fetchData = async (type: AllChartType) => {
try {
const dateRange = rangePicker[type] as [string, string];
const [beginTime, endTime] = dateRange;
const ne = neTypeOptions.find((v: any) => v.value === type);
const res = await listKPIData({
neType: type.toUpperCase(),
neId: '001',
coreUid: ne.coreUid,
neType: ne.neType,
neUid: ne.neUid,
beginTime,
endTime,
sortField: 'timeGroup',
@@ -573,12 +585,15 @@ function fnRealTimeSwitch(bool: boolean) {
}
});
let subGroupIDArr: string[] = [];
selectedNeTypes.value.forEach(type => {
const ne = neTypeOptions.find((v: any) => v.value === type);
subGroupIDArr.push(`${WS_GROUP_KPI}_${ne.coreUid}_${ne.neUid}`);
});
const options: OptionsType = {
url: '/ws',
params: {
subGroupID: selectedNeTypes.value
.map(type => `10_${type.toUpperCase()}_001`)
.join(','),
subGroupID: subGroupIDArr.join(','),
},
onmessage: wsMessage,
onerror: wsError,

View File

@@ -22,6 +22,9 @@ import { OptionsType, WS } from '@/plugins/ws-websocket';
import { generateColorRGBA } from '@/utils/generate-utils';
import { LineOutlined } from '@ant-design/icons-vue';
import { TableColumnType } from 'ant-design-vue';
import useNeStore from '@/store/modules/ne';
import { WS_GROUP_KPI } from '@/constants/ne-constants';
const neStore = useNeStore();
const { t, currentLocale } = useI18n();
//定义KPI接口
interface KPIBase {
@@ -143,11 +146,19 @@ const fnRealTimeSwitch = (bool: boolean) => {
}
chartData.value = [];
let subGroupID: string[] = [];
neCascaderOptions.value.forEach(item => {
if (item.children.length > 0) {
const ne = item.children[0];
subGroupID.push(`${WS_GROUP_KPI}_${ne.coreUid}_${ne.neUid}`);
}
});
tableLoading.value = true;
const options: OptionsType = {
url: '/ws',
params: {
subGroupID: ALL_NE_TYPES.map(type => `10_${type}_001`).join(','),
subGroupID: subGroupID.join(','),
},
onmessage: wsMessage,
onerror: wsError,
@@ -243,9 +254,16 @@ const fetchChartData = async () => {
// 创建并行请求数组
const requests = ALL_NE_TYPES.map(async neType => {
let ne: Record<string, any> = {};
neCascaderOptions.value.forEach(item => {
if (item.value === neType && item.children.length > 0) {
ne = item.children[0];
}
});
const params = {
neType,
neId: '001',
neType: ne.neType,
neUid: ne.neUid,
coreUid: ne.coreUid,
beginTime: beginTime,
endTime: endTime,
sortField: 'timeGroup',
@@ -607,9 +625,16 @@ const updateChart = () => {
observer.observe(container);
}
};
/**网元参数 */
let neCascaderOptions = ref<Record<string, any>[]>([]);
//钩子函数
onMounted(async () => {
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
// 过滤不可用的网元
return ALL_NE_TYPES.includes(item.value);
});
try {
// 获取所有网元的指标
await fetchSpecificKPI();

View File

@@ -78,27 +78,32 @@ let tableColumns: ColumnsType = [
{
title: t('views.perfManage.taskManage.neType'),
dataIndex: 'neType',
align: 'center',
align: 'left',
width: 100,
},
{
title: t('views.perfManage.customTarget.kpiId'),
dataIndex: 'kpiId',
align: 'center',
align: 'left',
width: 150,
},
{
title: t('views.perfManage.customTarget.title'),
dataIndex: 'title',
align: 'center',
align: 'left',
width: 200,
},
{
title: t('views.perfManage.customTarget.expression'),
dataIndex: 'expression',
align: 'left',
width: 200,
},
{
title: t('views.perfManage.customTarget.description'),
dataIndex: 'description',
align: 'center',
align: 'left',
width: 150,
},
{
title: t('views.perfManage.customTarget.status'),
@@ -461,13 +466,9 @@ function fnChangeUnit(value: any) {
let neCascaderOptions = ref<Record<string, any>[]>([]);
onMounted(() => {
//
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
(item: any) => {
return !['OMC', 'NSSF', 'NEF', 'NRF', 'LMF', 'N3IWF'].includes(
item.value
);
}
);
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
return !['OMC', 'NSSF', 'NEF', 'NRF', 'LMF', 'N3IWF'].includes(item.value);
});
if (neCascaderOptions.value.length === 0) {
message.warning({
content: t('common.noData'),
@@ -593,7 +594,7 @@ onMounted(() => {
:data-source="tableState.data"
:size="tableState.size"
:pagination="tablePagination"
:scroll="{ x: true }"
:scroll="{ x: tableColumns.length * 150, y: 'calc(100vh - 480px)' }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'id'">

View File

@@ -47,6 +47,8 @@ import { LineOutlined } from '@ant-design/icons-vue';
import { useRoute } from 'vue-router';
import dayjs from 'dayjs';
import useLayoutStore from '@/store/modules/layout';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { WS_GROUP_KPI_C } from '@/constants/ne-constants';
const layoutStore = useLayoutStore();
const neStore = useNeStore();
const route = useRoute();
@@ -161,10 +163,12 @@ function fnTableSize({ key }: MenuInfo) {
/**查询参数 */
let queryParams: any = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */
neType: '',
/**网元标识 */
neId: '',
neUid: '',
/**开始时间 */
beginTime: '',
/**结束时间 */
@@ -309,7 +313,7 @@ function fnRecordExport() {
const title = tableColumnsTitleArr[i];
if (key == 'timeGroup') {
kpiData[title] = parseDateToStr(item[key]);
} else if (key === 'neName' || key === 'startIndex') {
} else if (key === 'startIndex') {
kpiData[title] = item[key];
} else {
const v = parseFloat(item[key]);
@@ -394,13 +398,6 @@ function fnGetListTitle() {
},
});
}
columns.push({
title: t('views.perfManage.perfData.neName'),
dataIndex: 'neName',
key: 'neName',
align: 'left',
width: 100,
});
columns.push({
title: t('views.perfManage.goldTarget.time'),
dataIndex: 'timeGroup',
@@ -436,7 +433,7 @@ function fnGetList() {
if (tableState.loading) return;
tableState.loading = true;
queryParams.neType = state.neType[0];
queryParams.neId = state.neType[1];
queryParams.neUid = state.neType[1];
queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1];
listCustomData(toRaw(queryParams))
@@ -468,9 +465,9 @@ function fnGetList() {
kpiStats.value = [];
for (const columns of tableColumns.value) {
if (
columns.key === 'neName' ||
columns.key === 'startIndex' ||
columns.key === 'timeGroup'
['coreUid', 'neUid', 'neType', 'startIndex', 'timeGroup'].includes(
columns.key
)
) {
continue;
}
@@ -533,9 +530,9 @@ function fnGetList() {
kpiStats.value = [];
for (const columns of tableColumns.value) {
if (
columns.key === 'neName' ||
columns.key === 'startIndex' ||
columns.key === 'timeGroup'
['coreUid', 'neUid', 'neType', 'startIndex', 'timeGroup'].includes(
columns.key
)
) {
continue;
}
@@ -650,9 +647,9 @@ function fnRanderChartData() {
for (var columns of tableColumns.value) {
if (
columns.key === 'neName' ||
columns.key === 'startIndex' ||
columns.key === 'timeGroup'
['coreUid', 'neUid', 'neType', 'startIndex', 'timeGroup'].includes(
columns.key
)
) {
continue;
}
@@ -767,6 +764,8 @@ function fnRanderChartData() {
/**图表实时统计 */
function fnRealTimeSwitch(bool: any) {
if (bool) {
const coreUid = queryParams.coreUid;
const neUid = queryParams.neUid;
tableState.seached = false;
//
const options: OptionsType = {
@@ -774,9 +773,9 @@ function fnRealTimeSwitch(bool: any) {
params: {
/**
*
* 指标(GroupID:10_neType_neId)
* 指标(GroupID:20_coreUid_neUid)
*/
subGroupID: `20_${queryParams.neType}_${queryParams.neId}`,
subGroupID: `${WS_GROUP_KPI_C}_${coreUid}_${neUid}`,
},
onmessage: wsMessage,
onerror: wsError,
@@ -981,14 +980,16 @@ onMounted(() => {
const item = neCascaderOptions.value.find(s => s.value === queryNeType);
if (item && item.children) {
const info = item.children[0];
state.neType = [info.neType, info.neId];
state.neType = [info.neType, info.neUid];
queryParams.neType = info.neType;
queryParams.neId = info.neId;
queryParams.neUid = info.neUid;
queryParams.coreUid = info.coreUid;
} else {
const info = neCascaderOptions.value[0].children[0];
state.neType = [info.neType, info.neId];
state.neType = [info.neType, info.neUid];
queryParams.neType = info.neType;
queryParams.neId = info.neId;
queryParams.neUid = info.neUid;
queryParams.coreUid = info.coreUid;
}
//

View File

@@ -9,7 +9,7 @@
<label style="margin-right: 8px; font-weight: 600;">{{ t('views.perfManage.voiceOverView.ne') }}</label>
<a-select
v-model:value="selectedImsNeId"
:options="imsNeList.map(ne => ({ label: ne.neName || ne.neId, value: ne.neId }))"
:options="imsNeList.map(ne => ({ label: ne.neName || ne.neUid, value: ne.neUid }))"
@change="onImsNeChange"
style="width: 100px; font-size: 15px;"
:dropdown-style="{ borderRadius: '8px' }"
@@ -149,6 +149,8 @@ import useNeStore from '@/store/modules/ne';
import { WS } from '@/plugins/ws-websocket'
import { listKPIData } from '@/api/perfManage/goldTarget'
import useI18n from '@/hooks/useI18n';
import { WS_GROUP_KPI } from '@/constants/ne-constants'
import { currentCoreUid } from '@/hooks/useCoreUid'
const neStore = useNeStore();
const { t } = useI18n();
echarts.use([LineChart, GridComponent, CanvasRenderer])
@@ -160,7 +162,7 @@ const regChartRef = ref<HTMLDivElement | null>(null)
const failedRegChartRef = ref<HTMLDivElement | null>(null)
// IMS
const imsNeList = ref<{ neId: string, neName: string }[]>([])
const imsNeList = ref<{ neUid: string, neName: string }[]>([])
// IMSID
const selectedImsNeId = ref('')
// WebSocket
@@ -182,7 +184,7 @@ onMounted(async () => {
// console.log('IMS:', imsNeList.value) //
if (imsNeList.value.length > 0) {
selectedImsNeId.value = imsNeList.value[0].neId
selectedImsNeId.value = imsNeList.value[0].neUid
// console.log('IMS:', selectedImsNeId.value) //
//
@@ -197,8 +199,8 @@ onMounted(async () => {
})
//
async function fetchHistoryData(neId: string) {
if (!neId) return
async function fetchHistoryData(neUid: string) {
if (!neUid) return
try {
// 30
@@ -207,8 +209,9 @@ async function fetchHistoryData(neId: string) {
//
const params = {
coreUid: currentCoreUid(),
neType: 'IMS',
neId: neId,
neUid: neUid,
interval: 60, // 1
beginTime: beginTime.toString(),
endTime: endTime.toString(),
@@ -274,8 +277,8 @@ async function onImsNeChange() {
}
// IMS
function subscribeImsRealtime(neId: string) {
// console.log('IMSID:', neId) //
function subscribeImsRealtime(neUid: string) {
// console.log('IMSID:', neUid) //
wsStatus.value = '连接中...' //
// WebSocket
@@ -286,7 +289,7 @@ function subscribeImsRealtime(neId: string) {
}
if (!neId) return
if (!neUid) return
imsWs.value = new WS()
// console.log('WebSocket') //
@@ -294,7 +297,7 @@ function subscribeImsRealtime(neId: string) {
imsWs.value.connect({
url: '/ws',
params: {
subGroupID: `10_IMS_${neId}`,
subGroupID: `${WS_GROUP_KPI}_${currentCoreUid()}_${neUid}`,
},
onmessage: handleIMSRealtimeData,
onerror: (error: any) => {
@@ -1022,8 +1025,8 @@ function handleIMSRealtimeData(res: any) {
//console.log('KPIgroupId:', data.groupId) //
// IDIMS
const [_, neType, neId] = data.groupId.split('_')
if (neType !== 'IMS' || neId !== selectedImsNeId.value) {
const [_, neType, neUid] = data.groupId.split('_')
if (neType !== 'IMS' || neUid !== selectedImsNeId.value) {
//console.log(':', data.groupId) //
return
}

View File

@@ -283,7 +283,7 @@ function fnModalVisibleByEdit(record?: any) {
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getNeInfo(record.id).then(res => {
getNeInfo(currentCoreUid(), record.id).then(res => {
modalState.confirmLoading = false;
hide();
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -9,7 +9,7 @@ import {
} from '@/constants/result-constants';
import TerminalSSHView from '@/components/TerminalSSHView/index.vue';
import useNeStore from '@/store/modules/ne';
import { iperfI, iperfV } from '@/api/tool/iperf';
import { iperfV } from '@/api/tool/iperf';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore();
const { t } = useI18n();
@@ -108,8 +108,8 @@ async function fnIPerf() {
if (resVersion.code !== RESULT_CODE_SUCCESS) {
Modal.confirm({
title: t('common.tipTitle'),
content: 'Not found if iperf is installed',
onOk: () => fnInstall(),
content: 'Not found iperf version, please install (https://iperf.fr)',
onOk: () => {},
});
return;
} else {
@@ -124,33 +124,6 @@ async function fnIPerf() {
state.initialized = true;
}
/**触发安装iperf */
function fnInstall() {
const key = 'iperfI';
message.loading({ content: t('common.loading'), key });
const { neType, neUid, coreUid } = state.params;
iperfI({
neType,
neUid,
coreUid,
version: state.data.version,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: 'install success',
key,
duration: 2,
});
} else {
message.error({
content: 'install fail',
key,
duration: 2,
});
}
});
}
/**终端实例 */
const toolTerminal = ref();

View File

@@ -14,6 +14,7 @@ import useTabsStore from '@/store/modules/tabs';
import useI18n from '@/hooks/useI18n';
import saveAs from 'file-saver';
import { useRoute, useRouter } from 'vue-router';
import { currentCoreUid } from '@/hooks/useCoreUid';
const tabsStore = useTabsStore();
const neStore = useNeStore();
const { t } = useI18n();
@@ -30,7 +31,8 @@ let neTypeSelect = ref<string[]>([]);
let queryParams = reactive({
/**网元类型 */
neType: '',
neId: '',
neUid: '',
coreUid: '',
/**读取路径 */
path: '',
/**前缀过滤 */
@@ -142,8 +144,9 @@ function fnDownloadFile(row: Record<string, any>) {
downLoading.value = true;
const hide = message.loading(t('common.loading'), 0);
getNeFile({
coreUid: queryParams.coreUid,
neType: queryParams.neType,
neId: queryParams.neId,
neUid: queryParams.neUid,
path: queryParams.path,
fileName: row.fileName,
delTemp: true,
@@ -182,8 +185,9 @@ function fnDownloadFileZIP(row: Record<string, any>) {
downLoading.value = true;
const hide = message.loading(t('common.loading'), 0);
getNeDirZip({
coreUid: queryParams.coreUid,
neType: queryParams.neType,
neId: queryParams.neId,
neUid: queryParams.neUid,
path: `${queryParams.path}/${row.fileName}`,
delTemp: true,
})
@@ -244,10 +248,10 @@ function fnDirCD(dir: string, index?: number) {
const neType = queryParams.neType;
if (neType === 'UPF' && tmp.value) {
nePathArr.value = ['/tmp'];
queryParams.search = `${neType}_${queryParams.neId}`;
queryParams.search = `${neType}_${queryParams.neUid}`;
} else {
nePathArr.value = [
`/usr/local/omc/tcpdump/${neType.toLowerCase()}/${queryParams.neId}`,
`/usr/local/omc/tcpdump/${neType.toLowerCase()}/${queryParams.neUid}`,
];
queryParams.search = '';
}
@@ -264,16 +268,17 @@ function fnDirCD(dir: string, index?: number) {
function fnNeChange(keys: any, _: any) {
if (!Array.isArray(keys)) return;
const neType = keys[0];
const neId = keys[1];
const neUid = keys[1];
// 不是同类型时需要重新加载
if (queryParams.neType !== neType || queryParams.neId !== neId) {
if (queryParams.neType !== neType || queryParams.neUid !== neUid) {
queryParams.neType = neType;
queryParams.neId = neId;
queryParams.neUid = neUid;
queryParams.coreUid = currentCoreUid();
if (neType === 'UPF' && tmp.value) {
nePathArr.value = ['/tmp'];
queryParams.search = `${neType}_${neId}`;
queryParams.search = `${neType}_${neUid}`;
} else {
nePathArr.value = [`/usr/local/omc/tcpdump/${neType.toLowerCase()}/${neId}`];
nePathArr.value = [`/usr/local/omc/tcpdump/${neType.toLowerCase()}/${neUid}`];
queryParams.search = '';
}
fnGetList(1);
@@ -282,7 +287,7 @@ function fnNeChange(keys: any, _: any) {
/**查询列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (queryParams.neId === '') {
if (queryParams.neUid === '') {
message.warning({
content: t('views.logManage.neFile.neTypePlease'),
duration: 2,
@@ -325,20 +330,23 @@ const viewDrawerState = reactive({
/**网元类型 */
neType: '',
/**网元ID */
neId: '',
neUid: '',
/**核心网ID */
coreUid: '',
});
/**打开抽屉查看 */
function fnDrawerOpen(row: Record<string, any>) {
viewDrawerState.filePath = [...nePathArr.value, row.fileName].join('/');
viewDrawerState.neType = neTypeSelect.value[0];
viewDrawerState.neId = neTypeSelect.value[1];
viewDrawerState.neUid = neTypeSelect.value[1];
viewDrawerState.coreUid = currentCoreUid();
viewDrawerState.open = !viewDrawerState.open;
}
onMounted(() => {
if (routeParams.neType && routeParams.neId) {
neTypeSelect.value = [routeParams.neType, routeParams.neId];
if (routeParams.neType && routeParams.neUid) {
neTypeSelect.value = [routeParams.neType, routeParams.neUid];
fnNeChange(neTypeSelect.value, undefined);
}
});
@@ -469,7 +477,8 @@ onMounted(() => {
v-model:open="viewDrawerState.open"
:file-path="viewDrawerState.filePath"
:ne-type="viewDrawerState.neType"
:ne-id="viewDrawerState.neId"
:ne-uid="viewDrawerState.neUid"
:core-uid="viewDrawerState.coreUid"
></ViewDrawer>
</PageContainer>
</template>

View File

@@ -37,7 +37,8 @@ type ModalStateType = {
/**提交表单参数 */
data: {
neType: string;
neId: string;
neUid: string;
coreUid: string;
cmd?: string;
};
}
@@ -69,7 +70,8 @@ type ModalStateType = {
/**详情框内容 */
viewFrom: {
neType: string;
neId: string;
neUid: string;
coreUid: string;
path: string;
action: string;
files: string[];
@@ -117,7 +119,8 @@ let modalState: ModalStateType = reactive({
openByView: false,
viewFrom: {
neType: '',
neId: '',
neUid: '',
coreUid: '',
path: '',
action: '',
files: [],
@@ -150,12 +153,6 @@ let tableColumns: ColumnsType = [
align: 'left',
width: 100,
},
{
title: t('views.ne.common.neUid'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{
title: t('views.ne.common.neName'),
dataIndex: 'neName',
@@ -164,7 +161,7 @@ let tableColumns: ColumnsType = [
},
{
title: t('views.ne.common.ipAddr'),
dataIndex: 'ip',
dataIndex: 'ipAddr',
align: 'left',
width: 150,
},
@@ -214,7 +211,8 @@ function fnGetList() {
taskFiles: [],
data: {
neType: item.neType,
neId: item.neId,
neUid: item.neUid,
coreUid: item.coreUid,
},
};
}
@@ -439,12 +437,13 @@ function fnDownPCAP(row?: Record<string, any>) {
)
);
} else {
const { neType, neId } = from.data;
const path = `/usr/local/omc/tcpdump/${neType.toLowerCase()}/${neId}/${taskCode}`;
const { neType, neUid, coreUid } = from.data;
const path = `/usr/local/omc/tcpdump/${neType.toLowerCase()}/${neUid}/${taskCode}`;
reqArr.push(
getNeDirZip({
neType,
neId,
neUid,
coreUid,
path,
delTemp: true,
})
@@ -456,6 +455,9 @@ function fnDownPCAP(row?: Record<string, any>) {
const hide = message.loading(t('common.loading'), 0);
Promise.allSettled(reqArr)
.then(resArr => {
type successType = { data: Blob; filename: string }[];
const successResults: successType = [];
resArr.forEach((res, idx) => {
const title = fromArr[idx].title;
const taskCode = fromArr[idx].taskCode;
@@ -468,11 +470,14 @@ function fnDownPCAP(row?: Record<string, any>) {
duration: 3,
});
// 文件名
let filename = `${title}_${Date.now()}.zip`;
if (taskCode.startsWith('/tmp')) {
saveAs(resV.data, `${title}_${Date.now()}.pcap`);
} else {
saveAs(resV.data, `${title}_${Date.now()}.zip`);
filename = `${title}_${Date.now()}.pcap`;
}
successResults.push({
data: resV.data,
filename: filename,
});
} else {
message.warning({
content: `${resV.msg}`,
@@ -486,6 +491,28 @@ function fnDownPCAP(row?: Record<string, any>) {
});
}
});
// 分批下载函数每批3个间隔300ms
const batchDownload = async (results: successType) => {
const batchSize = 3;
const delay = 1_000; // 毫秒
for (let i = 0; i < results.length; i += batchSize) {
const batch = results.slice(i, i + batchSize);
// 处理当前批次
batch.forEach(item => {
saveAs(item.data, item.filename);
});
await new Promise(resolve =>
setTimeout(() => resolve(true), delay)
);
}
};
// 开始分批下载
batchDownload(successResults);
})
.finally(() => {
hide();
@@ -519,13 +546,14 @@ function fnBatchOper(key: string) {
function fnModalVisibleByVive(id: string | number) {
const from = modalState.from[id];
if (!from) return;
const { neType, neId } = from.data;
const path = `/usr/local/omc/tcpdump/${neType.toLowerCase()}/${neId}/${
const { neType, neUid, coreUid } = from.data;
const path = `/usr/local/omc/tcpdump/${neType.toLowerCase()}/${neUid}/${
from.taskCode
}`;
const files = from.taskFiles.filter(f => f.endsWith('log'));
modalState.viewFrom.neType = neType;
modalState.viewFrom.neId = neId;
modalState.viewFrom.neUid = neUid;
modalState.viewFrom.coreUid = coreUid;
modalState.viewFrom.path = path;
modalState.viewFrom.files = [...files];
fnViveTab(files[0]);
@@ -538,9 +566,10 @@ function fnViveTab(action: any) {
if (modalState.viewFrom.action === action) return;
modalState.viewFrom.action = action;
modalState.viewFrom.content = '';
const { neType, neId, path } = modalState.viewFrom;
const { neType, neUid, coreUid, path } = modalState.viewFrom;
getNeViewFile({
neId,
coreUid,
neUid,
neType,
path,
fileName: action,
@@ -573,7 +602,8 @@ function fnFileView(row?: Record<string, any>) {
if (row) {
const from = modalState.from[row.id];
query = {
neId: from.data.neId,
coreUid: from.data.coreUid,
neUid: from.data.neUid,
neType: from.data.neType,
};
}

View File

@@ -10,6 +10,7 @@ import {
import TerminalSSHView from '@/components/TerminalSSHView/index.vue';
import useNeStore from '@/store/modules/ne';
import { pingV } from '@/api/tool/ping';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore();
const { t } = useI18n();
@@ -30,8 +31,9 @@ let state = reactive({
dataType: 'options' as 'options' | 'command',
/**ws参数 */
params: {
coreUid: '',
neUid: '',
neType: '',
neId: '',
cols: 120,
rows: 40,
},
@@ -50,8 +52,8 @@ let state = reactive({
/**连接发送 */
async function fnPing() {
const [neType, neId] = state.neType;
if (!neType || !neId) {
const [neType, neUid] = state.neType;
if (!neType || !neUid) {
message.warning({
content: 'No Found NE Type',
duration: 2,
@@ -74,14 +76,18 @@ async function fnPing() {
}
// 网元切换时重置
if (neType !== state.params.neType || neId !== state.params.neId) {
if (neType !== state.params.neType || neUid !== state.params.neUid) {
state.initialized = false;
state.params.neType = neType;
state.params.neId = neId;
state.params.neUid = neUid;
state.params.coreUid = currentCoreUid();
}
// 软件版本检查
const resVersion = await pingV({ neType, neId });
state.params.neType = neType;
state.params.neUid = neUid;
state.params.coreUid = currentCoreUid();
const resVersion = await pingV({ coreUid: currentCoreUid(), neUid, neType });
if (resVersion.code !== RESULT_CODE_SUCCESS) {
message.warning({
content: 'No Found ping iputils',
@@ -391,7 +397,8 @@ onBeforeUnmount(() => {});
prefix="ping"
url="/tool/ping/run"
:ne-type="state.params.neType"
:ne-id="state.params.neId"
:ne-uid="state.params.neUid"
:core-uid="state.params.coreUid"
:rows="state.params.rows"
:cols="state.params.cols"
:process-messages="fnProcessMessage"

View File

@@ -23,6 +23,7 @@ import {
} from '@/api/trace/packet';
import { parseDateToStr } from '@/utils/date-utils';
import { ColumnsType } from 'ant-design-vue/es/table';
import { WS_GROUP_TRACE_PACKET } from '@/constants/ne-constants';
const ws = new wsUtil.WS();
const wk = new wkUtil.WK();
const { t } = useI18n();
@@ -196,7 +197,7 @@ function wsMessage(res: Record<string, any>) {
return;
}
packetKeep(taskState.task.taskNo, 120);
}, 90 * 1000);
}, 90_000);
return;
}
@@ -222,9 +223,9 @@ function fnWS() {
*
* 信令跟踪Packet (GroupID:4_taskNo)
*/
subGroupID: `4_${taskState.task.taskNo}`,
subGroupID: `${WS_GROUP_TRACE_PACKET}_${taskState.task.taskNo}`,
},
heartTimer: 30 * 1000,
heartTimer: 30_000,
onmessage: wsMessage,
onerror: (ev: any) => {
// 接收数据后回调
@@ -271,7 +272,7 @@ const taskState = reactive<TaskStateType>({
outputPCAP: false,
},
filter: '',
filter: 'greater 200 and less 2500 and tcp and port 33030',
filterError: null,
keepTimer: null,
@@ -330,7 +331,7 @@ function fnStop() {
clearInterval(taskState.keepTimer);
taskState.keepTimer = null;
taskState.filter = '';
taskState.filter = 'greater 200 and less 2500 and tcp and port 33030';
taskState.filterError = null;
taskState.stop = true;