ref: v3变更,,同步v2.2508.4

This commit is contained in:
TsMask
2025-09-01 11:19:01 +08:00
parent 2319cdf36b
commit e943b4dedc
129 changed files with 1876 additions and 3032 deletions

View File

@@ -6,12 +6,13 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
* 获取活动告警数 * 获取活动告警数
* @returns object * @returns object
*/ */
export async function getActiveAlarmTotal() { export async function getActiveAlarmTotal(coreUid: string) {
// 发起请求 // 发起请求
const result = await request({ const result = await request({
url: `/neData/alarm/list`, url: `/neData/alarm/list`,
method: 'GET', method: 'GET',
params: { params: {
coreUid: coreUid,
alarmStatus: 'Active', alarmStatus: 'Active',
sortField: 'event_time', sortField: 'event_time',
sortOrder: 'desc', sortOrder: 'desc',
@@ -42,18 +43,15 @@ export async function listAct(query: Record<string, any>) {
/** /**
* 确认告警信息 * 确认告警信息
* @param ids 记录ID * @param id 记录ID
* @param state 状态 true确认 false取消确认 * @param state 状态 true确认 false取消确认
* @returns object * @returns object
*/ */
export function ackAlarm(ids: number[], state: boolean) { export function ackAlarm(data: Record<string, any>) {
return request({ return request({
url: `/neData/alarm/ack'`, url: `/neData/alarm/ack'`,
method: 'PUT', method: 'PUT',
data: { data,
ids: ids,
ackState: state,
},
}); });
} }
@@ -105,14 +103,14 @@ export function getPass() {
/** /**
* 清除告警信息 * 清除告警信息
* @param ids 记录ID * @param id 记录ID
* @returns object * @returns object
*/ */
export function clearAlarm(ids: number[]) { export function clearAlarm(id: number, coreUid: string) {
return request({ return request({
url: `/neData/alarm/clear`, url: `/neData/alarm/clear`,
method: 'PUT', method: 'PUT',
data: { ids }, data: { id, coreUid },
}); });
} }
@@ -193,11 +191,12 @@ export async function exportAll(query: Record<string, any>) {
* @param query 查询参数 * @param query 查询参数
* @returns bolb * @returns bolb
*/ */
export async function origGet() { export async function origGet(coreUid: string) {
return await request({ return await request({
url: `/neData/alarm/count/severity`, url: `/neData/alarm/count/severity`,
method: 'GET', method: 'GET',
params: { params: {
coreUid: coreUid,
alarmStatus: 'Active', alarmStatus: 'Active',
}, },
}); });
@@ -208,11 +207,12 @@ export async function origGet() {
* @param filterFlag 查询参数 * @param filterFlag 查询参数
* @returns object * @returns object
*/ */
export async function top3Sel() { export async function top3Sel(coreUid: string) {
return await request({ return await request({
url: `/neData/alarm/count/ne`, url: `/neData/alarm/count/ne`,
method: 'GET', method: 'GET',
params: { params: {
coreUid: coreUid,
alarmStatus: 'Active', alarmStatus: 'Active',
top: 3, top: 3,
}, },

100
src/api/ne/neAction.ts Normal file
View File

@@ -0,0 +1,100 @@
import { request } from '@/plugins/http-fetch';
/**
* 查询网元状态
* @param coreUid 核心网ID
* @param neUid 网元ID
* @returns object
*/
export function stateNeInfo(coreUid: string, neUid: string) {
return request({
url: '/ne/info/state',
method: 'GET',
params: { coreUid, neUid },
});
}
/**
* 查询网元信息
* @param coreUid 核心网ID
* @param neUid 网元ID
* @returns object
*/
export function getNeInfoByNF(coreUid: string, neUid: string) {
return request({
url: '/ne/info/nf',
method: 'GET',
params: { coreUid, neUid },
});
}
/**
* 网元端OAM配置文件读取
* @param coreUid 核心网ID
* @param neUid 网元ID
* @returns object
*/
export function getOAMFile(coreUid: string, neUid: string) {
return request({
url: '/ne/info/file/oam',
method: 'GET',
params: { coreUid, neUid },
});
}
/**
* 网元端配置文件写入
* @param coreUid 核心网ID
* @param neUid 网元ID
* @param content 用json对象
* @param sync 同步到网元
* @returns object
*/
export function saveOAMFile(data: Record<string, any>) {
return request({
url: `/ne/info/file/oam`,
method: 'PUT',
data: data,
timeout: 60_000,
});
}
/**
* 网元端公共配置文件读取
* @returns object
*/
export function getPara5GFilee() {
return request({
url: '/ne/info/file/para5g',
method: 'GET',
});
}
/**
* 网元端公共配置文件写入
* @param content txt内容为字符串 其他文件格式都用json对象
* @param syncNe 同步到网元端 coreUid@ neUid
* @returns object
*/
export function savePara5GFile(data: Record<string, any>) {
return request({
url: `/ne/info/file/para5g`,
method: 'PUT',
data: data,
timeout: 60_000,
});
}
/**
* 网元服务操作
* @param data 对象 {coreUid, neUid, action}
* @returns object
*/
export function serviceNeAction(data: Record<string, any>) {
return request({
url: `/ne/action/service`,
method: 'PUT',
data: data,
timeout: 60_000,
});
}

View File

@@ -33,11 +33,11 @@ export function updateNeConfigBackup(data: Record<string, any>) {
* @param id 记录ID * @param id 记录ID
* @returns object * @returns object
*/ */
export async function downNeConfigBackup(id: string) { export async function downNeConfigBackup(query: Record<string, any>) {
return await request({ return await request({
url: '/ne/config/backup/download', url: '/ne/config/backup/download',
method: 'GET', method: 'GET',
params: { id }, params: query,
responseType: 'blob', responseType: 'blob',
timeout: 180_000, timeout: 180_000,
}); });
@@ -48,11 +48,11 @@ export async function downNeConfigBackup(id: string) {
* @param id 记录ID * @param id 记录ID
* @returns object * @returns object
*/ */
export async function delNeConfigBackup(id: string) { export async function delNeConfigBackup(query: Record<string, any>) {
return request({ return request({
url: '/ne/config/backup', url: '/ne/config/backup',
method: 'DELETE', method: 'DELETE',
params: { id }, params: query,
}); });
} }

View File

@@ -21,10 +21,11 @@ export function listNeInfo(query: Record<string, any>) {
* @param infoId 信息ID * @param infoId 信息ID
* @returns object * @returns object
*/ */
export function getNeInfo(infoId: string | number) { export function getNeInfo(coreUid: string, id: string | number) {
return request({ return request({
url: `/ne/info/${infoId}`, url: `/ne/info`,
method: 'GET', method: 'GET',
params: { coreUid, id },
}); });
} }
@@ -60,126 +61,28 @@ export function updateNeInfo(data: Record<string, any>) {
/** /**
* 网元信息删除 * 网元信息删除
* @param id 信息ID * @param query 查询参数 coreUid, neUid id
* @returns object * @returns object
*/ */
export function delNeInfo(infoIds: string | number) { export function delNeInfo(query: Record<string, any>) {
return request({ return request({
url: `/ne/info/${infoIds}`, url: `/ne/info`,
method: 'DELETE', method: 'DELETE',
timeout: 60_000,
});
}
/**
* 查询网元列表全部无分页
* @param query 查询参数 neType neId bandStatus bandHost
* @returns object
*/
export function listAllNeInfo(query: Record<string, any>) {
return request({
url: '/ne/info/listAll',
method: 'GET',
params: query, params: query,
timeout: 60_000, timeout: 60_000,
}); });
} }
/** /**
* 查询网元状态 * 查询网元列表全部无分页
* @param neType 网元类型 * @param query 查询参数 coreUid, neUid bandStatus bandHost
* @param neId 网元ID
* @returns object * @returns object
*/ */
export function stateNeInfo(neType: string, neId: string) { export function listAllNeInfo(query: Record<string, any>) {
return request({ return request({
url: '/ne/info/state', url: '/ne/info/list/all',
method: 'GET', method: 'GET',
params: { neType, neId }, params: query,
});
}
/**
* 查询网元信息
* @param neType 网元类型
* @param neId 网元ID
* @returns object
*/
export function getNeInfoByTypeAndID(neType: string, neId: string) {
return request({
url: '/ne/info/byTypeAndID',
method: 'GET',
params: { neType, neId },
});
}
/**
* 网元端OAM配置文件读取
* @param neType 网元类型
* @param neId 网元ID
* @returns object
*/
export function getOAMFile(neType: string, neId: string) {
return request({
url: '/ne/info/oamFile',
method: 'GET',
params: { neType, neId },
});
}
/**
* 网元端配置文件写入
* @param neType 网元类型
* @param neId 网元ID
* @param content 用json对象
* @param sync 同步到网元
* @returns object
*/
export function saveOAMFile(data: Record<string, any>) {
return request({
url: `/ne/info/oamFile`,
method: 'PUT',
data: data,
timeout: 60_000,
});
}
/**
* 网元端公共配置文件读取
* @returns object
*/
export function getPara5GFilee() {
return request({
url: '/ne/info/para5GFile',
method: 'GET',
});
}
/**
* 网元端公共配置文件写入
* @param content txt内容为字符串 其他文件格式都用json对象
* @param syncNe 同步到网元端 NeType@ NeId
* @returns object
*/
export function savePara5GFile(data: Record<string, any>) {
return request({
url: `/ne/info/para5GFile`,
method: 'PUT',
data: data,
timeout: 60_000,
});
}
/**
* 网元服务操作
* @param data 对象 {neType,neId,action}
* @returns object
*/
export function serviceNeAction(data: Record<string, any>) {
return request({
url: `/ne/action/service`,
method: 'PUT',
data: data,
timeout: 60_000, timeout: 60_000,
}); });
} }

View File

@@ -19,24 +19,25 @@ export function listNeLicense(query: Record<string, any>) {
* @param licenseId 信息ID * @param licenseId 信息ID
* @returns object * @returns object
*/ */
export function getNeLicense(licenseId: string | number) { export function getNeLicense(coreUid: string, id: string | number) {
return request({ return request({
url: `/ne/license/${licenseId}`, url: `/ne/license`,
method: 'GET', method: 'GET',
params: { coreUid, id },
}); });
} }
/** /**
* 网元neType和neID查询 * 网元neType和neID查询
* @param neType 网元类型 * @param neType 网元类型
* @param neId 网元ID * @param neUid 网元ID
* @returns object * @returns object
*/ */
export function getNeLicenseByTypeAndID(neType: string, neId: string) { export function getNeLicenseByNF(coreUid: string, neUid: string) {
return request({ return request({
url: `/ne/license/byTypeAndID`, url: `/ne/license/nf`,
method: 'GET', method: 'GET',
params: { neType, neId }, params: { coreUid, neUid },
}); });
} }
@@ -70,14 +71,14 @@ export function changeNeLicense(data: Record<string, any>) {
/** /**
* 网元授权激活状态 * 网元授权激活状态
* @param neType 网元类型 * @param coreUid 核心uid
* @param neId 网元id * @param neUid 网元uid
* @returns object * @returns object
*/ */
export function stateNeLicense(neType: string, neId: string) { export function stateNeLicense(coreUid: string, neUid: string) {
return request({ return request({
url: `/ne/license/state`, url: `/ne/license/state`,
method: 'GET', method: 'GET',
params: { neType, neId }, params: { coreUid, neUid },
}); });
} }

View File

@@ -1,13 +1,13 @@
import { request } from '@/plugins/http-fetch'; import { request } from '@/plugins/http-fetch';
// 更新网元配置重新载入 // 更新网元配置重新载入
export function updateNeConfigReload(neType: string, neId: string) { export function updateNeConfigReload(coreUid: string, neUid: string) {
return request({ return request({
url: '/tool/mml/command', url: '/tool/mml/command',
method: 'POST', method: 'POST',
data: { data: {
neType: neType, coreUid: coreUid,
neId: neId, neUid: neUid,
type: 'General', type: 'General',
command: ['reload'], command: ['reload'],
}, },

View File

@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
*/ */
export function listNeFiles(query: Record<string, any>) { export function listNeFiles(query: Record<string, any>) {
return request({ return request({
url: '/ne/action/files', url: '/ne/action/file/list',
method: 'GET', method: 'GET',
params: query, params: query,
}); });
@@ -20,7 +20,7 @@ export function listNeFiles(query: Record<string, any>) {
*/ */
export function getNeFile(query: Record<string, any>) { export function getNeFile(query: Record<string, any>) {
return request({ return request({
url: '/ne/action/pullFile', url: '/ne/action/file/pull',
method: 'GET', method: 'GET',
params: query, params: query,
responseType: 'blob', responseType: 'blob',
@@ -31,7 +31,7 @@ export function getNeFile(query: Record<string, any>) {
// 从网元到本地获取目录压缩为ZIP // 从网元到本地获取目录压缩为ZIP
export function getNeDirZip(data: Record<string, any>) { export function getNeDirZip(data: Record<string, any>) {
return request({ return request({
url: '/ne/action/pullDirZip', url: '/ne/action/file/pull/dirzip',
method: 'GET', method: 'GET',
params: data, params: data,
responseType: 'blob', responseType: 'blob',
@@ -42,7 +42,7 @@ export function getNeDirZip(data: Record<string, any>) {
// 查看网元端文件内容 // 查看网元端文件内容
export function getNeViewFile(data: Record<string, any>) { export function getNeViewFile(data: Record<string, any>) {
return request({ return request({
url: '/ne/action/viewFile', url: '/ne/action/file/view',
method: 'GET', method: 'GET',
params: data, params: data,
timeout: 60_000, timeout: 60_000,

View File

@@ -20,10 +20,11 @@ export async function listTraceTask(query: Record<string, any>) {
* @param id 网元ID * @param id 网元ID
* @returns object * @returns object
*/ */
export async function getTraceTask(id: string | number) { export async function getTraceTask(coreUid: string, id: string | number) {
return request({ return request({
url: `/trace/task/${id}`, url: `/trace/task`,
method: 'GET', method: 'GET',
params: { coreUid, id },
}); });
} }
@@ -58,10 +59,11 @@ export function updateTraceTask(data: Record<string, any>) {
* @param ids ID多个逗号分隔 * @param ids ID多个逗号分隔
* @returns object * @returns object
*/ */
export async function delTraceTask(ids: string) { export async function delTraceTask(coreUid: string, id: string | number) {
return request({ return request({
url: `/trace/task/${ids}`, url: `/trace/task`,
method: 'DELETE', method: 'DELETE',
params: { coreUid, id },
}); });
} }

View File

@@ -24,10 +24,16 @@ const props = defineProps({
required: true, required: true,
}, },
/**网元ID必传 */ /**网元ID必传 */
neId: { neUid: {
type: String, type: String,
required: true, required: true,
}, },
/**核心网标识 */
coreUid: {
type: String,
default: '',
required: true,
},
/**窗口单行字符数 */ /**窗口单行字符数 */
cols: { cols: {
type: Number, type: Number,
@@ -111,7 +117,8 @@ function wsOpen(ev: any) {
cols: terminal.value.cols, cols: terminal.value.cols,
rows: terminal.value.rows, rows: terminal.value.rows,
neType: props.neType, neType: props.neType,
neId: props.neId, neUid: props.neUid,
coreUid: props.coreUid,
id: props.id, id: props.id,
}); });
}); });
@@ -142,7 +149,8 @@ function wsClose(code: number) {
emit('close', { emit('close', {
code: code, code: code,
neType: props.neType, neType: props.neType,
neId: props.neId, neUid: props.neUid,
coreUid: props.coreUid,
id: props.id, id: props.id,
}); });
} }
@@ -161,8 +169,8 @@ function wsMessage(res: Record<string, any>) {
let text = ''; let text = '';
// 处理消息 // 处理消息
if (props.processMessages) { if (props.processMessages) {
text = props.processMessages(data); text = props.processMessages(data);
}else{ } else {
text = processMessage(data); text = processMessage(data);
} }
// 无消息是则不输出 // 无消息是则不输出
@@ -202,13 +210,14 @@ function processMessage(data: string): string {
} }
onMounted(() => { onMounted(() => {
if (props.neType && props.neId) { if (props.neType && props.neUid && props.coreUid) {
// 建立链接 // 建立链接
const options: OptionsType = { const options: OptionsType = {
url: props.url, url: props.url,
params: { params: {
neType: props.neType, neType: props.neType,
neId: props.neId, neUid: props.neUid,
coreUid: props.coreUid,
cols: props.cols, cols: props.cols,
rows: props.rows, rows: props.rows,
}, },

View File

@@ -7,6 +7,9 @@ export const CACHE_SESSION_FATCH = 'cache:session:fatch';
/**会话缓存-当前选中核心网 */ /**会话缓存-当前选中核心网 */
export const CACHE_SESSION_CORE = 'cache:session:core'; export const CACHE_SESSION_CORE = 'cache:session:core';
/**会话缓存-当前选中核心网UID */
export const CACHE_SESSION_CORE_UID = 'cache:session:core:uid';
/**本地缓存-布局设置 */ /**本地缓存-布局设置 */
export const CACHE_LOCAL_PROCONFIG = 'cache:local:proConfig'; export const CACHE_LOCAL_PROCONFIG = 'cache:local:proConfig';

View File

@@ -22,6 +22,12 @@ export const NE_TYPE_LIST = [
'CHF', 'CHF',
'HLR', 'HLR',
'SGWC', 'SGWC',
'PGWC',
'IP-SM-GW',
'MMTel-AS',
'I-CSCF',
'P-CSCF',
'S-CSCF',
]; ];
/** /**

10
src/hooks/useCoreUid.ts Normal file
View File

@@ -0,0 +1,10 @@
import { CACHE_SESSION_CORE_UID } from '@/constants/cache-keys-constants';
import { sessionGet } from '@/utils/cache-session-utils';
/**
* 获取当前coreUid
* @returns coreUid
*/
export function currentCoreUid() {
return sessionGet(CACHE_SESSION_CORE_UID) || '';
}

View File

@@ -525,9 +525,9 @@ export default {
neType: 'NE Type', neType: 'NE Type',
neTypePlease: "Please select network element type", neTypePlease: "Please select network element type",
neTypeTip: 'Fill in the type of network element to be created, e.g. SMF.', neTypeTip: 'Fill in the type of network element to be created, e.g. SMF.',
neId: 'NE ID', neUid: 'NE UID',
neIdPlease: 'Please enter the network element identification', neUidPlease: 'Please enter the network element identification',
neIdTip: 'Fill in the unique identifier of the network element binding', neUidTip: 'Fill in the unique identifier of the network element binding',
rmUid: 'Resource Unique ID', rmUid: 'Resource Unique ID',
rmUidPlease: 'Please enter a resource unique ID', rmUidPlease: 'Please enter a resource unique ID',
rmUidTip: "Tagging for data reporting of network element logs, alarms, metrics, etc.", rmUidTip: "Tagging for data reporting of network element logs, alarms, metrics, etc.",
@@ -539,6 +539,8 @@ export default {
port: 'Port', port: 'Port',
portTip: "Network element port default:33030", portTip: "Network element port default:33030",
capability: 'Capability', capability: 'Capability',
ueNumber: 'UE Number',
nbNumber: 'Radio Number',
serialNum: 'Serial Number', serialNum: 'Serial Number',
expiryDate: 'Expiry Date', expiryDate: 'Expiry Date',
normalcy: 'Normal', normalcy: 'Normal',
@@ -565,13 +567,13 @@ export default {
sysDisk: "SYS Store", sysDisk: "SYS Store",
neCpu: "NE CPU", neCpu: "NE CPU",
hostConfig: "Connection Configuration", hostConfig: "Connection Configuration",
pvflag: 'NE Virtualization', pvflag: 'Virtual Flag',
pnf: 'physical network element', pnf: 'physical network element',
vnf: 'virtual network element', vnf: 'virtual network element',
neAddress: 'MAC', macAddr: 'MAC',
neAddressTip: 'Record the physical address (MAC) of the network card of the network element', macAddrTip: 'Record the physical address (MAC) of the network card of the network element',
dn: 'network identifier', dn: 'Network Identifier',
vendorName: 'provider', vendorName: 'Provider',
province: 'Service Area', province: 'Service Area',
addTitle: 'New network element information', addTitle: 'New network element information',
editTitle: 'Edit network element information', editTitle: 'Edit network element information',
@@ -1291,8 +1293,6 @@ export default {
mml:{ mml:{
account:'Account', account:'Account',
ip:'IP', ip:'IP',
type:'NE Type',
neId:'NE ID',
MML:'MML', MML:'MML',
logTime:'Log Time' logTime:'Log Time'
}, },

View File

@@ -525,9 +525,9 @@ export default {
neType: '网元类型', neType: '网元类型',
neTypePlease: "请选择网元类型", neTypePlease: "请选择网元类型",
neTypeTip: '填写创建的网元类型,如:SMF', neTypeTip: '填写创建的网元类型,如:SMF',
neId: '网元标识', neUid: '网元标识',
neIdPlease: '请输入网元标识', neUidPlease: '请输入网元标识',
neIdTip: '填写网元绑定的唯一标识', neUidTip: '填写网元绑定的唯一标识',
rmUid: '资源唯一标识', rmUid: '资源唯一标识',
rmUidPlease: '请输入资源唯一标识', rmUidPlease: '请输入资源唯一标识',
rmUidTip: "用于网元日志、告警、指标等数据上报的标记", rmUidTip: "用于网元日志、告警、指标等数据上报的标记",
@@ -539,6 +539,8 @@ export default {
port: '服务端口', port: '服务端口',
portTip: "网元服务端口,默认:33030", portTip: "网元服务端口,默认:33030",
capability: '容量', capability: '容量',
ueNumber: '用户数',
nbNumber: '基站数',
serialNum: '序列号', serialNum: '序列号',
expiryDate: '许可证到期日期', expiryDate: '许可证到期日期',
normalcy: '正常', normalcy: '正常',
@@ -565,11 +567,11 @@ export default {
sysDisk: "系统存储", sysDisk: "系统存储",
neCpu: "网元CPU", neCpu: "网元CPU",
hostConfig: "终端连接配置", hostConfig: "终端连接配置",
pvflag: '网元虚拟化标识', pvflag: '虚拟化标识',
pnf: '物理网元', pnf: '物理网元',
vnf: '虚拟网元', vnf: '虚拟网元',
neAddress: '物理地址(MAC)', macAddr: '物理地址(MAC)',
neAddressTip: '记录网元的网卡物理地址(MAC)', macAddrTip: '记录网元的网卡物理地址(MAC)',
dn: '网络标识', dn: '网络标识',
vendorName: '提供厂商', vendorName: '提供厂商',
province: '服务地域', province: '服务地域',
@@ -1291,8 +1293,6 @@ export default {
mml:{ mml:{
account:'登录账号', account:'登录账号',
ip:'IP地址', ip:'IP地址',
type:'网元类型',
neId:'网元唯一标识',
MML:'MML', MML:'MML',
logTime:'记录时间' logTime:'记录时间'
}, },

View File

@@ -270,6 +270,7 @@ onUnmounted(() => {
v-bind="proConfig" v-bind="proConfig"
:iconfont-url="scriptUrl" :iconfont-url="scriptUrl"
:locale="fnLocale" :locale="fnLocale"
:sider-width="256"
> >
<!--插槽-菜单头--> <!--插槽-菜单头-->
<template #menuHeaderRender> <template #menuHeaderRender>

View File

@@ -19,7 +19,7 @@ const router = useRouter();
/**告警数按钮提示跳转 */ /**告警数按钮提示跳转 */
function fnClickAlarm() { function fnClickAlarm() {
router.push({ name: 'ActiveAlarm_2088' }); router.push({ name: 'Active_2088' });
} }
/**改变主题色 */ /**改变主题色 */

View File

@@ -1,246 +0,0 @@
<script setup lang="ts">
import svgLight from '@/assets/svg/light.svg';
import svgDark from '@/assets/svg/dark.svg';
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
import { viewTransitionTheme } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal';
import { ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useFullscreen } from '@vueuse/core';
import { hasPermissions } from '@/plugins/auth-user';
import useI18n from '@/hooks/useI18n';
import useLayoutStore from '@/store/modules/layout';
import useAppStore from '@/store/modules/app';
import useUserStore from '@/store/modules/user';
import useAlarmStore from '@/store/modules/alarm';
import useMaskStore from '@/store/modules/mask';
const { isFullscreen, toggle } = useFullscreen();
const { t, changeLocale, optionsLocale } = useI18n();
const layoutStore = useLayoutStore();
const maskStore = useMaskStore();
const userStore = useUserStore();
const appStore = useAppStore();
const route = useRoute();
const router = useRouter();
/**头像展开项点击 */
function fnClick({ key }: MenuInfo) {
switch (key) {
case 'settings':
router.push({ name: 'Settings' });
break;
case 'profile':
router.push({ name: 'Profile' });
break;
case 'logout':
userStore.fnLogOut().finally(() => router.push({ name: 'Login' }));
break;
}
}
/**锁屏确认 */
const lockConfirm = ref<boolean>(false);
/**锁屏密码 */
const lockPasswd = ref<string>('');
/**锁屏按钮提示 */
function fnClickLock() {
lockConfirm.value = true;
lockPasswd.value = '';
maskStore.lockPasswd = '';
}
/**锁屏确认跳转锁屏页面 */
function fnClickLockToPage() {
lockConfirm.value = false;
maskStore.lockPasswd = lockPasswd.value;
maskStore.handleMaskType('lock');
router.push({ name: 'LockScreen', query: { redirect: route.path } });
}
/**告警数按钮提示跳转 */
function fnClickAlarm() {
router.push({ name: 'ActiveAlarm_2088' });
}
/**改变主题色 */
function fnClickTheme(e: any) {
viewTransitionTheme(isDarkMode => {
layoutStore.changeConf('theme', isDarkMode ? 'light' : 'dark');
}, e);
}
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
}
</script>
<template>
<a-space :size="12" align="center">
<a-tooltip placement="bottomRight">
<template #title>{{ t('loayouts.rightContent.alarm') }}</template>
<a-button
type="text"
style="color: inherit"
@click="fnClickAlarm"
v-perms:has="['faultManage:active-alarm:index']"
>
<template #icon>
<a-badge
:count="useAlarmStore().activeAlarmTotal"
:overflow-count="99"
status="warning"
style="color: inherit"
>
<BellOutlined />
</a-badge>
</template>
</a-button>
</a-tooltip>
<!-- 锁屏操作 -->
<span v-perms:has="['system:setting:lock']">
<a-tooltip placement="bottomRight">
<template #title>{{ t('loayouts.rightContent.lock') }}</template>
<a-button type="text" style="color: inherit" @click="fnClickLock()">
<template #icon>
<LockOutlined />
</template>
</a-button>
<ProModal
:drag="true"
:center-y="true"
:width="400"
:minHeight="200"
:mask-closable="false"
v-model:open="lockConfirm"
:title="t('loayouts.rightContent.lockTip')"
@ok="fnClickLockToPage()"
>
<a-space>
{{ t('loayouts.rightContent.lockPasswd') }}
<a-input-password
v-model:value="lockPasswd"
:placeholder="t('common.inputPlease')"
>
<template #prefix>
<a-tooltip
:title="t('loayouts.rightContent.lockPasswdTip')"
placement="topLeft"
>
<UnlockOutlined />
</a-tooltip>
</template>
</a-input-password>
</a-space>
</ProModal>
</a-tooltip>
</span>
<a-tooltip placement="bottomRight">
<template #title>{{ t('loayouts.rightContent.fullscreen') }}</template>
<a-button type="text" style="color: inherit" @click="toggle">
<template #icon>
<FullscreenExitOutlined v-if="isFullscreen" />
<FullscreenOutlined v-else />
</template>
</a-button>
</a-tooltip>
<a-tooltip placement="bottomRight">
<template #title>{{ t('loayouts.rightContent.theme') }}</template>
<a-button type="text" @click="fnClickTheme">
<template #icon>
<img
v-if="layoutStore.proConfig.theme === 'dark'"
:src="svgDark"
class="theme-icon"
/>
<img v-else :src="svgLight" class="theme-icon" />
</template>
</a-button>
</a-tooltip>
<a-dropdown
placement="bottomRight"
trigger="click"
v-if="appStore.i18nOpen && hasPermissions(['system:setting:i18n'])"
>
<a-button type="text" style="color: inherit">
<template #icon> <TranslationOutlined /> </template>
</a-button>
<template #overlay>
<a-menu @click="fnChangeLocale">
<a-menu-item v-for="opt in optionsLocale" :key="opt.value">
{{ opt.label }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-dropdown placement="bottomRight" trigger="click">
<div class="user">
<a-avatar
shape="circle"
size="default"
:src="userStore.getAvatar"
:alt="userStore.userName"
></a-avatar>
<span class="nick">
{{ userStore.nickName }}
</span>
</div>
<template #overlay>
<a-menu @click="fnClick">
<!-- <a-menu-item key="profile">
<template #icon>
<UserOutlined />
</template>
<span>{{ t('loayouts.rightContent.profile') }}</span>
</a-menu-item> -->
<a-menu-item key="settings">
<template #icon>
<SettingOutlined />
</template>
<span>{{ t('loayouts.rightContent.settings') }}</span>
</a-menu-item>
<a-menu-divider />
<a-menu-item key="logout">
<template #icon>
<LogoutOutlined />
</template>
<span>{{ t('loayouts.rightContent.logout') }}</span>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</a-space>
</template>
<style lang="less" scoped>
.user {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
cursor: pointer;
.nick {
padding-left: 8px;
padding-right: 16px;
font-size: 16px;
max-width: 164px;
white-space: nowrap;
text-align: start;
text-overflow: ellipsis;
overflow: hidden;
}
}
.theme-icon {
width: 18px;
height: 18px;
margin-bottom: 4px;
color: inherit;
}
</style>

View File

@@ -59,7 +59,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/trace-task-hlr', path: '/trace-task-hlr',
name: 'TraceTaskHLR', // 跟踪任务HLR name: 'TraceTaskHLR', // 跟踪任务HLR
meta: { title: 'router.traceTaskHLR', neType: ['UDM', 'HLR'] }, meta: { title: 'router.traceTaskHLR', neType: ['UDM', 'HLR'] },
component: () => import('@/views/traceManage/task-hlr/index.vue'), component: () => import('@/views/ne/trace/task-hlr/index.vue'),
}, },
{ {
path: '/quick-start', path: '/quick-start',

View File

@@ -1,5 +1,6 @@
import { getActiveAlarmTotal } from '@/api/faultManage/actAlarm'; import { getActiveAlarmTotal } from '@/api/faultManage/actAlarm';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
/**告警数据信息类型 */ /**告警数据信息类型 */
@@ -15,8 +16,8 @@ const useAlarmStore = defineStore('alarm', {
getters: {}, getters: {},
actions: { actions: {
// 获取活动告警数 // 获取活动告警数
async fnGetActiveAlarmInfo() { async fnGetActiveAlarmInfo() {
const res = await getActiveAlarmTotal(); const res = await getActiveAlarmTotal(currentCoreUid());
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
this.activeAlarmTotal = res.data; this.activeAlarmTotal = res.data;
} }

View File

@@ -4,8 +4,15 @@ import {
} from '@/constants/result-constants'; } from '@/constants/result-constants';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { listAllCoreInfo } from '@/api/core/coreInfo'; import { listAllCoreInfo } from '@/api/core/coreInfo';
import { localGetJSON, localSetJSON } from '@/utils/cache-local-utils'; import {
import { CACHE_SESSION_CORE } from '@/constants/cache-keys-constants'; sessionGetJSON,
sessionSet,
sessionSetJSON,
} from '@/utils/cache-session-utils';
import {
CACHE_SESSION_CORE,
CACHE_SESSION_CORE_UID,
} from '@/constants/cache-keys-constants';
/**核心网信息类型 */ /**核心网信息类型 */
type Core = { type Core = {
@@ -20,10 +27,7 @@ type Core = {
const useCoreStore = defineStore('core', { const useCoreStore = defineStore('core', {
state: (): Core => ({ state: (): Core => ({
coreList: [], coreList: [],
current: localGetJSON(CACHE_SESSION_CORE) || { current: sessionGetJSON(CACHE_SESSION_CORE),
label: 'Global',
value: 'all',
},
coreSelectOtions: [], coreSelectOtions: [],
}), }),
getters: { getters: {
@@ -32,9 +36,10 @@ const useCoreStore = defineStore('core', {
}, },
}, },
actions: { actions: {
setCurrent(value: Record<string, any> = {}) { setCurrent(v: Record<string, any> = {}) {
this.current = value; this.current = v;
localSetJSON(CACHE_SESSION_CORE, value); sessionSetJSON(CACHE_SESSION_CORE, v);
sessionSet(CACHE_SESSION_CORE_UID, v.value);
}, },
// 刷新核心网列表 // 刷新核心网列表
async fnCorelistRefresh() { async fnCorelistRefresh() {
@@ -64,6 +69,13 @@ const useCoreStore = defineStore('core', {
}; };
}); });
} }
// 当前未选择时
if (!this.current) {
this.setCurrent({
label: 'Global',
value: 'YYMMDDHH',
});
}
return res; return res;
}, },
}, },

View File

@@ -70,9 +70,9 @@ const proRender = (render: any) => (render === false ? false : undefined);
const proConfigLocal: LayoutStore['proConfig'] = localGetJSON( const proConfigLocal: LayoutStore['proConfig'] = localGetJSON(
CACHE_LOCAL_PROCONFIG CACHE_LOCAL_PROCONFIG
) || { ) || {
layout: 'mix', layout: 'side',
theme: 'light', theme: 'light',
menuTheme: 'light', menuTheme: 'dark',
fixSiderbar: true, fixSiderbar: true,
fixedHeader: true, fixedHeader: true,
splitMenus: true, splitMenus: true,

View File

@@ -5,6 +5,7 @@ import {
} from '@/constants/result-constants'; } from '@/constants/result-constants';
import { listAllNeInfo } from '@/api/ne/neInfo'; import { listAllNeInfo } from '@/api/ne/neInfo';
import { parseDataToOptions } from '@/utils/parse-tree-utils'; import { parseDataToOptions } from '@/utils/parse-tree-utils';
import { currentCoreUid } from '@/hooks/useCoreUid';
/**网元信息类型 */ /**网元信息类型 */
type Ne = { type Ne = {
@@ -65,6 +66,7 @@ const useNeStore = defineStore('ne', {
}; };
} }
const res = await listAllNeInfo({ const res = await listAllNeInfo({
coreUid: currentCoreUid(),
bandStatus: false, bandStatus: false,
bandHost: false, bandHost: false,
}); });
@@ -77,7 +79,7 @@ const useNeStore = defineStore('ne', {
res.data, res.data,
'neType', 'neType',
'neName', 'neName',
'neId' 'neUid'
); );
this.neCascaderOptions = options; this.neCascaderOptions = options;

View File

@@ -177,25 +177,6 @@ export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any {
return [(realBit / 1000 / 1000).toFixed(2), ' Mbits/sec']; return [(realBit / 1000 / 1000).toFixed(2), ' Mbits/sec'];
} }
/**
* 位数据转换单位
* @param bits 位Bit大小 64009540 = 512.08 MB
* @returns xx B / KB / MB / GB / TB / PB / EB / ZB / YB
*/
export function parseSizeFromBits(bits: number | string): string {
bits = Number(bits) || 0;
if (bits <= 0) return '0 B';
bits = bits * 8;
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const unitIndex = Math.floor(Math.log2(bits) / 10);
const value = bits / Math.pow(1000, unitIndex);
const unti = units[unitIndex];
if (unitIndex > 0) {
return `${value.toFixed(2)} ${unti}`;
}
return `${value} ${unti}`;
}
/** /**
* 字节数转换单位 * 字节数转换单位
* @param byte 字节Byte大小 64009540 = 512.08 MB * @param byte 字节Byte大小 64009540 = 512.08 MB

View File

@@ -26,6 +26,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { readLoalXlsx } from '@/utils/execl-utils'; import { readLoalXlsx } from '@/utils/execl-utils';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import dayjs, { type Dayjs } from 'dayjs'; import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore(); const neStore = useNeStore();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const { t, currentLocale } = useI18n(); const { t, currentLocale } = useI18n();
@@ -70,27 +71,23 @@ let rangePickerPresets = ref([
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
alarmStatus: 'Active', alarmStatus: 'Active',
sortField: 'event_time', sortField: 'event_time',
sortOrder: 'desc', sortOrder: 'desc',
/**告警设备类型 */ /**告警设备类型 */
neType: '', neType: '',
/**告警网元名称 */
neName: '',
/**告警网元标识 */
neId: '',
/**告警编号 */ /**告警编号 */
alarmCode: '', alarmCode: '',
/**告警级别 */ /**告警级别 */
origSeverity: undefined, origSeverity: undefined,
/**告警类型 */
alarmType: undefined,
/**告警产生时间开始时间 */ /**告警产生时间开始时间 */
beginTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**告警产生时间结束时间 */ /**告警产生时间结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**虚拟化标识 */
pvFlag: undefined,
/**告警类型 */
alarmType: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -105,22 +102,19 @@ function fnQueryReset() {
alarmStatus: 'Active', alarmStatus: 'Active',
/**告警设备类型 */ /**告警设备类型 */
neType: '', neType: '',
/**告警网元名称 */
neName: '',
/**告警网元标识 */
neId: '',
/**告警编号 */ /**告警编号 */
alarmCode: '', alarmCode: '',
/**告警级别 */ /**告警级别 */
origSeverity: undefined, origSeverity: undefined,
/**告警类型 */
alarmType: undefined,
/**告警产生时间 */ /**告警产生时间 */
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
/**虚拟化标识 */
pvFlag: undefined,
/**告警类型 */
alarmType: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
}); });
queryRangePicker.value = undefined; queryRangePicker.value = undefined;
tablePagination.current = 1; tablePagination.current = 1;
@@ -140,6 +134,8 @@ type TabeStateType = {
data: object[]; data: object[];
/**勾选记录 */ /**勾选记录 */
selectedRowKeys: (string | number)[]; selectedRowKeys: (string | number)[];
/**勾选记录 */
selectedRows: Record<string, any>[];
}; };
/**表格状态 */ /**表格状态 */
@@ -149,6 +145,7 @@ let tableState: TabeStateType = reactive({
seached: false, seached: false,
data: [], data: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [],
}); });
/**过滤设置 */ /**过滤设置 */
@@ -164,6 +161,7 @@ let alarmTableState: TabeStateType = reactive({
seached: true, seached: true,
data: [], data: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [],
}); });
/**表格字段列 */ /**表格字段列 */
@@ -221,18 +219,6 @@ let tableColumns: ColumnsType = [
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neName'),
dataIndex: 'neName',
align: 'left',
width: 100,
},
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'id', key: 'id',
@@ -375,7 +361,6 @@ let modalState: ModalStateType = reactive({
from: { from: {
alarmId: '', alarmId: '',
alarmSeq: '', alarmSeq: '',
neId: '',
neName: '', neName: '',
neType: '', neType: '',
alarmCode: '', alarmCode: '',
@@ -455,7 +440,11 @@ function fnModalOk() {
return false; return false;
} }
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
ackAlarm([from.id], true) ackAlarm({
id: from.id,
coreUid: from.coreUid,
ackState: true,
})
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -506,25 +495,20 @@ function fnShowModalOk() {
modalState.confirmLoading = false; modalState.confirmLoading = false;
}); });
} }
/**表格状态 */
const state = reactive<{
selectedRowKeys: (string | number)[];
selectedRow: Record<string, any>;
loading: boolean;
}>({
selectedRowKeys: [], // Check here to configure the default column
selectedRow: {},
loading: false,
});
/**监听多选 */ /**表格多选 */
const onSelectChange = ( function fnTableSelectedRowKeys(keys: (string | number)[], rows: any[]) {
keys: (string | number)[], tableState.selectedRowKeys = keys;
record: Record<string, any> tableState.selectedRows = rows.map(item => {
) => { return {
state.selectedRowKeys = keys; id: item.id,
state.selectedRow = record; coreUid: item.coreUid,
}; neUid: item.neUid,
neType: item.neType,
};
});
console.log( tableState.selectedRows)
}
/** /**
* 选中行后的取消确认告警 * 选中行后的取消确认告警
@@ -535,22 +519,34 @@ function fnCancelConfirm() {
content: t('views.faultManage.activeAlarm.cancelSure'), content: t('views.faultManage.activeAlarm.cancelSure'),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const ids = state.selectedRowKeys.map(v => Number(v)); let reqArr: any = [];
ackAlarm(ids, false).then(res => { tableState.selectedRows.forEach(item => {
hide(); reqArr.push(
if (res.code === RESULT_CODE_SUCCESS) { ackAlarm({
message.success({ id: item.id,
content: t('views.faultManage.activeAlarm.cancelSuss'), coreUid: item.coreUid,
duration: 2, ackState: false,
}); })
fnGetList(); );
} else {
message.error({
content: `${res.msg}`,
duration: 2,
});
}
}); });
Promise.all(reqArr)
.then(resArr => {
if (resArr.every((item: any) => item.code === RESULT_CODE_SUCCESS)) {
message.success({
content: t('views.faultManage.activeAlarm.cancelSuss'),
duration: 2,
});
fnGetList();
} else {
message.error({
content: t('common.operateErr'),
duration: 2,
});
}
})
.finally(() => {
hide();
});
}, },
}); });
} }
@@ -560,22 +556,24 @@ function fnCancelConfirm() {
*/ */
function fnSync() { function fnSync() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
listSync().then(res => { listSync()
if (res.code === RESULT_CODE_SUCCESS) { .then(res => {
message.success({ if (res.code === RESULT_CODE_SUCCESS) {
content: t('views.faultManage.activeAlarm.sysncSuss'), message.success({
duration: 2, content: t('views.faultManage.activeAlarm.sysncSuss'),
}); duration: 2,
fnGetList(); });
} else { fnGetList();
message.error({ } else {
content: `${res.msg}`, message.error({
duration: 2, content: `${res.msg}`,
}); duration: 2,
} });
}).finally(()=>{ }
hide(); })
}); .finally(() => {
hide();
});
} }
/** /**
@@ -587,22 +585,28 @@ function fnClear() {
content: t('views.faultManage.activeAlarm.delSure'), content: t('views.faultManage.activeAlarm.delSure'),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const ids = state.selectedRowKeys.map(v => Number(v)); let reqArr: any = [];
clearAlarm(ids).then(res => { tableState.selectedRows.forEach(item => {
hide(); reqArr.push(clearAlarm(item.id, item.coreUid));
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.faultManage.activeAlarm.delSuss'),
duration: 2,
});
fnGetList();
} else {
message.error({
content: `${res.msg}`,
duration: 2,
});
}
}); });
Promise.all(reqArr)
.then(resArr => {
if (resArr.every((item: any) => item.code === RESULT_CODE_SUCCESS)) {
message.success({
content: t('views.faultManage.activeAlarm.delSuss'),
duration: 2,
});
fnGetList();
} else {
message.error({
content: t('common.operateErr'),
duration: 2,
});
}
})
.finally(() => {
hide();
});
}, },
}); });
} }
@@ -799,8 +803,8 @@ function fnGetList(pageNum?: number) {
listAct(form).then((res: any) => { listAct(form).then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
// //
if (state.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
state.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
const { total, rows } = res.data; const { total, rows } = res.data;
tablePagination.total = total; tablePagination.total = total;
@@ -890,6 +894,7 @@ onMounted(() => {
v-model:value="queryParams.alarmType" v-model:value="queryParams.alarmType"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
:options="dict.activeAlarmType" :options="dict.activeAlarmType"
allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -948,7 +953,7 @@ onMounted(() => {
<a-button <a-button
type="primary" type="primary"
@click.prevent="fnCancelConfirm()" @click.prevent="fnCancelConfirm()"
:disabled="state.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
v-if="false" v-if="false"
> >
<template #icon> <template #icon>
@@ -973,7 +978,7 @@ onMounted(() => {
type="primary" type="primary"
danger danger
@click.prevent="fnClear()" @click.prevent="fnClear()"
:disabled="state.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
@@ -1049,8 +1054,8 @@ onMounted(() => {
:row-selection="{ :row-selection="{
type: 'checkbox', type: 'checkbox',
columnWidth: '48px', columnWidth: '48px',
selectedRowKeys: state.selectedRowKeys, selectedRowKeys: tableState.selectedRowKeys,
onChange: onSelectChange, onChange: fnTableSelectedRowKeys,
}" }"
:pagination="tablePagination" :pagination="tablePagination"
:scroll="{ x: tableColumns.length * 150, y: 'calc(100vh - 480px)' }" :scroll="{ x: tableColumns.length * 150, y: 'calc(100vh - 480px)' }"
@@ -1183,22 +1188,18 @@ onMounted(() => {
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neType')" name="neType"> <a-form-item :label="t('views.ne.common.neType')" name="neType">
{{ modalState.from.neType }} {{ modalState.from.neType }}&nbsp;({{ modalState.from.neUid }})
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neId')" name="neId"> <a-form-item
{{ modalState.from.neId }} :label="t('views.faultManage.activeAlarm.origLevel')"
</a-form-item> name="origSeverity"
</a-col> >
<a-col :lg="12" :md="12" :xs="24"> <DictTag
<a-form-item :label="t('views.ne.common.neName')" name="neName"> :options="dict.activeAlarmSeverity"
{{ modalState.from.neName }} :value="modalState.from.origSeverity"
</a-form-item> />
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neInfo.pvflag')" name="pvFlag">
{{ modalState.from.pvFlag }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -1252,30 +1253,6 @@ onMounted(() => {
{{ modalState.from.locationInfo }} {{ modalState.from.locationInfo }}
</a-form-item> </a-form-item>
<a-row> </a-row>
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.province')"
name="province"
>
{{ modalState.from.province }}
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.origLevel')"
name="origSeverity"
>
<DictTag
:options="dict.activeAlarmSeverity"
:value="modalState.from.origSeverity"
/>
</a-form-item>
</a-col>
</a-row>
<a-form-item <a-form-item
:label="t('views.faultManage.activeAlarm.addInfo')" :label="t('views.faultManage.activeAlarm.addInfo')"
name="addInfo" name="addInfo"

View File

@@ -15,6 +15,7 @@ import { writeSheet } from '@/utils/execl-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import dayjs, { type Dayjs } from 'dayjs'; import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore(); const neStore = useNeStore();
const { t } = useI18n(); const { t } = useI18n();
@@ -41,26 +42,22 @@ let rangePickerPresets = ref([
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
sortField: 'event_time', sortField: 'event_time',
sortOrder: 'desc', sortOrder: 'desc',
/**告警设备类型 */ /**告警设备类型 */
neType: '', neType: '',
/**告警网元名称 */
neName: '',
/**告警网元标识 */
neId: '',
/**告警编号 */ /**告警编号 */
alarmCode: '', alarmCode: '',
/**告警级别 */ /**告警级别 */
origSeverity: undefined, origSeverity: undefined,
/**告警类型 */
alarmType: undefined,
/**告警产生时间开始时间 */ /**告警产生时间开始时间 */
beginTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**告警产生时间结束时间 */ /**告警产生时间结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**虚拟化标识 */
pvFlag: undefined,
/**告警类型 */
alarmType: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -72,22 +69,19 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
/**告警设备类型 */ /**告警设备类型 */
neType: '', neType: '',
/**告警网元名称 */
neName: '',
/**告警网元标识 */
neId: '',
/**告警编号 */ /**告警编号 */
alarmCode: '', alarmCode: '',
/**告警级别 */ /**告警级别 */
origSeverity: undefined, origSeverity: undefined,
/**告警类型 */
alarmType: undefined,
/**告警产生时间 */ /**告警产生时间 */
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
/**虚拟化标识 */
pvFlag: undefined,
/**告警类型 */
alarmType: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
}); });
queryRangePicker.value = undefined; queryRangePicker.value = undefined;
tablePagination.current = 1; tablePagination.current = 1;
@@ -159,12 +153,6 @@ let tableColumns: ColumnsType = [
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'id', key: 'id',
@@ -237,7 +225,6 @@ let modalState: ModalStateType = reactive({
from: { from: {
alarmId: '', alarmId: '',
alarmSeq: '', alarmSeq: '',
neId: '',
neName: '', neName: '',
neType: '', neType: '',
alarmCode: '', alarmCode: '',
@@ -449,7 +436,7 @@ onMounted(() => {
<!-- 表格搜索栏 --> <!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal"> <a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="4" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neType')" name="neType"> <a-form-item :label="t('views.ne.common.neType')" name="neType">
<a-auto-complete <a-auto-complete
v-model:value="queryParams.neType" v-model:value="queryParams.neType"
@@ -643,6 +630,11 @@ onMounted(() => {
</a-row> </a-row>
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neType')" name="neType">
{{ modalState.from.neType }}&nbsp;({{ modalState.from.neUid }})
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.faultManage.activeAlarm.alarmCode')" :label="t('views.faultManage.activeAlarm.alarmCode')"
@@ -653,19 +645,6 @@ onMounted(() => {
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neType')" name="neType">
{{ modalState.from.neType }}
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neId')" name="neId">
{{ modalState.from.neId }}
</a-form-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item

View File

@@ -11,6 +11,7 @@ import useNeStore from '@/store/modules/ne';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import dayjs, { type Dayjs } from 'dayjs'; import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const { t } = useI18n(); const { t } = useI18n();
const neStore = useNeStore(); const neStore = useNeStore();
@@ -48,6 +49,8 @@ let rangePickerPresets = ref([
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */ /**网元类型 */
neType: '', neType: '',
sortField: 'event_time', sortField: 'event_time',
@@ -130,12 +133,6 @@ let tableColumns: ColumnsType = reactive([
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{ {
title: t('views.logManage.forwarding.alarmId'), title: t('views.logManage.forwarding.alarmId'),
dataIndex: 'alarmId', dataIndex: 'alarmId',
@@ -308,7 +305,7 @@ onMounted(() => {
<!-- 表格搜索栏 --> <!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal"> <a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="4" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neType')" name="neType"> <a-form-item :label="t('views.ne.common.neType')" name="neType">
<a-auto-complete <a-auto-complete
v-model:value="queryParams.neType" v-model:value="queryParams.neType"

View File

@@ -20,6 +20,7 @@ import { writeSheet } from '@/utils/execl-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import dayjs, { type Dayjs } from 'dayjs'; import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore(); const neStore = useNeStore();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const { t } = useI18n(); const { t } = useI18n();
@@ -61,27 +62,23 @@ let rangePickerPresets = ref([
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
alarmStatus: 'Clear', alarmStatus: 'Clear',
sortField: 'event_time', sortField: 'event_time',
sortOrder: 'desc', sortOrder: 'desc',
/**告警设备类型 */ /**告警设备类型 */
neType: '', neType: '',
/**告警网元名称 */
neName: '',
/**告警网元标识 */
neId: '',
/**告警编号 */ /**告警编号 */
alarmCode: '', alarmCode: '',
/**告警级别 */ /**告警级别 */
origSeverity: undefined, origSeverity: undefined,
/**告警类型 */
alarmType: undefined,
/**告警产生时间开始时间 */ /**告警产生时间开始时间 */
beginTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**告警产生时间结束时间 */ /**告警产生时间结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**虚拟化标识 */
pvFlag: undefined,
/**告警类型 */
alarmType: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -94,22 +91,19 @@ function fnQueryReset() {
alarmStatus: 'Clear', alarmStatus: 'Clear',
/**告警设备类型 */ /**告警设备类型 */
neType: '', neType: '',
/**告警网元名称 */
neName: '',
/**告警网元标识 */
neId: '',
/**告警编号 */ /**告警编号 */
alarmCode: '', alarmCode: '',
/**告警级别 */ /**告警级别 */
origSeverity: undefined, origSeverity: undefined,
/**告警类型 */
alarmType: undefined,
/**告警产生时间 */ /**告警产生时间 */
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
/**虚拟化标识 */
pvFlag: undefined,
/**告警类型 */
alarmType: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
}); });
queryRangePicker.value = undefined; queryRangePicker.value = undefined;
tablePagination.current = 1; tablePagination.current = 1;
@@ -194,18 +188,6 @@ let tableColumns = ref<ColumnsType>([
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neName'),
dataIndex: 'neName',
align: 'left',
width: 100,
},
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{ {
title: t('views.faultManage.activeAlarm.clearUser'), title: t('views.faultManage.activeAlarm.clearUser'),
dataIndex: 'clearUser', dataIndex: 'clearUser',
@@ -306,7 +288,6 @@ let modalState: ModalStateType = reactive({
from: { from: {
alarmId: '', alarmId: '',
alarmSeq: '', alarmSeq: '',
neId: '',
neName: '', neName: '',
neType: '', neType: '',
alarmCode: '', alarmCode: '',
@@ -689,6 +670,7 @@ onMounted(() => {
v-model:value="queryParams.alarmType" v-model:value="queryParams.alarmType"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
:options="dict.activeAlarmType" :options="dict.activeAlarmType"
allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -919,22 +901,18 @@ onMounted(() => {
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neType')" name="neType"> <a-form-item :label="t('views.ne.common.neType')" name="neType">
{{ modalState.from.neType }} {{ modalState.from.neType }}&nbsp;({{ modalState.from.neUid }})
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neId')" name="neId"> <a-form-item
{{ modalState.from.neId }} :label="t('views.faultManage.activeAlarm.origLevel')"
</a-form-item> name="origSeverity"
</a-col> >
<a-col :lg="12" :md="12" :xs="24"> <DictTag
<a-form-item :label="t('views.ne.common.neName')" name="neName"> :options="dict.activeAlarmSeverity"
{{ modalState.from.neName }} :value="modalState.from.origSeverity"
</a-form-item> />
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neInfo.pvflag')" name="pvFlag">
{{ modalState.from.pvFlag }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -987,27 +965,6 @@ onMounted(() => {
> >
{{ modalState.from.locationInfo }} {{ modalState.from.locationInfo }}
</a-form-item> </a-form-item>
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.province')"
name="province"
>
{{ modalState.from.province }}
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.origLevel')"
name="origSeverity"
>
<DictTag
:options="dict.activeAlarmSeverity"
:value="modalState.from.origSeverity"
/>
</a-form-item>
</a-col>
</a-row>
<a-form-item <a-form-item
:label="t('views.faultManage.activeAlarm.addInfo')" :label="t('views.faultManage.activeAlarm.addInfo')"

View File

@@ -11,6 +11,7 @@ import useNeStore from '@/store/modules/ne';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import dayjs, { type Dayjs } from 'dayjs'; import dayjs, { type Dayjs } from 'dayjs';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore(); const neStore = useNeStore();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const { t } = useI18n(); const { t } = useI18n();
@@ -48,6 +49,8 @@ let rangePickerPresets = ref([
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */ /**网元类型 */
neType: '', neType: '',
/**告警状态 */ /**告警状态 */
@@ -116,17 +119,11 @@ let tableColumns: ColumnsType = [
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{ {
title: t('views.logManage.alarm.alarmId'), title: t('views.logManage.alarm.alarmId'),
dataIndex: 'alarmId', dataIndex: 'alarmId',
align: 'left', align: 'left',
width: 120, width: 200,
}, },
{ {
title: t('views.logManage.alarm.alarmSeq'), title: t('views.logManage.alarm.alarmSeq'),
@@ -173,16 +170,17 @@ let tableColumns: ColumnsType = [
title: t('views.logManage.alarm.eventTime'), title: t('views.logManage.alarm.eventTime'),
dataIndex: 'eventTime', dataIndex: 'eventTime',
align: 'left', align: 'left',
width: 200,
customRender(opt) { customRender(opt) {
if (!opt.value) return ''; if (!opt.value) return '';
return parseDateToStr(+opt.value); return parseDateToStr(+opt.value);
}, },
width: 200,
}, },
{ {
title: t('views.logManage.alarm.logTime'), title: t('views.logManage.alarm.logTime'),
dataIndex: 'createdAt', dataIndex: 'createdAt',
align: 'left', align: 'left',
width: 200,
customRender(opt) { customRender(opt) {
if (!opt.value) return ''; if (!opt.value) return '';
return parseDateToStr(+opt.value); return parseDateToStr(+opt.value);

View File

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 257 KiB

View File

@@ -21,6 +21,7 @@ import { origGet } from '@/api/faultManage/actAlarm';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { useFullscreen } from '@vueuse/core'; import { useFullscreen } from '@vueuse/core';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
@@ -35,7 +36,7 @@ const trendRange = ref('1'); // '1':今天,'7'7天'30'30天
const loading = ref(false); const loading = ref(false);
// //
let refreshTimer: number | null = null; let refreshTimer: any = null;
// //
const allLatestAlarmsAct: any = ref([]); const allLatestAlarmsAct: any = ref([]);
@@ -181,7 +182,7 @@ async function fetchLatestAlarmsHis() {
allLatestAlarmsHis.value.map((alarm: any) => alarm.alarmId) allLatestAlarmsHis.value.map((alarm: any) => alarm.alarmId)
); );
// //
res.rows.forEach((alarm:any) => { res.rows.forEach((alarm: any) => {
if (!currentIds.has(alarm.alarmId)) { if (!currentIds.has(alarm.alarmId)) {
console.log('新历史告警:', alarm.alarmId, alarm.alarmTitle); console.log('新历史告警:', alarm.alarmId, alarm.alarmTitle);
newHistoryAlarms.value.add(alarm.alarmId); newHistoryAlarms.value.add(alarm.alarmId);
@@ -205,7 +206,7 @@ async function fetchLatestAlarmsHis() {
async function fetchAlarmData() { async function fetchAlarmData() {
try { try {
loading.value = true; loading.value = true;
const res = await origGet(); const res = await origGet(currentCoreUid());
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
// //
alarmData.critical = 0; alarmData.critical = 0;
@@ -322,7 +323,7 @@ onMounted(() => {
fetchAlarmTrend(); // fetchAlarmTrend(); //
// - 10 // - 10
refreshTimer = window.setInterval(() => { refreshTimer = setInterval(() => {
fetchAlarmData(); fetchAlarmData();
fetchAlarmTrend(); // fetchAlarmTrend(); //
}, 10000); }, 10000);
@@ -492,10 +493,8 @@ onBeforeUnmount(() => {
window.removeEventListener('resize', handleResize); window.removeEventListener('resize', handleResize);
// //
if (refreshTimer !== null) { clearInterval(refreshTimer);
clearInterval(refreshTimer); refreshTimer = null;
refreshTimer = null;
}
// //
trendChartInstance?.dispose(); trendChartInstance?.dispose();

View File

@@ -408,6 +408,7 @@ function fnExportList() {
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.dashboard.cdr.exportTip'), content: t('views.dashboard.cdr.exportTip'),
onOk() { onOk() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams); const querys = toRaw(queryParams);
querys.pageSize = 10000; querys.pageSize = 10000;

View File

@@ -378,6 +378,7 @@ function fnExportList() {
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.dashboard.cdr.exportTip'), content: t('views.dashboard.cdr.exportTip'),
onOk() { onOk() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams); const querys = toRaw(queryParams);
querys.pageSize = 10000; querys.pageSize = 10000;

View File

@@ -405,6 +405,7 @@ function fnExportList() {
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.dashboard.cdr.exportTip'), content: t('views.dashboard.cdr.exportTip'),
onOk() { onOk() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams); const querys = toRaw(queryParams);
querys.pageSize = 10000; querys.pageSize = 10000;

View File

@@ -372,6 +372,7 @@ function fnExportList() {
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.dashboard.cdr.exportTip'), content: t('views.dashboard.cdr.exportTip'),
onOk() { onOk() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams); const querys = toRaw(queryParams);
querys.pageSize = 10000; querys.pageSize = 10000;

View File

@@ -1,11 +0,0 @@
<script lang="ts" setup>
import { ref } from 'vue';
const msg = ref<string>('愿这世间美好与你环环相扣');
</script>
<template>
<h1>{{ msg }}</h1>
</template>
<style lang="less" scoped></style>

View File

@@ -35,7 +35,7 @@ function findView(dirName: string): () => Promise<Component> {
return views[dir]; return views[dir];
} }
} }
return () => import('@/views/configManage/neOverview/index.vue'); return () => import('@/views/ne/neOverview/index.vue');
} }
onMounted(() => { onMounted(() => {
@@ -49,7 +49,7 @@ onMounted(() => {
} }
} else { } else {
currentComponent.value = defineAsyncComponent( currentComponent.value = defineAsyncComponent(
() => import('@/views/configManage/neOverview/index.vue') () => import('@/views/ne/neOverview/index.vue')
); );
} }
}); });

View File

@@ -1,435 +0,0 @@
<script setup lang="ts">
import { onMounted, reactive, ref, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { ColumnsType } from 'ant-design-vue/es/table';
import { Modal, message } from 'ant-design-vue/es';
import BackupModal from '@/views/ne/neConfigBackup/components/BackupModal.vue';
import { parseDateToStr } from '@/utils/date-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
import useNeStore from '@/store/modules/ne';
import saveAs from 'file-saver';
import { delFile, getFile, listFile } from '@/api/tool/file';
import { parseSizeFromFile } from '@/utils/parse-utils';
import { pushBackupFTP } from '@/api/neData/backup';
const { t } = useI18n();
const neStore = useNeStore();
/**文件来源 */
let sourceState = reactive({
/**文件列表 */
list: [
{
value: '/log/sys_log_login',
label: t('views.logManage.exportFile.sysloginLog'),
path: '/usr/local/omc/backup',
},
{
value: '/log/sys_log_operate',
label: t('views.logManage.exportFile.sysOperateLog'),
path: '/usr/local/omc/backup',
},
{
value: '/cdr/ims_cdr_event',
label: t('views.logManage.exportFile.cdrIMS'),
path: '/usr/local/omc/backup',
neType: 'IMS',
},
{
value: '/cdr/smf_cdr_event',
label: t('views.logManage.exportFile.cdrSMF'),
path: '/usr/local/omc/backup',
neType: 'SMF',
},
{
value: '/cdr/smsc_cdr_event',
label: t('views.logManage.exportFile.cdrSMSC'),
path: '/usr/local/omc/backup',
neType: 'SMSC',
},
{
value: '/cdr/sgwc_cdr_event',
label: t('views.logManage.exportFile.cdrSGWC'),
path: '/usr/local/omc/backup',
neType: 'SGWC',
},
],
/**选择value */
value: undefined,
});
/**查询参数 */
let queryParams = reactive({
/**读取路径 */
path: '',
/**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
});
/**表格状态类型 */
type TabeStateType = {
/**加载等待 */
loading: boolean;
/**紧凑型 */
size: SizeType;
/**记录数据 */
data: object[];
};
/**表格状态 */
let tableState: TabeStateType = reactive({
loading: false,
size: 'small',
data: [],
});
/**表格字段列 */
let tableColumns: ColumnsType = [
{
title: t('views.logManage.neFile.fileMode'),
dataIndex: 'fileMode',
align: 'center',
width: 150,
},
{
title: t('views.logManage.neFile.owner'),
dataIndex: 'owner',
align: 'left',
width: 100,
},
{
title: t('views.logManage.neFile.group'),
dataIndex: 'group',
align: 'left',
width: 100,
},
{
title: t('views.logManage.neFile.size'),
dataIndex: 'size',
align: 'left',
customRender(opt) {
return parseSizeFromFile(opt.value);
},
width: 100,
},
{
title: t('views.logManage.neFile.modifiedTime'),
dataIndex: 'modifiedTime',
align: 'left',
customRender(opt) {
if (!opt.value) return '';
return parseDateToStr(opt.value);
},
width: 200,
},
{
title: t('views.logManage.neFile.fileName'),
dataIndex: 'fileName',
align: 'left',
},
{
title: t('common.operate'),
key: 'fileName',
align: 'center',
width: 100,
},
];
/**表格分页器参数 */
let tablePagination = reactive({
/**当前页数 */
current: 1,
/**每页条数 */
pageSize: 20,
/**默认的每页条数 */
defaultPageSize: 20,
/**指定每页可以显示多少条 */
pageSizeOptions: ['10', '20', '50', '100'],
/**只有一页时是否隐藏分页器 */
hideOnSinglePage: false,
/**是否可以快速跳转至某页 */
showQuickJumper: true,
/**是否可以改变 pageSize */
showSizeChanger: true,
/**数据总数 */
total: 0,
showTotal: (total: number) => t('common.tablePaginationTotal', { total }),
onChange: (page: number, pageSize: number) => {
tablePagination.current = page;
tablePagination.pageSize = pageSize;
queryParams.pageNum = page;
queryParams.pageSize = pageSize;
fnGetList();
},
});
/**下载触发等待 */
let downLoading = ref<boolean>(false);
/**信息文件下载 */
function fnDownloadFile(row: Record<string, any>) {
if (downLoading.value) return;
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.logManage.exportFile.downTip', {
fileName: row.fileName,
}),
onOk() {
downLoading.value = true;
const hide = message.loading(t('common.loading'), 0);
getFile(queryParams.path, row.fileName)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('common.downloadText'),
}),
duration: 2,
});
saveAs(res.data, `${row.fileName}`);
} else {
message.error({
content: t('views.logManage.exportFile.downTipErr'),
duration: 2,
});
}
})
.finally(() => {
hide();
downLoading.value = false;
});
},
});
}
/**删除触发等待 */
let delLoading = ref<boolean>(false);
/**信息文件删除 */
function fnRecordDelete(row: Record<string, any>) {
if (delLoading.value) return;
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.logManage.exportFile.deleteTip', {
fileName: row.fileName,
}),
onOk() {
delLoading.value = true;
const hide = message.loading(t('common.loading'), 0);
delFile(queryParams.path, row.fileName)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('common.deleteText'),
}),
duration: 2,
});
fnGetList();
} else {
message.error({
content: t('views.logManage.exportFile.deleteTipErr'),
duration: 2,
});
}
})
.finally(() => {
hide();
delLoading.value = false;
});
},
});
}
/**网元类型选择对应修改 */
function fnNeChange(_: any, opt: any) {
queryParams.path = `${opt.path}${opt.value}`;
ftpInfo.path = queryParams.path;
ftpInfo.tag = opt.value;
fnGetList(1);
}
/**查询备份信息列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (queryParams.path === '') {
message.warning({
content: t('views.logManage.exportFile.fileSourcePlease'),
duration: 2,
});
return;
}
if (tableState.loading) return;
tableState.loading = true;
if (pageNum) {
queryParams.pageNum = pageNum;
}
listFile(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);
}
} else {
message.error(res.msg, 3);
tablePagination.total = 0;
tableState.data = [];
}
tableState.loading = false;
});
}
/**打开FTP配置窗口 */
const openFTPModal = ref<boolean>(false);
function fnFTPModalOpen() {
openFTPModal.value = !openFTPModal.value;
}
type FTPInfoType = {
path: string;
tag: string;
fileName: string;
};
const ftpInfo = reactive<FTPInfoType>({
path: '',
tag: '',
fileName: '',
});
/**同步文件到FTP */
function fnSyncFileToFTP(fileName: string) {
ftpInfo.fileName = fileName;
pushBackupFTP(toRaw(ftpInfo)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3);
} else {
message.warning(res.msg, 3);
}
});
}
onMounted(() => {
sourceState.list = sourceState.list.filter(item => {
if (!item.neType) return true;
return neStore.fnHasNe([item.neType]);
});
});
</script>
<template>
<PageContainer>
<a-card :bordered="false" :body-style="{ padding: '0px' }">
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16" align="middle">
<a-col>
<span>{{ t('views.logManage.exportFile.fileSource') }}:</span
>&nbsp;
<a-select
v-model:value="sourceState.value"
:options="sourceState.list"
@change="fnNeChange"
:allow-clear="false"
:placeholder="t('common.selectPlease')"
style="width: 200px"
/>
</a-col>
<template v-if="queryParams.path">
<span>{{ t('views.logManage.neFile.nePath') }}:</span>&nbsp;
<a-col>
<a-breadcrumb>
<a-breadcrumb-item>
{{ queryParams.path }}
</a-breadcrumb-item>
</a-breadcrumb>
</a-col>
</template>
</a-row>
</a-form>
</template>
<!-- 插槽-卡片右侧 -->
<template #extra>
<a-space :size="8" align="center">
<a-tooltip placement="topRight">
<template #title>
{{ t('views.ne.neConfigBackup.backupModal.title') }}
</template>
<a-button type="text" @click.prevent="fnFTPModalOpen()">
<template #icon><DeliveredProcedureOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList()">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>
</a-space>
</template>
<!-- 表格列表 -->
<a-table
class="table"
row-key="fileName"
:columns="tableColumns"
:loading="tableState.loading"
:data-source="tableState.data"
:size="tableState.size"
:pagination="tablePagination"
:scroll="{ x: 800 }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'fileName'">
<a-space :size="8" align="center">
<a-tooltip placement="topRight" v-if="record.fileType === 'file'">
<template #title>
{{ t('views.ne.neConfigBackup.backupModal.pushFileOper') }}
</template>
<a-button
type="link"
@click.prevent="fnSyncFileToFTP(record.fileName)"
>
<template #icon><CloudServerOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip placement="topRight" v-if="record.fileType === 'file'">
<template #title>{{ t('common.downloadText') }}</template>
<a-button
type="link"
:loading="downLoading"
@click.prevent="fnDownloadFile(record)"
>
<template #icon><DownloadOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip placement="topRight" v-if="record.fileType === 'file'">
<template #title>{{ t('common.deleteText') }}</template>
<a-button
type="link"
:loading="delLoading"
@click.prevent="fnRecordDelete(record)"
>
<template #icon><DeleteOutlined /></template>
</a-button>
</a-tooltip>
</a-space>
</template>
</template>
</a-table>
</a-card>
<!-- FTP配置窗口 -->
<BackupModal v-model:open="openFTPModal"></BackupModal>
</PageContainer>
</template>
<style lang="less" scoped></style>

View File

@@ -1,710 +0,0 @@
<script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { Form, Modal, message } from 'ant-design-vue/es';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import {
backupDownload,
backupFileList,
backupLog,
exportLog,
getFtpLogSet,
getLogSet,
getRemoteOut,
updateFtpLogSet,
updateLogSet,
updateRemoteOut,
} from '@/api/logManage/logSet';
import { regExpIPv4 } from '@/utils/regular-utils';
import useDictStore from '@/store/modules/dict';
import useI18n from '@/hooks/useI18n';
import saveAs from 'file-saver';
import { writeSheet } from '@/utils/execl-utils';
const { getDict } = useDictStore();
const { t } = useI18n();
/**对象信息状态类型 */
type ModalStateType = {
/**标题 */
title: string;
/**表单数据 */
from: Record<string, any>;
/**表单数据 loading */
fromLoading: boolean;
/**确定按钮 loading */
confirmLoading: boolean;
};
/**日志设置信息状态 */
let logSetState: ModalStateType = reactive({
title: '日志设置',
from: {
logDuration: 15,
logCapacity: 10,
},
fromLoading: true,
confirmLoading: true,
});
/**日志设置信息内表单属性和校验规则 */
const logSetStateFrom = Form.useForm(
logSetState.from,
reactive({
logDuration: [
{
required: true,
trigger: 'blur',
message: '请输入日志保存时间最少15天',
},
],
logCapacity: [
{
required: true,
message: '请输入日志最大容量最小10MB',
},
],
})
);
/**日志设置保存 */
function fnFormLogSetFinish() {
logSetStateFrom.validate().then(() => {
logSetState.confirmLoading = true;
const from = toRaw(logSetState.from);
updateLogSet({
logDuration: from.logDuration,
logCapacity: from.logCapacity,
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data > 0) {
message.success(`日志设置保存成功`, 3);
} else {
message.warning(`日志设置无变更`, 3);
}
})
.finally(() => {
logSetState.confirmLoading = false;
});
});
}
/**FTP日志对象信息状态 */
let ftpState: ModalStateType = reactive({
title: 'FTP日志上报接口设置',
from: {
agreement: 'ftp',
directory: '',
ftpLog: 12,
toIp: '',
},
fromLoading: true,
confirmLoading: true,
});
/**FTP日志对象信息内表单属性和校验规则 */
const ftpStateFrom = Form.useForm(
ftpState.from,
reactive({
toIp: [
{
required: true,
pattern: regExpIPv4,
message: '请输入对端IP地址',
},
],
directory: [
{
required: true,
trigger: 'blur',
message: '请输入对端文件目录',
},
],
ftpLog: [
{
required: true,
trigger: 'blur',
message: '请输入日志生成周期最小12小时',
},
],
})
);
/**FTP日志对象保存 */
function fnFormFTPFinish() {
ftpStateFrom.validate().then(() => {
logSetState.confirmLoading = true;
const from = toRaw(ftpState.from);
updateFtpLogSet(from)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(`FTP日志设置保存成功`, 3);
} else {
message.warning(`FTP日志设置无变更`, 3);
}
})
.finally(() => {
logSetState.confirmLoading = false;
});
});
}
/**日志远程输出对象信息状态 */
let remoteOutState: ModalStateType = reactive({
title: '日志远程输出',
from: {
logIp: '',
logDirectory: '',
},
fromLoading: true,
confirmLoading: true,
});
/**日志远程输出对象信息内表单属性和校验规则 */
const remoteOutStateFrom = Form.useForm(
remoteOutState.from,
reactive({
logIp: [
{
required: true,
pattern: regExpIPv4,
message: '请输入远程IP地址',
},
],
logDirectory: [
{
required: true,
trigger: 'blur',
message: '请输入远程日志目录',
},
],
})
);
/**日志远程输出对象保存 */
function fnFormRemoteOutFinish() {
remoteOutStateFrom.validate().then(() => {
remoteOutState.confirmLoading = true;
const from = toRaw(remoteOutState.from);
updateRemoteOut(from)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(`日志远程输出设置保存成功`, 3);
} else {
message.warning(`日志远程输出设置无变更`, 3);
}
})
.finally(() => {
remoteOutState.confirmLoading = false;
});
});
}
/**字典数据 */
let dict: {
/**操作日志操作类型 */
operationLogType: DictType[];
} = reactive({
operationLogType: [],
});
/**日志范围开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']);
/**开始结束时间选择对应修改 */
function fnRangePickerChange(_: any, item: any) {
logOutState.from.beginTime = item[0];
logOutState.from.endTime = item[1];
}
/**日志导出对象信息状态 */
let logOutState: ModalStateType = reactive({
title: '日志导出',
from: {
logType: 'security_log',
opType: 'View',
beginTime: '',
endTime: '',
},
fromLoading: false,
confirmLoading: false,
});
/**日志导出对象信息内表单属性和校验规则 */
const logOutStateFrom = Form.useForm(
logOutState.from,
reactive({
endTime: [
{
required: true,
message: '请输入日志时间范围',
},
],
})
);
/**日志导出对象保存 */
function fnFormLogOutFinish() {
logOutStateFrom.validate().then(() => {
logOutState.confirmLoading = true;
const from = toRaw(logOutState.from);
const key = 'exportLog';
message.loading({ content: t('common.loading'), key });
exportLog(from)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `已完成导出`,
key,
duration: 3,
});
writeSheet(res.data, from.logType).then(fileBlob =>
saveAs(fileBlob, `${from.logType}_${Date.now()}.xlsx`)
);
} else {
message.error({
content: `${res.msg}`,
key,
duration: 3,
});
}
})
.finally(() => {
logOutState.confirmLoading = false;
});
});
}
/**日志备份对象信息状态 */
let backState: ModalStateType = reactive({
title: '日志备份',
from: {
logType: 'security_log',
backFileTree: [],
},
fromLoading: true,
confirmLoading: true,
});
/**日志备份对象保存 */
function fnFormBackFinish() {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认手动备份该日志类型数据到文件吗?`,
onOk() {
backState.confirmLoading = true;
const key = 'backupLog';
message.loading({ content: t('common.loading'), key });
backupLog(backState.from.logType)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `手动备份执行成功记录数:${res.data}`,
key,
duration: 10,
});
fnBackFileList();
} else {
message.error({
content: `${res.msg}`,
key: key,
duration: 3,
});
}
})
.finally(() => {
backState.confirmLoading = false;
});
},
});
}
/**日志手动备份文件列表 */
function fnBackFileList() {
backupFileList().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.name === '') {
backState.from.backFileTree = [];
} else {
backState.from.backFileTree = [res.data];
}
backState.fromLoading = false;
backState.confirmLoading = false;
}
});
}
/**日志备份文件下载 */
function fnBackDownload(name: string, path: string) {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认下载该文件吗?`,
onOk() {
backState.confirmLoading = true;
const key = 'backupDownload';
message.loading({ content: t('common.loading'), key });
backupDownload(path)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `已完成下载`,
key,
duration: 3,
});
saveAs(res.data, name);
} else {
message.error({
content: `${res.msg}`,
key,
duration: 3,
});
}
})
.finally(() => {
backState.confirmLoading = false;
});
},
});
}
onMounted(() => {
Promise.allSettled([
getLogSet(),
getFtpLogSet(),
getRemoteOut(),
getDict('operation_log_type'),
fnBackFileList(),
]).then(resArr => {
// 查询日志设置
if (resArr[0].status === 'fulfilled') {
const result = resArr[0].value;
if (result.code === RESULT_CODE_SUCCESS) {
logSetState.from = Object.assign(logSetState.from, result.data);
logSetState.fromLoading = false;
logSetState.confirmLoading = false;
}
}
// 查询FTP日志设置
if (resArr[1].status === 'fulfilled') {
const result = resArr[1].value;
if (result.code === RESULT_CODE_SUCCESS) {
ftpState.from = Object.assign(ftpState.from, result.data);
ftpState.fromLoading = false;
ftpState.confirmLoading = false;
}
}
// 查询日志远程输出设置
if (resArr[2].status === 'fulfilled') {
const result = resArr[2].value;
if (result.code === RESULT_CODE_SUCCESS) {
remoteOutState.from = Object.assign(remoteOutState.from, result.data);
remoteOutState.fromLoading = false;
remoteOutState.confirmLoading = false;
}
}
// 初始字典数据 日志导出-操作日志
if (resArr[3].status === 'fulfilled') {
dict.operationLogType = resArr[3].value;
}
});
});
</script>
<template>
<PageContainer>
<a-row>
<a-col :span="8">
<!-- 日志设置 -->
<a-card :title="logSetState.title" :loading="logSetState.fromLoading">
<template #extra>
<a-space :size="8" align="center">
<a-button
type="primary"
:loading="logSetState.confirmLoading"
@click.prevent="fnFormLogSetFinish"
>
<template #icon><SaveOutlined /></template>
保存设置
</a-button>
</a-space>
</template>
<a-form
name="logSetState.from"
layout="horizontal"
autocomplete="off"
:label-col="{ span: 8 }"
>
<a-form-item
label="日志保存时间(天)"
name="logDuration"
v-bind="logSetStateFrom.validateInfos.logDuration"
>
<a-input-number
v-model:value="logSetState.from.logDuration"
placeholder="15"
:min="15"
/>
</a-form-item>
<a-form-item
label="日志最大容量(MB)"
name="logCapacity"
v-bind="logSetStateFrom.validateInfos.logCapacity"
>
<a-input-number
v-model:value="logSetState.from.logCapacity"
placeholder="10"
:min="10"
/>
</a-form-item>
</a-form>
</a-card>
<!-- 日志导出 -->
<a-card
:title="logOutState.title"
:loading="logOutState.fromLoading"
style="margin-top: 16px"
>
<template #extra>
<a-space :size="8" align="center">
<a-button
type="primary"
:loading="logOutState.confirmLoading"
@click.prevent="fnFormLogOutFinish"
>
<template #icon><ExportOutlined /></template>
导出
</a-button>
</a-space>
</template>
<a-form
name="logOutState.from"
layout="horizontal"
autocomplete="off"
:label-col="{ span: 5 }"
>
<a-form-item label="日志类型" name="logType">
<a-select v-model:value="logOutState.from.logType">
<a-select-option key="operation_log" value="operation_log">
操作日志
</a-select-option>
<a-select-option key="alarm_log" value="alarm_log">
告警日志
</a-select-option>
<a-select-option key="security_log" value="security_log">
安全日志
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label="操作类型"
name="opType"
v-show="logOutState.from.logType === 'operation_log'"
>
<a-select
v-model:value="logOutState.from.opType"
placeholder="请选择操作类型"
:options="dict.operationLogType"
>
</a-select>
</a-form-item>
<a-form-item
label="时间范围"
name="queryRangePicker"
v-bind="logOutStateFrom.validateInfos.endTime"
>
<a-range-picker
v-model:value="queryRangePicker"
@change="fnRangePickerChange"
allow-clear
bordered
show-time
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
:placeholder="['记录开始', '记录结束']"
style="width: 100%"
></a-range-picker>
</a-form-item>
</a-form>
</a-card>
</a-col>
<a-col :span="8">
<!-- FTP日志设置-->
<a-card :title="ftpState.title" :loading="ftpState.fromLoading">
<template #extra>
<a-space :size="8" align="center">
<a-button
type="primary"
:loading="ftpState.confirmLoading"
@click.prevent="fnFormFTPFinish"
>
<template #icon><SaveOutlined /></template>
保存设置
</a-button>
</a-space>
</template>
<a-form
name="fTPState"
layout="horizontal"
autocomplete="off"
:label-col="{ span: 8 }"
>
<a-form-item label="协议类型" name="agreement">
<a-select v-model:value="ftpState.from.agreement">
<a-select-option key="ftp" value="ftp">FTP</a-select-option>
<a-select-option key="sftp" value="sftp">SFTP</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label="对端IP地址"
name="toIp"
v-bind="ftpStateFrom.validateInfos.toIp"
>
<a-input
v-model:value="ftpState.from.toIp"
allow-clear
placeholder="请输入对端IP地址"
></a-input>
</a-form-item>
<a-form-item
label="对端文件目录"
name="directory"
v-bind="ftpStateFrom.validateInfos.directory"
>
<a-input
v-model:value="ftpState.from.directory"
allow-clear
placeholder="请输入对端文件目录"
></a-input>
</a-form-item>
<a-form-item
label="日志生成周期(小时)"
name="ftpLog"
v-bind="ftpStateFrom.validateInfos.ftpLog"
>
<a-input-number
v-model:value="ftpState.from.ftpLog"
placeholder="12"
:min="12"
/>
</a-form-item>
</a-form>
</a-card>
</a-col>
<a-col :span="8">
<!-- 日志远程输出设置 -->
<a-card
:title="remoteOutState.title"
:loading="remoteOutState.fromLoading"
>
<template #extra>
<a-space :size="8" align="center">
<a-button
type="primary"
:loading="remoteOutState.confirmLoading"
@click.prevent="fnFormRemoteOutFinish"
>
<template #icon><SaveOutlined /></template>
保存设置
</a-button>
</a-space>
</template>
<a-form
name="remoteOutState.from"
layout="horizontal"
autocomplete="off"
:label-col="{ span: 6 }"
>
<a-form-item
label="远程IP地址"
name="logIp"
v-bind="remoteOutStateFrom.validateInfos.logIp"
>
<a-input
v-model:value="remoteOutState.from.logIp"
allow-clear
placeholder="请输入远程IP地址"
></a-input>
</a-form-item>
<a-form-item
label="远程日志目录"
name="logDirectory"
v-bind="remoteOutStateFrom.validateInfos.logDirectory"
>
<a-input
v-model:value="remoteOutState.from.logDirectory"
allow-clear
placeholder="请输入远程日志目录"
></a-input>
</a-form-item>
</a-form>
</a-card>
<!-- 日志备份 -->
<a-card
:title="backState.title"
:loading="backState.fromLoading"
style="margin-top: 16px"
>
<template #extra>
<a-space :size="8" align="center">
<a-button
type="primary"
:loading="backState.confirmLoading"
@click.prevent="fnFormBackFinish"
>
<template #icon><CloudServerOutlined /></template>
备份
</a-button>
</a-space>
</template>
<a-form name="backState.from" layout="horizontal" autocomplete="off">
<a-form-item label="日志类型" name="logType">
<a-select v-model:value="backState.from.logType">
<a-select-option key="operation_log" value="operation_log">
操作日志
</a-select-option>
<a-select-option key="alarm_log" value="alarm_log">
告警日志
</a-select-option>
<a-select-option key="security_log" value="security_log">
安全日志
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label="备份文件"
name="backFileTree"
v-show="backState.from.backFileTree.length > 0"
>
<a-directory-tree
:tree-data="backState.from.backFileTree"
:field-names="{ children: 'items', title: 'name', key: 'path' }"
>
<template #title="{ isDir, name, path }">
<span>{{ name }}</span>
<span
class="backFile-download"
v-if="!isDir"
@click.prevent="fnBackDownload(name, path)"
>
下载
</span>
</template>
</a-directory-tree>
</a-form-item>
</a-form>
</a-card>
</a-col>
</a-row>
</PageContainer>
</template>
<style lang="less" scoped>
.backFile-download {
margin-left: 12px;
color: #eb2f96;
text-decoration: underline;
}
</style>

View File

@@ -82,14 +82,14 @@ let tableColumns: ColumnsType = reactive([
width: 100, width: 100,
}, },
{ {
title: t('views.logManage.mml.type'), title: t('views.ne.common.neType'),
dataIndex: 'neType', dataIndex: 'neType',
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{ {
title: t('views.logManage.mml.neId'), title: t('views.ne.common.neUid'),
dataIndex: 'neId', dataIndex: 'neUid',
align: 'left', align: 'left',
width: 100, width: 100,
}, },

View File

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

View File

@@ -15,6 +15,7 @@ import {
notNeNodes, notNeNodes,
} from '../../hooks/useTopology'; } from '../../hooks/useTopology';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
/**图DOM节点实例对象 */ /**图DOM节点实例对象 */
@@ -154,6 +155,7 @@ function fnGraphDataLoad(reload: boolean = false) {
Promise.all([ Promise.all([
getGraphData(graphState.group), getGraphData(graphState.group),
listAllNeInfo({ listAllNeInfo({
coreUid: currentCoreUid(),
bandStatus: false, bandStatus: false,
}), }),
]) ])

View File

@@ -1,5 +1,5 @@
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import { parseSizeFromBits, parseSizeFromKbs } from '@/utils/parse-utils'; import { parseSizeFromByte, parseSizeFromKbs } from '@/utils/parse-utils';
import { ref } from 'vue'; import { ref } from 'vue';
type FDType = { type FDType = {
@@ -81,9 +81,9 @@ export function upfTFParse(day: string, data: Record<string, number>) {
let { up, down } = data; let { up, down } = data;
upfTotalFlow.value[day] = { upfTotalFlow.value[day] = {
up: up, up: up,
upFrom: parseSizeFromBits(up), upFrom: parseSizeFromByte(up),
down: down, down: down,
downFrom: parseSizeFromBits(down), downFrom: parseSizeFromByte(down),
requestFlag: false, requestFlag: false,
}; };
} }

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -229,15 +229,15 @@ function loadData() {
interval10s.value = setInterval(() => { interval10s.value = setInterval(() => {
if (!interval10s.value || !initFlag) return; if (!interval10s.value || !initFlag) return;
if (upfTFActive.value === '0') { if (upfTFActive.value === '0') {
upfTFSend('7');
upfTFActive.value = '7'; upfTFActive.value = '7';
} else if (upfTFActive.value === '7') { } else if (upfTFActive.value === '7') {
upfTFSend('30');
upfTFActive.value = '30'; upfTFActive.value = '30';
} else if (upfTFActive.value === '30') { } else if (upfTFActive.value === '30') {
upfTFSend('0');
upfTFActive.value = '0'; upfTFActive.value = '0';
} }
upfTFSend('0');
upfTFSend('7');
upfTFSend('30');
}, 10_000); }, 10_000);
clearInterval(interval5s.value); clearInterval(interval5s.value);
@@ -307,11 +307,9 @@ onMounted(() => {
fnSelectUDM({ key: udmOtions.value[0].value }); fnSelectUDM({ key: udmOtions.value[0].value });
} }
// //
neCascaderOptions.value = neStore.getNeCascaderOptions.filter( neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
(item: any) => { return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value);
return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value); });
}
);
if (neCascaderOptions.value.length === 0) { if (neCascaderOptions.value.length === 0) {
message.warning({ message.warning({
content: t('common.noData'), content: t('common.noData'),

View File

@@ -15,6 +15,7 @@ import {
notNeNodes, notNeNodes,
} from '../../hooks/useTopology'; } from '../../hooks/useTopology';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
/**图DOM节点实例对象 */ /**图DOM节点实例对象 */
@@ -26,7 +27,8 @@ const graphNodeTooltip = new Tooltip({
offsetY: 20, offsetY: 20,
getContent(evt) { getContent(evt) {
if (!evt) return t('views.monitor.topologyBuild.graphNotInfo'); if (!evt) return t('views.monitor.topologyBuild.graphNotInfo');
const { id, label, neState, neInfoList, neStateMap }: any = evt.item?.getModel(); const { id, label, neState, neInfoList, neStateMap }: any =
evt.item?.getModel();
//console.log(neInfoList,neState,neInfoList); //console.log(neInfoList,neState,neInfoList);
if (notNeNodes.includes(id)) { if (notNeNodes.includes(id)) {
return `<div><span>${label || id}</span></div>`; return `<div><span>${label || id}</span></div>`;
@@ -50,10 +52,10 @@ const graphNodeTooltip = new Tooltip({
> >
<div><strong>${t('views.monitor.topology.state')}</strong><span> <div><strong>${t('views.monitor.topology.state')}</strong><span>
${ ${
neState.online neState.online
? t('views.monitor.topology.normalcy') ? t('views.monitor.topology.normalcy')
: t('views.monitor.topology.exceptions') : t('views.monitor.topology.exceptions')
} }
</span></div> </span></div>
<div><strong>${t('views.monitor.topology.refreshTime')}</strong><span> <div><strong>${t('views.monitor.topology.refreshTime')}</strong><span>
${neState.refreshTime ?? '--'} ${neState.refreshTime ?? '--'}
@@ -88,10 +90,10 @@ const graphNodeTooltip = new Tooltip({
> >
<div><strong>${t('views.monitor.topology.state')}</strong><span> <div><strong>${t('views.monitor.topology.state')}</strong><span>
${ ${
neState.online neState.online
? t('views.monitor.topology.normalcy') ? t('views.monitor.topology.normalcy')
: t('views.monitor.topology.exceptions') : t('views.monitor.topology.exceptions')
} }
</span></div> </span></div>
<div><strong>${t('views.monitor.topology.refreshTime')}</strong><span> <div><strong>${t('views.monitor.topology.refreshTime')}</strong><span>
${neState.refreshTime ?? '--'} ${neState.refreshTime ?? '--'}
@@ -101,13 +103,17 @@ const graphNodeTooltip = new Tooltip({
// //
sameTypeNes.forEach((ne: any, index: number) => { sameTypeNes.forEach((ne: any, index: number) => {
// //
const neStateInfo = neStateMap?.[ne.neId] || const neStateInfo =
(ne.neId === neState.neId ? neState : {}); neStateMap?.[ne.neId] || (ne.neId === neState.neId ? neState : {});
content += ` content += `
<div style="margin-top: 8px;"><strong>${t('views.monitor.topology.name')}${ne.neName || id + '_' + ne.neId}</strong></div> <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> <div><strong>ID</strong><span>${ne.neId || '--'}</span></div>
<div><strong>IP</strong><span>${neStateInfo.neIP || ne.neIP || '--'}</span></div> <div><strong>IP</strong><span>${
neStateInfo.neIP || ne.neIP || '--'
}</span></div>
<div><strong>${t('views.monitor.topology.version')}</strong><span> <div><strong>${t('views.monitor.topology.version')}</strong><span>
${neStateInfo.version || ne.version || '--'} ${neStateInfo.version || ne.version || '--'}
</span></div> </span></div>
@@ -120,13 +126,17 @@ const graphNodeTooltip = new Tooltip({
<div><strong>${t('views.monitor.topology.state')}</strong><span> <div><strong>${t('views.monitor.topology.state')}</strong><span>
${ ${
neStateInfo.online !== undefined neStateInfo.online !== undefined
? (neStateInfo.online ? neStateInfo.online
? t('views.monitor.topology.normalcy') ? t('views.monitor.topology.normalcy')
: t('views.monitor.topology.exceptions')) : t('views.monitor.topology.exceptions')
: 'undefined' : 'undefined'
} }
</span></div> </span></div>
${index < sameTypeNes.length - 1 ? '<div>------------------------</div>' : ''} ${
index < sameTypeNes.length - 1
? '<div>------------------------</div>'
: ''
}
`; `;
}); });
@@ -136,8 +146,6 @@ const graphNodeTooltip = new Tooltip({
itemTypes: ['node'], itemTypes: ['node'],
}); });
/**图数据渲染 */ /**图数据渲染 */
function handleRanderGraph( function handleRanderGraph(
container: HTMLElement | undefined, container: HTMLElement | undefined,
@@ -176,7 +184,6 @@ function handleRanderGraph(
graph.data(data); graph.data(data);
graph.render(); graph.render();
graphG6.value = graph; graphG6.value = graph;
// ResizeObserver // ResizeObserver
@@ -207,6 +214,7 @@ function fnGraphDataLoad(reload: boolean = false) {
Promise.all([ Promise.all([
getGraphData(graphState.group), getGraphData(graphState.group),
listAllNeInfo({ listAllNeInfo({
coreUid: currentCoreUid(),
bandStatus: false, bandStatus: false,
}), }),
]) ])
@@ -250,11 +258,11 @@ function fnGraphDataLoad(reload: boolean = false) {
const nf: Record<string, any>[] = nodes.filter( const nf: Record<string, any>[] = nodes.filter(
(node: Record<string, any>) => { (node: Record<string, any>) => {
Reflect.set(node, 'neState', { online: false }); Reflect.set(node, 'neState', { online: false });
Reflect.set(node, 'neStateMap', {}); // Reflect.set(node, 'neStateMap', {}); //
// //
if (node.img) node.img = parseBasePath(node.img); if (node.img) node.img = parseBasePath(node.img);
if (node.icon.show && node.icon?.img){ if (node.icon.show && node.icon?.img) {
node.icon.img = parseBasePath(node.icon.img); node.icon.img = parseBasePath(node.icon.img);
} }

View File

@@ -1,5 +1,5 @@
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import { parseSizeFromBits, parseSizeFromKbs } from '@/utils/parse-utils'; import { parseSizeFromByte, parseSizeFromKbs } from '@/utils/parse-utils';
import { ref } from 'vue'; import { ref } from 'vue';
type FDType = { type FDType = {
@@ -79,9 +79,9 @@ export function upfTFParse(day: string, data: Record<string, number>) {
let { up, down } = data; let { up, down } = data;
upfTotalFlow.value[day] = { upfTotalFlow.value[day] = {
up: up, up: up,
upFrom: parseSizeFromBits(up), upFrom: parseSizeFromByte(up),
down: down, down: down,
downFrom: parseSizeFromBits(down), downFrom: parseSizeFromByte(down),
requestFlag: false, requestFlag: false,
}; };
} }

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -176,15 +176,15 @@ async function fnGetSkim() {
{ {
request: (neId: string) => listAMFNblist({ neId }), request: (neId: string) => listAMFNblist({ neId }),
process: async (res: any, neId: any) => { process: async (res: any, neId: any) => {
console.log(neId) console.log(neId);
if (res.code === RESULT_CODE_SUCCESS&& Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
skimState.gnbNum += res.data.length; skimState.gnbNum += res.data.length;
skimState.gnbUeNum += res.data.reduce( skimState.gnbUeNum += res.data.reduce(
(sum: number, item: any) => sum + item.ueNum, (sum: number, item: any) => sum + item.ueNum,
0 0
); );
const amfNbRes = await listAMFNbStatelist({ neId }); const amfNbRes = await listAMFNbStatelist({ neId });
console.log(amfNbRes) console.log(amfNbRes);
if ( if (
amfNbRes.code === RESULT_CODE_SUCCESS && amfNbRes.code === RESULT_CODE_SUCCESS &&
Array.isArray(amfNbRes.data) Array.isArray(amfNbRes.data)
@@ -224,13 +224,13 @@ async function fnGetSkim() {
); );
const mmeNbRes = await listMMENbStatelist({ neId }); const mmeNbRes = await listMMENbStatelist({ neId });
console.log(mmeNbRes) console.log(mmeNbRes);
if ( if (
mmeNbRes.code === RESULT_CODE_SUCCESS && mmeNbRes.code === RESULT_CODE_SUCCESS &&
Array.isArray(mmeNbRes.data) Array.isArray(mmeNbRes.data)
) { ) {
// skimState.eNbSumNum += mmeNbRes.data.length; // skimState.eNbSumNum += mmeNbRes.data.length;
console.log(mmeNbRes) console.log(mmeNbRes);
tempEnbSumNum += mmeNbRes.data.length; tempEnbSumNum += mmeNbRes.data.length;
} }
} }
@@ -238,21 +238,20 @@ async function fnGetSkim() {
}, },
], ],
]); ]);
console.log(neCascaderOptions) console.log(neCascaderOptions);
const requests = neCascaderOptions.value.flatMap( const requests = neCascaderOptions.value.flatMap(
(ne: any) => (ne: any) =>
ne.children ne.children
?.map((child: any) => { ?.map((child: any) => {
console.log(child.neId) console.log(child.neId);
const handler = neHandlers.get(child.neType); const handler = neHandlers.get(child.neType);
return handler return handler
? { ? {
promise: handler.request(child.neId), promise: handler.request(child.neId),
process: handler.process, process: handler.process,
neId: child.neId, // neId neId: child.neId, // neId
}
}
: null; : null;
}) })
.filter(Boolean) || [] .filter(Boolean) || []
@@ -311,15 +310,15 @@ function loadData() {
interval10s.value = setInterval(() => { interval10s.value = setInterval(() => {
if (!interval10s.value || !initFlag) return; if (!interval10s.value || !initFlag) return;
if (upfTFActive.value === '0') { if (upfTFActive.value === '0') {
upfTFSend('7');
upfTFActive.value = '7'; upfTFActive.value = '7';
} else if (upfTFActive.value === '7') { } else if (upfTFActive.value === '7') {
upfTFSend('30');
upfTFActive.value = '30'; upfTFActive.value = '30';
} else if (upfTFActive.value === '30') { } else if (upfTFActive.value === '30') {
upfTFSend('0');
upfTFActive.value = '0'; upfTFActive.value = '0';
} }
upfTFSend('0');
upfTFSend('7');
upfTFSend('30');
}, 10_000); }, 10_000);
clearInterval(interval5s.value); clearInterval(interval5s.value);
@@ -375,12 +374,14 @@ async function fnSelectUDM(e: any) {
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 1,
}); });
console.log(res) console.log(res);
// listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(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 &&
typeof res.data.total === 'number'
) {
skimState.udmSubNum = res.data.total; skimState.udmSubNum = res.data.total;
console.log(res) console.log(res);
} else { } else {
skimState.udmSubNum = 0; skimState.udmSubNum = 0;
} }
@@ -393,7 +394,7 @@ async function fnSelectUDM(e: any) {
} }
/**资源控制-选择NE */ /**资源控制-选择NE */
function fnSelectNeRe(e: any) { function fnSelectNeRe(e: any) {
console.log(e) console.log(e);
graphNodeClickID.value = e.key; graphNodeClickID.value = e.key;
} }
// //
@@ -408,7 +409,7 @@ const getPopupContainer = () => {
onMounted(() => { onMounted(() => {
// //
neStore.getNeCascaderOptions.forEach(item => { neStore.getNeCascaderOptions.forEach(item => {
console.log(item) console.log(item);
if (item.value === 'UPF') { if (item.value === 'UPF') {
neOtions.value = JSON.parse(JSON.stringify(item.children)); neOtions.value = JSON.parse(JSON.stringify(item.children));
} }
@@ -426,11 +427,9 @@ onMounted(() => {
// fnSelectNeRe({ key: onlineArr[0].value }); // fnSelectNeRe({ key: onlineArr[0].value });
// } // }
// //
neCascaderOptions.value = neStore.getNeCascaderOptions.filter( neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
(item: any) => { return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value);
return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value); });
}
);
if (neCascaderOptions.value.length === 0) { if (neCascaderOptions.value.length === 0) {
message.warning({ message.warning({
content: t('common.noData'), content: t('common.noData'),

View File

@@ -3,11 +3,13 @@ import { reactive, onMounted, ref, onBeforeUnmount } from 'vue';
import { PageContainer } from 'antdv-pro-layout'; import { PageContainer } from 'antdv-pro-layout';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { listAllNeInfo, stateNeInfo } from '@/api/ne/neInfo'; import { listAllNeInfo } from '@/api/ne/neInfo';
import { stateNeInfo } from '@/api/ne/neAction';
import { message } from 'ant-design-vue/es'; import { message } from 'ant-design-vue/es';
import { randerGroph, switchLayout } from './graph'; import { randerGroph, switchLayout } from './graph';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import { parseBasePath } from '@/plugins/file-static-url'; import { parseBasePath } from '@/plugins/file-static-url';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
/**图DOM节点实例对象 */ /**图DOM节点实例对象 */
@@ -38,7 +40,7 @@ async function fnGetState() {
if (!interval.value) return; if (!interval.value) return;
const ne = node.info; const ne = node.info;
// if (ne.neType === 'OMC') continue; // if (ne.neType === 'OMC') continue;
const result = await stateNeInfo(ne.neType, ne.neId); const result = await stateNeInfo(ne.coreUid, ne.neUid);
if (result.code === RESULT_CODE_SUCCESS) { if (result.code === RESULT_CODE_SUCCESS) {
ne.serverState = result.data; ne.serverState = result.data;
ne.serverState.refreshTime = parseDateToStr( ne.serverState.refreshTime = parseDateToStr(
@@ -56,6 +58,7 @@ async function fnGetState() {
/**查询全部网元数据列表 */ /**查询全部网元数据列表 */
function fnGetList(refresh: boolean = false) { function fnGetList(refresh: boolean = false) {
listAllNeInfo({ listAllNeInfo({
coreUid: currentCoreUid(),
bandStatus: false, bandStatus: false,
}) })
.then(res => { .then(res => {

View File

@@ -25,6 +25,7 @@ import useNeOptions from '@/views/ne/neInfo/hooks/useNeOptions';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { OptionsType, WS } from '@/plugins/ws-websocket'; import { OptionsType, WS } from '@/plugins/ws-websocket';
import { parseBasePath } from '@/plugins/file-static-url'; import { parseBasePath } from '@/plugins/file-static-url';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
const { fnNeRestart, fnNeStop, fnNeLogFile } = useNeOptions(); const { fnNeRestart, fnNeStop, fnNeLogFile } = useNeOptions();
const ws = new WS(); const ws = new WS();
@@ -105,17 +106,17 @@ const graphNodeMenu = new Menu({
}, },
handleMenuClick(target, item) { handleMenuClick(target, item) {
const { neInfo }: any = item?.getModel(); const { neInfo }: any = item?.getModel();
const { neName, neType, neId } = neInfo; const { neName, neType, neUid, coreUid } = neInfo;
const targetId = target.id; const targetId = target.id;
switch (targetId) { switch (targetId) {
case 'restart': case 'restart':
fnNeRestart({ neName, neType, neId }); fnNeRestart({ neName, neType, neUid, coreUid });
break; break;
case 'stop': case 'stop':
fnNeStop({ neName, neType, neId }); fnNeStop({ neName, neType, neUid, coreUid });
break; break;
case 'log': case 'log':
fnNeLogFile({ neType, neId }); fnNeLogFile({ neType, neUid, coreUid });
break; break;
} }
}, },
@@ -153,11 +154,11 @@ const graphNodeTooltip = new Tooltip({
${neState.refreshTime ?? '--'} ${neState.refreshTime ?? '--'}
</span></div> </span></div>
<div>========================</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> <div><strong>${t('views.monitor.topology.name')}</strong><span>
${neState.neName ?? '--'} ${neState.neName ?? '--'}
</span></div> </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> <div><strong>${t('views.monitor.topology.version')}</strong><span>
${neState.version ?? '--'} ${neState.version ?? '--'}
</span></div> </span></div>
@@ -259,6 +260,7 @@ function fnGraphDataLoad(reload: boolean = false) {
Promise.all([ Promise.all([
getGraphData(graphState.group), getGraphData(graphState.group),
listAllNeInfo({ listAllNeInfo({
coreUid: currentCoreUid(),
bandStatus: false, bandStatus: false,
}), }),
]) ])
@@ -369,14 +371,15 @@ function fnGetState() {
// 获取节点状态 // 获取节点状态
for (const node of graphState.data.nodes) { for (const node of graphState.data.nodes) {
if (notNeNodes.includes(node.id)) continue; if (notNeNodes.includes(node.id)) continue;
const { neType, neId } = node.neInfo; const { neType, neUid, coreUid } = node.neInfo;
if (!neType || !neId) continue; if (!neType || !neUid) continue;
ws.send({ ws.send({
requestId: `${neType}_${neId}`, requestId: `${neType}_${neUid}`,
type: 'ne_state', type: 'ne_state',
data: { data: {
neType: neType, neType: neType,
neId: neId, neUid: neUid,
coreUid: coreUid,
}, },
}); });
} }
@@ -396,7 +399,7 @@ function wsMessage(res: Record<string, any>) {
return; return;
} }
if (!requestId) return; if (!requestId) return;
const [neType, neId] = requestId.split('_'); const [neType, neUid] = requestId.split('_');
const { combos, edges, nodes } = graphState.data; const { combos, edges, nodes } = graphState.data;
const node = nodes.find((item: Record<string, any>) => item.id === neType); const node = nodes.find((item: Record<string, any>) => item.id === neType);

View File

@@ -1,7 +1,8 @@
import { delNeConfigData } from '@/api/ne/neConfig'; import { delNeConfigData } from '@/api/ne/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { reactive, toRaw } from 'vue'; import { reactive } from 'vue';
/** /**
* 批量删除array * 批量删除array
@@ -49,7 +50,8 @@ export default function useArrayBatch({
for (let i = endIndex; i >= batchState.startIndex; i--) { for (let i = endIndex; i >= batchState.startIndex; i--) {
const res = await delNeConfigData({ const res = await delNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: batchState.paramName, paramName: batchState.paramName,
loc: `${i}`, loc: `${i}`,
}); });

View File

@@ -4,6 +4,7 @@ import { readSheet } from '@/utils/execl-utils';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { reactive } from 'vue'; import { reactive } from 'vue';
import saveAs from 'file-saver'; import saveAs from 'file-saver';
import { currentCoreUid } from '@/hooks/useCoreUid';
/** /**
* 导入文件加array * 导入文件加array
@@ -100,7 +101,6 @@ export default function useArrayImport({
/**对话框表格信息导入上传 */ /**对话框表格信息导入上传 */
async function modalImportUpload(file: File) { async function modalImportUpload(file: File) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const [neType, neId] = neTypeSelect.value;
importState.msgArr = []; importState.msgArr = [];
// 获取最大index // 获取最大index
@@ -138,8 +138,9 @@ export default function useArrayImport({
// 已定义则更新 // 已定义则更新
rowItem.index = has.index.value; rowItem.index = has.index.value;
result = await editNeConfigData({ result = await editNeConfigData({
neType: neType, neType: neTypeSelect.value[0],
neId: neId, neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: importState.paramName, paramName: importState.paramName,
paramData: rowItem, paramData: rowItem,
loc: `${rowItem.index}`, loc: `${rowItem.index}`,
@@ -152,8 +153,9 @@ export default function useArrayImport({
} else { } else {
// 未定义则新增 // 未定义则新增
result = await addNeConfigData({ result = await addNeConfigData({
neType: neType, neType: neTypeSelect.value[0],
neId: neId, neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: importState.paramName, paramName: importState.paramName,
paramData: Object.assign(rowItem, { index }), paramData: Object.assign(rowItem, { index }),
loc: `${index}`, loc: `${index}`,

View File

@@ -4,7 +4,8 @@ import {
editNeConfigData, editNeConfigData,
} from '@/api/ne/neConfig'; } from '@/api/ne/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { Modal,message } from 'ant-design-vue/es'; import { currentCoreUid } from '@/hooks/useCoreUid';
import { Modal, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
import { reactive, watch } from 'vue'; import { reactive, watch } from 'vue';
@@ -134,7 +135,8 @@ export default function useConfigArray({
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
editNeConfigData({ editNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
paramData: data, paramData: data,
loc: loc, loc: loc,
@@ -174,7 +176,8 @@ export default function useConfigArray({
onOk() { onOk() {
delNeConfigData({ delNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
loc: loc, loc: loc,
}).then(res => { }).then(res => {
@@ -268,7 +271,8 @@ export default function useConfigArray({
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
addNeConfigData({ addNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
paramData: data, paramData: data,
loc: `${from['index']['value']}`, loc: `${from['index']['value']}`,

View File

@@ -4,6 +4,7 @@ import {
delNeConfigData, delNeConfigData,
} from '@/api/ne/neConfig'; } from '@/api/ne/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { Modal, message } from 'ant-design-vue/es'; import { Modal, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
import { nextTick, reactive } from 'vue'; import { nextTick, reactive } from 'vue';
@@ -202,7 +203,8 @@ export default function useConfigArrayChild({
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
editNeConfigData({ editNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
paramData: data, paramData: data,
loc, loc,
@@ -243,7 +245,8 @@ export default function useConfigArrayChild({
onOk() { onOk() {
delNeConfigData({ delNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
loc, loc,
}).then(res => { }).then(res => {
@@ -313,7 +316,8 @@ export default function useConfigArrayChild({
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
addNeConfigData({ addNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
paramData: data, paramData: data,
loc, loc,

View File

@@ -3,6 +3,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
import { message } from 'ant-design-vue/es'; import { message } from 'ant-design-vue/es';
import { reactive, toRaw } from 'vue'; import { reactive, toRaw } from 'vue';
import { currentCoreUid } from '@/hooks/useCoreUid';
/** /**
* list类型参数处理 * list类型参数处理
@@ -88,7 +89,8 @@ export default function useConfigList({
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
editNeConfigData({ editNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: treeState.selectNode.paramName, paramName: treeState.selectNode.paramName,
paramData: { paramData: {
[from['name']]: from['value'], [from['name']]: from['value'],

View File

@@ -1,4 +1,5 @@
import { getNeConfigData } from '@/api/ne/neConfig'; import { getNeConfigData } from '@/api/ne/neConfig';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { regExpIPv4, regExpIPv6, validURL } from '@/utils/regular-utils'; import { regExpIPv4, regExpIPv6, validURL } from '@/utils/regular-utils';
import { ref } from 'vue'; import { ref } from 'vue';
@@ -29,8 +30,13 @@ export default function useOptions({ t }: any) {
case 'int': case 'int':
// filter: "0~128" // filter: "0~128"
if (filter && filter.indexOf('~') !== -1) { if (filter) {
const filterArr = filter.split('~'); let filterArr = ['0', '1'];
if (filter.indexOf('-') !== -1) {
filterArr = filter.split('-');
} else if (filter.indexOf('~') !== -1) {
filterArr = filter.split('~');
}
const minInt = parseInt(filterArr[0]); const minInt = parseInt(filterArr[0]);
const maxInt = parseInt(filterArr[1]); const maxInt = parseInt(filterArr[1]);
const valueInt = parseInt(value); const valueInt = parseInt(value);
@@ -47,18 +53,12 @@ export default function useOptions({ t }: any) {
break; break;
case 'ipv4': case 'ipv4':
if (!regExpIPv4.test(value)) { if (!regExpIPv4.test(value)) {
return [ return [false, t('views.ne.neConfig.requireIpv4', { display })];
false,
t('views.ne.neConfig.requireIpv4', { display }),
];
} }
break; break;
case 'ipv6': case 'ipv6':
if (!regExpIPv6.test(value)) { if (!regExpIPv6.test(value)) {
return [ return [false, t('views.ne.neConfig.requireIpv6', { display })];
false,
t('views.ne.neConfig.requireIpv6', { display }),
];
} }
break; break;
case 'enum': case 'enum':
@@ -71,10 +71,7 @@ export default function useOptions({ t }: any) {
} }
if (!Object.keys(filterJson).includes(`${value}`)) { if (!Object.keys(filterJson).includes(`${value}`)) {
return [ return [false, t('views.ne.neConfig.requireEnum', { display })];
false,
t('views.ne.neConfig.requireEnum', { display }),
];
} }
} }
break; break;
@@ -90,10 +87,7 @@ export default function useOptions({ t }: any) {
} }
if (!Object.values(filterJson).includes(`${value}`)) { if (!Object.values(filterJson).includes(`${value}`)) {
return [ return [false, t('views.ne.neConfig.requireBool', { display })];
false,
t('views.ne.neConfig.requireBool', { display }),
];
} }
} }
break; break;
@@ -101,12 +95,20 @@ export default function useOptions({ t }: any) {
// filter: "0~128" // filter: "0~128"
// 字符串长度判断 // 字符串长度判断
if (filter && filter.indexOf('~') !== -1) { if (filter) {
try { try {
const filterArr = filter.split('~'); let rule: RegExp = new RegExp('^.*$');
let rule = new RegExp( if (filter.indexOf('-') !== -1) {
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$' const filterArr = filter.split('-');
); rule = new RegExp(
'^.{' + filterArr[0] + ',' + filterArr[1] + '}$'
);
} else if (filter.indexOf('~') !== -1) {
const filterArr = filter.split('~');
rule = new RegExp(
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$'
);
}
if (!rule.test(value)) { if (!rule.test(value)) {
return [ return [
false, false,
@@ -157,10 +159,7 @@ export default function useOptions({ t }: any) {
break; break;
default: default:
return [ return [false, t('views.ne.neConfig.requireUn', { display })];
false,
t('views.ne.neConfig.requireUn', { display }),
];
} }
return result; return result;
} }
@@ -168,10 +167,11 @@ export default function useOptions({ t }: any) {
/**upfId可选择 */ /**upfId可选择 */
const smfByUPFIdOptions = ref<{ value: string; label: string }[]>([]); const smfByUPFIdOptions = ref<{ value: string; label: string }[]>([]);
/**加载smf配置的upfId */ /**加载smf配置的upfId */
function smfByUPFIdLoadData(neId: string) { function smfByUPFIdLoadData(neUid: string) {
getNeConfigData({ getNeConfigData({
neType: 'SMF', neType: 'SMF',
neId: neId, neUid: neUid,
coreUid: currentCoreUid(),
paramName: 'upfConfig', paramName: 'upfConfig',
}).then(res => { }).then(res => {
smfByUPFIdOptions.value = []; smfByUPFIdOptions.value = [];

View File

@@ -16,6 +16,7 @@ import useConfigArrayChild from './hooks/useConfigArrayChild';
import useArrayImport from './hooks/useArrayImport'; import useArrayImport from './hooks/useArrayImport';
import useArrayBatchDel from './hooks/useArrayBatchDel'; import useArrayBatchDel from './hooks/useArrayBatchDel';
import { getAllNeConfig, getNeConfigData } from '@/api/ne/neConfig'; import { getAllNeConfig, getNeConfigData } from '@/api/ne/neConfig';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore(); const neStore = useNeStore();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
@@ -26,7 +27,7 @@ const { ruleVerification, smfByUPFIdLoadData, smfByUPFIdOptions } = useOptions({
/**网元类型_多neId */ /**网元类型_多neId */
let neCascaderOptions = ref<Record<string, any>[]>([]); let neCascaderOptions = ref<Record<string, any>[]>([]);
/**网元类型选择 type,id */ /**网元类型选择 type,neUid */
let neTypeSelect = ref<string[]>(['', '']); let neTypeSelect = ref<string[]>(['', '']);
/**左侧导航是否可收起 */ /**左侧导航是否可收起 */
@@ -107,7 +108,8 @@ function fnActiveConfigNode(key: string | number) {
// 获取网元端的配置数据 // 获取网元端的配置数据
getNeConfigData({ getNeConfigData({
neType: neTypeSelect.value[0], neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], neUid: neTypeSelect.value[1],
coreUid: currentCoreUid(),
paramName: key, paramName: key,
}).then(res => { }).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
@@ -393,11 +395,9 @@ const { batchState, modalBatchOpen, modalBatchClose, modalBatchOk } =
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neCascaderOptions.value = neStore.getNeCascaderOptions.filter( neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
(item: any) => { return !['LMF', 'NEF'].includes(item.value); // 过滤不可用的网元
return !['LMF', 'NEF'].includes(item.value); // 过滤不可用的网元 });
}
);
if (neCascaderOptions.value.length === 0) { if (neCascaderOptions.value.length === 0) {
message.warning({ message.warning({
content: t('common.noData'), content: t('common.noData'),
@@ -406,23 +406,23 @@ onMounted(() => {
return; return;
} }
// 默认选择AMF // 默认选择AMF
const queryNeType = (route.query.neType as string) || 'AMF'; const queryNeType = route.query.neType as string;
const queryNeId = (route.query.neId as string) || '001'; const queryNeUid = route.query.neUid as string;
const item = neCascaderOptions.value.find(s => s.value === queryNeType); const item = neCascaderOptions.value.find(s => s.value === queryNeType);
if (item && item.children) { if (item && item.children) {
const info = item.children.find((s: any) => s.neId === queryNeId); const info = item.children.find((s: any) => s.neUid === queryNeUid);
if (info) { if (info) {
neTypeSelect.value = [info.neType, info.neId]; neTypeSelect.value = [info.neType, info.neUid];
} else { } else {
// 默认取第一个网元ID // 默认取第一个网元ID
const info = item.children[0]; const info = item.children[0];
if (info) { if (info) {
neTypeSelect.value = [info.neType, info.neId]; neTypeSelect.value = [info.neType, info.neUid];
} }
} }
} else { } else {
const info = neCascaderOptions.value[0].children[0]; const info = neCascaderOptions.value[0].children[0];
neTypeSelect.value = [info.neType, info.neId]; neTypeSelect.value = [info.neType, info.neUid];
} }
fnGetNeConfig(); fnGetNeConfig();
}); });

View File

@@ -19,6 +19,7 @@ import {
} from '@/api/ne/neConfigBackup'; } from '@/api/ne/neConfigBackup';
import { pushBackupFTP } from '@/api/neData/backup'; import { pushBackupFTP } from '@/api/neData/backup';
import saveAs from 'file-saver'; import saveAs from 'file-saver';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const neStore = useNeStore(); const neStore = useNeStore();
@@ -28,6 +29,8 @@ let dictStatus = ref<DictType[]>([]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */ /**网元类型 */
neType: undefined, neType: undefined,
/**名称 */ /**名称 */
@@ -61,6 +64,8 @@ type TabeStateType = {
data: any[]; data: any[];
/**勾选记录 */ /**勾选记录 */
selectedRowKeys: (string | number)[]; selectedRowKeys: (string | number)[];
/**勾选记录 */
selectedRows: Record<string, any>[];
}; };
/**表格状态 */ /**表格状态 */
@@ -69,6 +74,7 @@ let tableState: TabeStateType = reactive({
size: 'middle', size: 'middle',
data: [], data: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [],
}); });
/**表格字段列 */ /**表格字段列 */
@@ -85,30 +91,14 @@ let tableColumns = ref<TableColumnsType>([
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{
title: t('common.createTime'),
dataIndex: 'createTime',
align: 'left',
customRender(opt) {
if (!opt.value) return '';
return parseDateToStr(opt.value);
},
width: 200,
},
{ {
title: t('views.ne.neConfigBackup.name'), title: t('views.ne.neConfigBackup.name'),
dataIndex: 'name', dataIndex: 'name',
align: 'left', align: 'left',
width: 200, width: 250,
resizable: true, resizable: true,
minWidth: 100, minWidth: 100,
maxWidth: 300, maxWidth: 400,
ellipsis: true, ellipsis: true,
}, },
{ {
@@ -122,6 +112,16 @@ let tableColumns = ref<TableColumnsType>([
maxWidth: 300, maxWidth: 300,
ellipsis: true, ellipsis: true,
}, },
{
title: t('common.createTime'),
dataIndex: 'createTime',
align: 'left',
customRender(opt) {
if (!opt.value) return '';
return parseDateToStr(opt.value);
},
width: 250,
},
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'id', key: 'id',
@@ -163,8 +163,16 @@ function fnTableSize({ key }: MenuInfo) {
} }
/**表格多选 */ /**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) { function fnTableSelectedRowKeys(keys: (string | number)[], rows: any[]) {
tableState.selectedRowKeys = keys; tableState.selectedRowKeys = keys;
tableState.selectedRows = rows.map(item => {
return {
id: item.id,
coreUid: item.coreUid,
neUid: item.neUid,
neType: item.neType,
};
});
} }
/**查询列表, pageNum初始页数 */ /**查询列表, pageNum初始页数 */
@@ -199,7 +207,7 @@ function fnDownloadFile(row: Record<string, any>) {
content: t('views.ne.neConfigBackup.downTip', { txt: row.name }), content: t('views.ne.neConfigBackup.downTip', { txt: row.name }),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
downNeConfigBackup(row.id) downNeConfigBackup({ id: row.id, coreUid: row.coreUid, neUid: row.neUid })
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -230,7 +238,6 @@ function fnRecordDelete(id: string) {
let msg = id; let msg = id;
if (id === '0') { if (id === '0') {
msg = `...${tableState.selectedRowKeys.length}`; msg = `...${tableState.selectedRowKeys.length}`;
id = tableState.selectedRowKeys.join(',');
} }
Modal.confirm({ Modal.confirm({
@@ -239,17 +246,38 @@ function fnRecordDelete(id: string) {
onOk() { onOk() {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
delNeConfigBackup(id) let reqArr: any = [];
.then(res => { if (id === '0') {
if (res.code === RESULT_CODE_SUCCESS) { tableState.selectedRows.forEach(item => {
message.success({ reqArr.push(
content: t('common.operateOk'), delNeConfigBackup({
duration: 3, coreUid: item.coreUid,
}); neUid: item.neUid,
id: item.id,
})
);
});
} else {
tableState.data.forEach(item => {
if (item.id === id) {
reqArr.push(
delNeConfigBackup({
coreUid: item.coreUid,
neUid: item.neUid,
id: item.id,
})
);
}
});
}
Promise.all(reqArr)
.then(resArr => {
if (resArr.every((item: any) => item.code === RESULT_CODE_SUCCESS)) {
message.success(t('common.operateOk'), 3);
fnGetList(1); fnGetList(1);
} else { } else {
message.error({ message.error({
content: `${res.msg}`, content: t('common.operateErr'),
duration: 3, duration: 3,
}); });
} }
@@ -280,8 +308,16 @@ let modalState: ModalStateType = reactive({
title: '备份记录', title: '备份记录',
from: { from: {
id: undefined, id: undefined,
coreUid: '',
neUid: '',
neType: '',
name: '', name: '',
path: '',
remark: '', remark: '',
createBy: '',
createTime: undefined,
updateBy: '',
updateTime: undefined,
}, },
confirmLoading: false, confirmLoading: false,
}); });
@@ -292,9 +328,7 @@ let modalState: ModalStateType = reactive({
*/ */
function fnModalVisibleByEdit(row: Record<string, any>) { function fnModalVisibleByEdit(row: Record<string, any>) {
if (modalState.confirmLoading) return; if (modalState.confirmLoading) return;
modalState.from.id = row.id; Object.assign(modalState.from, row);
modalState.from.name = row.name;
modalState.from.remark = row.remark;
modalState.title = t('views.ne.neConfigBackup.title', { txt: row.id }); modalState.title = t('views.ne.neConfigBackup.title', { txt: row.id });
modalState.openByEdit = true; modalState.openByEdit = true;
} }

View File

@@ -24,7 +24,13 @@ const props = defineProps({
required: true, required: true,
}, },
/**网元ID */ /**网元ID */
neId: { neUid: {
type: String,
default: '',
required: true,
},
/**核心网标识 */
coreUid: {
type: String, type: String,
default: '', default: '',
required: true, required: true,
@@ -64,7 +70,7 @@ watch(
() => props.open, () => props.open,
val => { val => {
if (val) { if (val) {
if (props.neType && props.neId) { if (props.neType && props.neUid) {
const filePath = props.filePath; const filePath = props.filePath;
const fileName = filePath.substring(filePath.lastIndexOf('/') + 1); const fileName = filePath.substring(filePath.lastIndexOf('/') + 1);
state.title = fileName; state.title = fileName;
@@ -126,7 +132,8 @@ function fnReload() {
prefix="tail" prefix="tail"
url="/ws/view" url="/ws/view"
:ne-type="neType" :ne-type="neType"
:ne-id="neId" :ne-uid="neUid"
:core-uid="coreUid"
style="height: calc(100% - 36px)" style="height: calc(100% - 36px)"
@connect="fnInit()" @connect="fnInit()"
></TerminalSSHView> ></TerminalSSHView>

View File

@@ -13,6 +13,7 @@ import ViewDrawer from './components/ViewDrawer.vue';
import saveAs from 'file-saver'; import saveAs from 'file-saver';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { parseSizeFromFile } from '@/utils/parse-utils'; import { parseSizeFromFile } from '@/utils/parse-utils';
import { currentCoreUid } from '@/hooks/useCoreUid';
const neStore = useNeStore(); const neStore = useNeStore();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
@@ -25,9 +26,11 @@ let neTypeSelect = ref<string[]>([]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */ /**网元类型 */
neType: '', neType: '',
neId: '', neUid: '',
/**读取路径 */ /**读取路径 */
path: '', path: '',
/**前缀过滤 */ /**前缀过滤 */
@@ -149,7 +152,8 @@ function fnDownloadFile(row: Record<string, any>) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
getNeFile({ getNeFile({
neType: queryParams.neType, neType: queryParams.neType,
neId: queryParams.neId, neUid: queryParams.neUid,
coreUid: queryParams.coreUid,
path: queryParams.path, path: queryParams.path,
fileName: row.fileName, fileName: row.fileName,
delTemp: true, delTemp: true,
@@ -210,11 +214,11 @@ function fnDirCD(dir: string, index?: number) {
function fnNeChange(keys: any, _: any) { function fnNeChange(keys: any, _: any) {
if (!Array.isArray(keys)) return; if (!Array.isArray(keys)) return;
const neType = keys[0]; 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.neType = neType;
queryParams.neId = neId; queryParams.neUid = neUid;
if (neType === 'IMS') { if (neType === 'IMS') {
nePathArr.value = ['/var/log/ims']; nePathArr.value = ['/var/log/ims'];
queryParams.search = ''; queryParams.search = '';
@@ -228,7 +232,7 @@ function fnNeChange(keys: any, _: any) {
/**查询备份信息列表, pageNum初始页数 */ /**查询备份信息列表, pageNum初始页数 */
function fnGetList(pageNum?: number) { function fnGetList(pageNum?: number) {
if (queryParams.neId === '') { if (queryParams.neUid === '') {
message.warning({ message.warning({
content: t('views.logManage.neFile.neTypePlease'), content: t('views.logManage.neFile.neTypePlease'),
duration: 2, duration: 2,
@@ -271,20 +275,22 @@ const viewDrawerState = reactive({
/**网元类型 */ /**网元类型 */
neType: '', neType: '',
/**网元ID */ /**网元ID */
neId: '', neUid: '',
coreUid: '',
}); });
/**打开抽屉查看 */ /**打开抽屉查看 */
function fnDrawerOpen(row: Record<string, any>) { function fnDrawerOpen(row: Record<string, any>) {
viewDrawerState.filePath = [...nePathArr.value, row.fileName].join('/'); viewDrawerState.filePath = [...nePathArr.value, row.fileName].join('/');
viewDrawerState.neType = neTypeSelect.value[0]; viewDrawerState.neType = neTypeSelect.value[0];
viewDrawerState.neId = neTypeSelect.value[1]; viewDrawerState.neUid = neTypeSelect.value[1];
viewDrawerState.coreUid = currentCoreUid();
viewDrawerState.open = !viewDrawerState.open; viewDrawerState.open = !viewDrawerState.open;
} }
onMounted(() => { onMounted(() => {
if (routeParams.neType) { if (routeParams.neType) {
neTypeSelect.value = [routeParams.neType, routeParams.neId]; neTypeSelect.value = [routeParams.neType, routeParams.neUid];
fnNeChange(neTypeSelect.value, undefined); fnNeChange(neTypeSelect.value, undefined);
} }
}); });
@@ -385,7 +391,8 @@ onMounted(() => {
v-model:open="viewDrawerState.open" v-model:open="viewDrawerState.open"
:file-path="viewDrawerState.filePath" :file-path="viewDrawerState.filePath"
:ne-type="viewDrawerState.neType" :ne-type="viewDrawerState.neType"
:ne-id="viewDrawerState.neId" :ne-uid="viewDrawerState.neUid"
:core-uid="viewDrawerState.coreUid"
></ViewDrawer> ></ViewDrawer>
</PageContainer> </PageContainer>
</template> </template>

View File

@@ -20,8 +20,11 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
/**网元ID */ coreUid: {
neId: { type: String,
default: '',
},
neUid: {
type: String, type: String,
default: '', default: '',
}, },
@@ -42,15 +45,16 @@ const importState = reactive({
/**查询网元远程服务器备份文件 */ /**查询网元远程服务器备份文件 */
function backupSearch(name?: string) { function backupSearch(name?: string) {
const { neType, neId } = modalState.from; const { neType, neUid, coreUid } = props;
listNeConfigBackup({ listNeConfigBackup({
neType, neType,
neId, neUid,
coreUid,
name, name,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}).then(res => { }).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
importState.backupData = []; importState.backupData = [];
res.data.rows.forEach((item: any) => { res.data.rows.forEach((item: any) => {
importState.backupData.push({ importState.backupData.push({
@@ -86,7 +90,8 @@ type ModalStateType = {
/**表单数据 */ /**表单数据 */
from: { from: {
neType: string; neType: string;
neId: string; neUid: string;
coreUid: string;
type: 'upload' | 'backup'; type: 'upload' | 'backup';
path: string | undefined; path: string | undefined;
}; };
@@ -102,7 +107,8 @@ let modalState: ModalStateType = reactive({
title: '配置文件导入', title: '配置文件导入',
from: { from: {
neType: '', neType: '',
neId: '', neUid: '',
coreUid: '',
type: 'upload', type: 'upload',
path: undefined, path: undefined,
}, },
@@ -227,9 +233,10 @@ watch(
() => props.open, () => props.open,
val => { val => {
if (val) { if (val) {
if (props.neType && props.neId) { if (props.neType && props.neUid && props.coreUid) {
modalState.from.neType = props.neType; modalState.from.neType = props.neType;
modalState.from.neId = props.neId; modalState.from.neUid = props.neUid;
modalState.from.coreUid = props.coreUid;
modalState.title = t('views.ne.neInfo.backConf.title'); modalState.title = t('views.ne.neInfo.backConf.title');
modalState.openByEdit = true; modalState.openByEdit = true;
} }
@@ -241,13 +248,13 @@ watch(
* 网元导出配置 * 网元导出配置
* @param row 网元编号ID * @param row 网元编号ID
*/ */
function fnExportConf(neType: string, neId: string) { function fnExportConf(coreUid: string, neUid: string, neType: string) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.ne.neInfo.backConf.exportTip'), content: t('views.ne.neInfo.backConf.exportTip'),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
exportNeConfigBackup({ neType, neId }) exportNeConfigBackup({ neType, coreUid, neUid })
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
notification.success({ notification.success({
@@ -256,7 +263,7 @@ function fnExportConf(neType: string, neId: string) {
}); });
saveAs( saveAs(
res.data, res.data,
`${neType}_${neId}_config_backup_${Date.now()}.zip` `${neType}_${neUid}_config_backup_${Date.now()}.zip`
); );
} else { } else {
message.error(`${res.msg}`, 3); message.error(`${res.msg}`, 3);
@@ -280,7 +287,7 @@ defineExpose({
<template> <template>
<ProModal <ProModal
:drag="true" :drag="true"
:width="800" :width="500"
:keyboard="false" :keyboard="false"
:mask-closable="false" :mask-closable="false"
:open="modalState.openByEdit" :open="modalState.openByEdit"
@@ -290,82 +297,77 @@ defineExpose({
@cancel="fnModalCancel" @cancel="fnModalCancel"
> >
<a-form name="modalStateFrom" layout="horizontal" :label-col="{ span: 6 }"> <a-form name="modalStateFrom" layout="horizontal" :label-col="{ span: 6 }">
<a-row> <a-form-item :label="t('views.ne.common.neType')" name="neType">
<a-col :lg="12" :md="12" :xs="24"> {{ modalState.from.neType }}
<a-form-item :label="t('views.ne.common.neType')" name="neType"> </a-form-item>
{{ modalState.from.neType }} <a-form-item :label="t('views.ne.common.neUid')" name="neId">
</a-form-item> {{ modalState.from.neUid }}
<a-form-item </a-form-item>
:label="t('views.ne.neInfo.backConf.importType')"
name="type"
>
<a-select
v-model:value="modalState.from.type"
default-value="server"
:options="importState.typeOption"
@change="typeChange"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neId')" name="neId">
{{ modalState.from.neId }}
</a-form-item>
<a-form-item
:label="t('views.ne.neInfo.backConf.server')"
name="fileName"
v-bind="modalStateFrom.validateInfos.path"
v-if="modalState.from.type === 'backup'"
>
<a-select
v-model:value="modalState.from.path"
:options="importState.backupData"
:placeholder="t('common.selectPlease')"
:show-search="true"
:default-active-first-option="false"
:show-arrow="false"
:allow-clear="true"
:filter-option="false"
:not-found-content="null"
@search="backupSearch"
@change="backupChange"
>
</a-select>
</a-form-item>
<a-form-item <a-form-item
:label="t('views.ne.neInfo.backConf.local')" :label="t('views.ne.neInfo.backConf.importType')"
name="file" name="type"
v-bind="modalStateFrom.validateInfos.path" >
v-if="modalState.from.type === 'upload'" <a-select
> v-model:value="modalState.from.type"
<a-upload default-value="server"
name="file" :options="importState.typeOption"
v-model:file-list="modalState.uploadFiles" @change="typeChange"
accept=".zip" >
list-type="text" </a-select>
:max-count="1" </a-form-item>
:show-upload-list="{
showPreviewIcon: false, <a-form-item
showRemoveIcon: true, :label="t('views.ne.neInfo.backConf.server')"
showDownloadIcon: false, name="fileName"
}" v-bind="modalStateFrom.validateInfos.path"
@remove="fnBeforeRemoveFile" v-if="modalState.from.type === 'backup'"
:before-upload="fnBeforeUploadFile" >
:custom-request="fnUploadFile" <a-select
:disabled="modalState.confirmLoading" v-model:value="modalState.from.path"
> :options="importState.backupData"
<a-button type="primary"> :placeholder="t('common.selectPlease')"
<template #icon> :show-search="true"
<UploadOutlined /> :default-active-first-option="false"
</template> :show-arrow="false"
{{ t('views.ne.neInfo.backConf.localUpload') }} :allow-clear="true"
</a-button> :filter-option="false"
</a-upload> :not-found-content="null"
</a-form-item> @search="backupSearch"
</a-col> @change="backupChange"
</a-row> >
</a-select>
</a-form-item>
<a-form-item
:label="t('views.ne.neInfo.backConf.local')"
name="file"
v-bind="modalStateFrom.validateInfos.path"
v-if="modalState.from.type === 'upload'"
>
<a-upload
name="file"
v-model:file-list="modalState.uploadFiles"
accept=".zip"
list-type="text"
:max-count="1"
:show-upload-list="{
showPreviewIcon: false,
showRemoveIcon: true,
showDownloadIcon: false,
}"
@remove="fnBeforeRemoveFile"
:before-upload="fnBeforeUploadFile"
:custom-request="fnUploadFile"
:disabled="modalState.confirmLoading"
>
<a-button type="primary">
<template #icon>
<UploadOutlined />
</template>
{{ t('views.ne.neInfo.backConf.localUpload') }}
</a-button>
</a-upload>
</a-form-item>
</a-form> </a-form>
</ProModal> </ProModal>
</template> </template>

View File

@@ -5,10 +5,12 @@ import { message, Form, Modal } from 'ant-design-vue/es';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { NE_TYPE_LIST } from '@/constants/ne-constants'; import { NE_TYPE_LIST } from '@/constants/ne-constants';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import { getNeInfo, addNeInfo, updateNeInfo } from '@/api/ne/neInfo'; import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
import { neHostAuthorizedRSA, testNeHost } from '@/api/ne/neHost'; import { neHostAuthorizedRSA, testNeHost } from '@/api/ne/neHost';
import useDictStore from '@/store/modules/dict'; 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 { getDict } = useDictStore();
const { t } = useI18n(); const { t } = useI18n();
const emit = defineEmits(['ok', 'cancel', 'update:open']); const emit = defineEmits(['ok', 'cancel', 'update:open']);
@@ -17,9 +19,17 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
editId: { coreUid: {
type: Number, type: String,
default: 0, default: '',
},
neUid: {
type: String,
default: '',
},
neType: {
type: String,
default: '',
}, },
}); });
@@ -103,14 +113,14 @@ let modalState: ModalStateType = reactive({
title: '网元', title: '网元',
from: { from: {
id: undefined, id: undefined,
neId: '001',
neType: 'AMF', neType: 'AMF',
neName: '', neName: '',
ip: '', ipAddr: '',
port: 33030, port: 33030,
pvFlag: 'PNF', pvFlag: 'PNF',
rmUid: '4400HXAMF001', coreUid: currentCoreUid(),
neAddress: '', neUid: '',
macAddr: '',
dn: '', dn: '',
vendorName: '', vendorName: '',
province: 'Area', province: 'Area',
@@ -158,30 +168,18 @@ const modalStateFrom = Form.useForm(
message: t('views.ne.common.neTypePlease'), message: t('views.ne.common.neTypePlease'),
}, },
], ],
neId: [
{
required: true,
message: t('views.ne.common.neIdPlease'),
},
],
rmUid: [
{
required: true,
message: t('views.ne.common.rmUidPlease'),
},
],
ip: [
{
required: true,
validator: modalStateFromEqualIPV4AndIPV6,
},
],
neName: [ neName: [
{ {
required: true, required: true,
message: t('views.ne.common.neNamePlease'), message: t('views.ne.common.neNamePlease'),
}, },
], ],
ipAddr: [
{
required: true,
validator: modalStateFromEqualIPV4AndIPV6,
},
],
}) })
); );
@@ -209,10 +207,11 @@ function modalStateFromEqualIPV4AndIPV6(
/** /**
* 对话框弹出显示为 新增或者修改 * 对话框弹出显示为 新增或者修改
* @param editId 网元id, 不传为新增 * @param coreUid 核心网ID
* @param neUid 网元ID
*/ */
function fnModalVisibleByEdit(editId: number) { function fnModalVisibleByEdit(coreUid: string, neUid: string) {
if (editId <= 0) { if (!coreUid || !neUid) {
modalStateFrom.resetFields(); modalStateFrom.resetFields();
modalState.title = t('views.ne.neInfo.addTitle'); modalState.title = t('views.ne.neInfo.addTitle');
modalState.openByEdit = true; modalState.openByEdit = true;
@@ -220,7 +219,7 @@ function fnModalVisibleByEdit(editId: number) {
if (modalState.confirmLoading) return; if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
getNeInfo(editId).then(res => { getNeInfoByNF(coreUid, neUid).then(res => {
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
@@ -320,15 +319,6 @@ function fnNeTypeChange(v: any) {
remark: '', remark: '',
}); });
} }
modalState.from.rmUid = `4400HX${v}${modalState.from.neId}`; // 4400HX1AMF001
}
/**表单修改网元neId */
function fnNeIdChange(e: any) {
const v = e.target.value;
if (v.length < 1) return;
modalState.from.rmUid = `4400HX${modalState.from.neType}${v}`; // 4400HX1AMF001
} }
/**表单修改网元IP */ /**表单修改网元IP */
@@ -344,7 +334,7 @@ function fnNeIPChange(e: any) {
watch( watch(
() => props.open, () => props.open,
val => { val => {
if (val) fnModalVisibleByEdit(props.editId); if (val) fnModalVisibleByEdit(props.coreUid, props.neUid);
} }
); );
@@ -439,58 +429,31 @@ onMounted(() => {
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-form-item
<a-col :lg="12" :md="12" :xs="24"> :label="t('views.ne.common.neName')"
<a-form-item name="neName"
:label="t('views.ne.common.neId')" :label-col="{ span: 3 }"
name="neId" :label-wrap="true"
v-bind="modalStateFrom.validateInfos.neId" v-bind="modalStateFrom.validateInfos.neName"
> >
<a-input <a-input
v-model:value="modalState.from.neId" v-model:value="modalState.from.neName"
allow-clear allow-clear
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
:maxlength="32" :maxlength="64"
@change="fnNeIdChange" >
:disabled="!!modalState.from.id" </a-input>
> </a-form-item>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.ne.common.neIdTip') }}
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<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="64"
>
</a-input>
</a-form-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.ne.common.ipAddr')" :label="t('views.ne.common.ipAddr')"
name="ip" name="ipAddr"
v-bind="modalStateFrom.validateInfos.ip" v-bind="modalStateFrom.validateInfos.ipAddr"
> >
<a-input <a-input
v-model:value="modalState.from.ip" v-model:value="modalState.from.ipAddr"
allow-clear allow-clear
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
:maxlength="128" :maxlength="128"
@@ -536,37 +499,11 @@ onMounted(() => {
</a-col> </a-col>
</a-row> </a-row>
<a-form-item
:label="t('views.ne.common.rmUid')"
name="rmUid"
v-bind="modalStateFrom.validateInfos.rmUid"
:label-col="{ span: 3 }"
:labelWrap="true"
>
<a-input
v-model:value="modalState.from.rmUid"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="40"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.ne.common.rmUidTip') }}
</div>
</template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neInfo.neAddress')" name="neAddress"> <a-form-item :label="t('views.ne.neInfo.macAddr')" name="macAddr">
<a-input <a-input
v-model:value="modalState.from.neAddress" v-model:value="modalState.from.macAddr"
allow-clear allow-clear
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
:maxlength="64" :maxlength="64"
@@ -574,7 +511,7 @@ onMounted(() => {
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
<div>{{ t('views.ne.neInfo.neAddressTip') }}</div> <div>{{ t('views.ne.neInfo.macAddrTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>

View File

@@ -4,7 +4,7 @@ import { ProModal } from 'antdv-pro-modal';
import { message, Form } from 'ant-design-vue/es'; import { message, Form } from 'ant-design-vue/es';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { getOAMFile, saveOAMFile, serviceNeAction } from '@/api/ne/neInfo'; import { getOAMFile, saveOAMFile, serviceNeAction } from '@/api/ne/neAction';
const { t } = useI18n(); const { t } = useI18n();
const emit = defineEmits(['ok', 'cancel', 'update:open']); const emit = defineEmits(['ok', 'cancel', 'update:open']);
const props = defineProps({ const props = defineProps({
@@ -12,8 +12,11 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
/**网元ID */ coreUid: {
neId: { type: String,
default: '',
},
neUid: {
type: String, type: String,
default: '', default: '',
}, },
@@ -72,9 +75,9 @@ const modalStateFrom = Form.useForm(
* @param neType 网元类型 * @param neType 网元类型
* @param neId 网元ID * @param neId 网元ID
*/ */
function fnModalVisibleByTypeAndId(neType: string, neId: string) { function fnModalVisibleByTypeAndId(coreUid: string, neUid: string) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
getOAMFile(neType, neId) getOAMFile(coreUid, neUid)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
const data = res.data; const data = res.data;
@@ -116,8 +119,8 @@ function fnModalOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
const from = toRaw(modalState.from); const from = toRaw(modalState.from);
saveOAMFile({ saveOAMFile({
neType: props.neType, coreUid: props.coreUid,
neId: props.neId, neUid: props.neUid,
content: from, content: from,
sync: true, sync: true,
}) })
@@ -128,7 +131,8 @@ function fnModalOk() {
if (modalState.restart) { if (modalState.restart) {
serviceNeAction({ serviceNeAction({
neType: props.neType, neType: props.neType,
neId: props.neId, neUid: props.neUid,
coreUid: props.coreUid,
action: 'restart', action: 'restart',
}); });
} }
@@ -168,8 +172,8 @@ watch(
() => props.open, () => props.open,
val => { val => {
if (val) { if (val) {
if (props.neType && props.neId) { if (props.coreUid && props.neUid) {
fnModalVisibleByTypeAndId(props.neType, props.neId); fnModalVisibleByTypeAndId(props.coreUid, props.neUid);
} }
} }
} }

View File

@@ -3,7 +3,7 @@ import { Modal, message } from 'ant-design-vue/es';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { updateNeConfigReload } from '@/api/tool/mml'; import { updateNeConfigReload } from '@/api/tool/mml';
import { serviceNeAction } from '@/api/ne/neInfo'; import { serviceNeAction } from '@/api/ne/neAction';
import useMaskStore from '@/store/modules/mask'; import useMaskStore from '@/store/modules/mask';
export default function useNeOptions() { export default function useNeOptions() {
@@ -24,7 +24,8 @@ export default function useNeOptions() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
serviceNeAction({ serviceNeAction({
neType: row.neType, neType: row.neType,
neId: row.neId, neUid: row.neUid,
coreUid: row.coreUid,
action: 'start', action: 'start',
}) })
.then(res => { .then(res => {
@@ -60,7 +61,8 @@ export default function useNeOptions() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
serviceNeAction({ serviceNeAction({
neType: row.neType, neType: row.neType,
neId: row.neId, neUid: row.neUid,
coreUid: row.coreUid,
action: 'restart', action: 'restart',
}) })
.then(res => { .then(res => {
@@ -108,7 +110,8 @@ export default function useNeOptions() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
serviceNeAction({ serviceNeAction({
neType: row.neType, neType: row.neType,
neId: row.neId, neUid: row.neUid,
coreUid: row.coreUid,
action: 'stop', action: 'stop',
}) })
.then(res => { .then(res => {
@@ -141,7 +144,7 @@ export default function useNeOptions() {
content: t('views.ne.common.reloadTip'), content: t('views.ne.common.reloadTip'),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
updateNeConfigReload(row.neType, row.neId) updateNeConfigReload(row.coreUid, row.neUid)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3); message.success(t('common.operateOk'), 3);
@@ -165,7 +168,8 @@ export default function useNeOptions() {
name: 'NeFile_2123', name: 'NeFile_2123',
query: { query: {
neType: row.neType, neType: row.neType,
neId: row.neId, neUid: row.neUid,
coreUid: row.coreUid,
}, },
}); });
} }

View File

@@ -8,9 +8,11 @@ import { ColumnsType } from 'ant-design-vue/es/table';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeStore from '@/store/modules/ne'; import useNeStore from '@/store/modules/ne';
import { listNeInfo, delNeInfo, stateNeInfo } from '@/api/ne/neInfo'; import { listNeInfo, delNeInfo } from '@/api/ne/neInfo';
import { stateNeInfo } from '@/api/ne/neAction';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import useNeOptions from './hooks/useNeOptions'; import useNeOptions from './hooks/useNeOptions';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const neStore = useNeStore(); const neStore = useNeStore();
const { t } = useI18n(); const { t } = useI18n();
@@ -45,6 +47,8 @@ let dict: {
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */ /**网元类型 */
neType: '', neType: '',
/**带状态信息 */ /**带状态信息 */
@@ -79,15 +83,18 @@ type TabeStateType = {
data: Record<string, any>[]; data: Record<string, any>[];
/**勾选记录 */ /**勾选记录 */
selectedRowKeys: (string | number)[]; selectedRowKeys: (string | number)[];
/**勾选记录 */
selectedRows: Record<string, any>[];
}; };
/**表格状态 */ /**表格状态 */
let tableState: TabeStateType = reactive({ let tableState: TabeStateType = reactive({
loading: false, loading: false,
size: 'middle', size: 'middle',
seached: false, seached: true,
data: [], data: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [],
}); });
/**表格字段列 */ /**表格字段列 */
@@ -98,18 +105,6 @@ let tableColumns: ColumnsType = [
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{
title: t('views.ne.common.rmUid'),
dataIndex: 'rmUid',
align: 'left',
width: 150,
},
{ {
title: t('views.ne.common.neName'), title: t('views.ne.common.neName'),
dataIndex: 'neName', dataIndex: 'neName',
@@ -118,7 +113,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.ne.common.ipAddr'), title: t('views.ne.common.ipAddr'),
dataIndex: 'ip', dataIndex: 'ipAddr',
align: 'left', align: 'left',
width: 150, width: 150,
}, },
@@ -176,8 +171,16 @@ function fnTableSize({ key }: MenuInfo) {
} }
/**表格多选 */ /**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) { function fnTableSelectedRowKeys(keys: (string | number)[], rows: any[]) {
tableState.selectedRowKeys = keys; tableState.selectedRowKeys = keys;
tableState.selectedRows = rows.map(item => {
return {
id: item.id,
coreUid: item.coreUid,
neUid: item.neUid,
neType: item.neType,
};
});
} }
/**对话框对象信息状态类型 */ /**对话框对象信息状态类型 */
@@ -189,9 +192,9 @@ type ModalStateType = {
/**新增框或修改框是否显示 */ /**新增框或修改框是否显示 */
openByEdit: boolean; openByEdit: boolean;
/**新增框或修改框ID */ /**新增框或修改框ID */
editId: number; /**网元修改框 */
/**OAM框网元类型ID */ coreUid: string;
neId: string; neUid: string;
neType: string; neType: string;
/**确定按钮 loading */ /**确定按钮 loading */
confirmLoading: boolean; confirmLoading: boolean;
@@ -202,8 +205,8 @@ let modalState: ModalStateType = reactive({
openByBackConf: false, openByBackConf: false,
openByOAM: false, openByOAM: false,
openByEdit: false, openByEdit: false,
editId: 0, coreUid: '',
neId: '', neUid: '',
neType: '', neType: '',
confirmLoading: false, confirmLoading: false,
}); });
@@ -214,9 +217,13 @@ let modalState: ModalStateType = reactive({
*/ */
function fnModalVisibleByEdit(row?: Record<string, any>) { function fnModalVisibleByEdit(row?: Record<string, any>) {
if (!row) { if (!row) {
modalState.editId = 0; modalState.coreUid = '';
modalState.neUid = '';
modalState.neType = '';
} else { } else {
modalState.editId = row.id; modalState.coreUid = row.coreUid;
modalState.neUid = row.neUid;
modalState.neType = row.neType;
} }
modalState.openByEdit = !modalState.openByEdit; modalState.openByEdit = !modalState.openByEdit;
} }
@@ -227,7 +234,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
*/ */
function fnModalEditOk(from: Record<string, any>) { function fnModalEditOk(from: Record<string, any>) {
// 新增时刷新列表 // 新增时刷新列表
if (!from.id) { if (!from.neUid) {
fnGetList(); fnGetList();
return; return;
} }
@@ -237,16 +244,16 @@ function fnModalEditOk(from: Record<string, any>) {
/**局部更新信息 */ /**局部更新信息 */
function reloadRowInfo(row: Record<string, any>) { function reloadRowInfo(row: Record<string, any>) {
stateNeInfo(row.neType, row.neId) stateNeInfo(row.coreUid, row.neUid)
.then(res => { .then(res => {
// 找到编辑更新的网元 // 找到编辑更新的网元
const item = tableState.data.find(s => s.id === row.id); const item = tableState.data.find(s => s.id === row.id);
if (item && res.code === RESULT_CODE_SUCCESS) { if (item && res.code === RESULT_CODE_SUCCESS) {
item.neType = row.neType; item.neType = row.neType;
item.neId = row.neId; item.neUid = row.neUid;
item.rmUid = row.rmUid; item.coreUid = row.coreUid;
item.neName = row.neName; item.neName = row.neName;
item.ip = row.ip; item.ipAddr = row.ipAddr;
item.port = row.port; item.port = row.port;
if (res.data.online) { if (res.data.online) {
item.status = '1'; item.status = '1';
@@ -271,7 +278,9 @@ function reloadRowInfo(row: Record<string, any>) {
* 进行表达规则校验 * 进行表达规则校验
*/ */
function fnModalEditCancel() { function fnModalEditCancel() {
modalState.editId = 0; modalState.coreUid = '';
modalState.neUid = '';
modalState.neType = '';
modalState.openByEdit = false; modalState.openByEdit = false;
modalState.openByOAM = false; modalState.openByOAM = false;
modalState.openByBackConf = false; modalState.openByBackConf = false;
@@ -282,7 +291,7 @@ function fnModalEditCancel() {
* @param id 编号 * @param id 编号
*/ */
function fnRecordDelete(id: string) { function fnRecordDelete(id: string) {
if (!id || modalState.confirmLoading) return; if (modalState.confirmLoading) return;
let msg = t('views.ne.neInfo.delTip'); let msg = t('views.ne.neInfo.delTip');
if (id === '0') { if (id === '0') {
msg = `${msg} ...${tableState.selectedRowKeys.length}`; msg = `${msg} ...${tableState.selectedRowKeys.length}`;
@@ -295,9 +304,29 @@ function fnRecordDelete(id: string) {
onOk() { onOk() {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
delNeInfo(id) let reqArr: any = [];
.then(res => { if (id === '0') {
if (res.code === RESULT_CODE_SUCCESS) { tableState.selectedRows.forEach(item => {
reqArr.push(
delNeInfo({ coreUid: item.coreUid, neUid: item.neUid, id: item.id })
);
});
} else {
tableState.data.forEach(item => {
if (item.id === id) {
reqArr.push(
delNeInfo({
coreUid: item.coreUid,
neUid: item.neUid,
id: item.id,
})
);
}
});
}
Promise.all(reqArr)
.then(resArr => {
if (resArr.every((item: any) => item.code === RESULT_CODE_SUCCESS)) {
message.success(t('common.operateOk'), 3); message.success(t('common.operateOk'), 3);
// 过滤掉删除的id // 过滤掉删除的id
tableState.data = tableState.data.filter(item => { tableState.data = tableState.data.filter(item => {
@@ -311,7 +340,7 @@ function fnRecordDelete(id: string) {
neStore.fnNelistRefresh(); neStore.fnNelistRefresh();
} else { } else {
message.error({ message.error({
content: `${res.msg}`, content: t('common.operateErr'),
duration: 3, duration: 3,
}); });
} }
@@ -348,15 +377,17 @@ function fnRecordMore(type: string | number, row: Record<string, any>) {
fnNeLogFile(row); fnNeLogFile(row);
break; break;
case 'oam': case 'oam':
modalState.neId = row.neId; modalState.coreUid = row.coreUid;
modalState.neUid = row.neUid;
modalState.neType = row.neType; modalState.neType = row.neType;
modalState.openByOAM = !modalState.openByOAM; modalState.openByOAM = !modalState.openByOAM;
break; break;
case 'backConfExport': case 'backConfExport':
backConf.value.exportConf(row.neType, row.neId); backConf.value.exportConf(row.coreUid, row.neUid, row.neType);
break; break;
case 'backConfImport': case 'backConfImport':
modalState.neId = row.neId; modalState.coreUid = row.coreUid;
modalState.neUid = row.neUid;
modalState.neType = row.neType; modalState.neType = row.neType;
modalState.openByBackConf = !modalState.openByBackConf; modalState.openByBackConf = !modalState.openByBackConf;
break; break;
@@ -711,7 +742,9 @@ onMounted(() => {
<!-- 新增框或修改框 --> <!-- 新增框或修改框 -->
<EditModal <EditModal
v-model:open="modalState.openByEdit" v-model:open="modalState.openByEdit"
:edit-id="modalState.editId" :core-uid="modalState.coreUid"
:ne-uid="modalState.neUid"
:ne-type="modalState.neType"
@ok="fnModalEditOk" @ok="fnModalEditOk"
@cancel="fnModalEditCancel" @cancel="fnModalEditCancel"
></EditModal> ></EditModal>
@@ -719,7 +752,8 @@ onMounted(() => {
<!-- OAM编辑框 --> <!-- OAM编辑框 -->
<OAMModal <OAMModal
v-model:open="modalState.openByOAM" v-model:open="modalState.openByOAM"
:ne-id="modalState.neId" :core-uid="modalState.coreUid"
:ne-uid="modalState.neUid"
:ne-type="modalState.neType" :ne-type="modalState.neType"
@cancel="fnModalEditCancel" @cancel="fnModalEditCancel"
></OAMModal> ></OAMModal>
@@ -728,7 +762,8 @@ onMounted(() => {
<BackConfModal <BackConfModal
ref="backConf" ref="backConf"
v-model:open="modalState.openByBackConf" v-model:open="modalState.openByBackConf"
:ne-id="modalState.neId" :core-uid="modalState.coreUid"
:ne-uid="modalState.neUid"
:ne-type="modalState.neType" :ne-type="modalState.neType"
@cancel="fnModalEditCancel" @cancel="fnModalEditCancel"
></BackConfModal> ></BackConfModal>

View File

@@ -7,7 +7,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { import {
changeNeLicense, changeNeLicense,
getNeLicense, getNeLicense,
getNeLicenseByTypeAndID, getNeLicenseByNF,
} from '@/api/ne/neLicense'; } from '@/api/ne/neLicense';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface'; import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { FileType } from 'ant-design-vue/es/upload/interface'; import { FileType } from 'ant-design-vue/es/upload/interface';
@@ -22,13 +22,15 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
/**记录ID 优先级高于neId */ id: {
editId: {
type: Number, type: Number,
default: 0, default: 0,
}, },
/**网元ID */ coreUid: {
neId: { type: String,
default: '',
},
neUid: {
type: String, type: String,
default: '', default: '',
}, },
@@ -218,9 +220,9 @@ function fnDownCode() {
* 对话框弹出显示为 ID编辑 * 对话框弹出显示为 ID编辑
* @param id id * @param id id
*/ */
function fnModalVisibleById(id: number) { function fnModalVisibleById(coreUid: string, id: number) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
getNeLicense(id) getNeLicense(coreUid, id)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
Object.assign(modalState.from, res.data); Object.assign(modalState.from, res.data);
@@ -243,9 +245,9 @@ function fnModalVisibleById(id: number) {
* @param neType 网元类型 * @param neType 网元类型
* @param neId 网元ID * @param neId 网元ID
*/ */
function fnModalVisibleByTypeAndId(neType: string, neId: string) { function fnModalVisibleByTypeAndId(coreUid: string, neUid: string) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
getNeLicenseByTypeAndID(neType, neId) getNeLicenseByNF(coreUid, neUid)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
Object.assign(modalState.from, res.data); Object.assign(modalState.from, res.data);
@@ -267,12 +269,13 @@ function fnModalVisibleByTypeAndId(neType: string, neId: string) {
watch( watch(
() => props.open, () => props.open,
val => { val => {
if (val) { console.log(props);
if (props.editId > 0) { if (val && props.coreUid) {
fnModalVisibleById(props.editId); if (props.neUid) {
fnModalVisibleByTypeAndId(props.coreUid, props.neUid);
} }
if (props.neType && props.neId) { if (props.id) {
fnModalVisibleByTypeAndId(props.neType, props.neId); fnModalVisibleById(props.coreUid, props.id);
} }
} }
} }
@@ -314,7 +317,7 @@ onMounted(() => {});
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label-col="{ span: 12 }" :label-col="{ span: 12 }"
:label="t('views.ne.common.neId')" :label="t('views.ne.common.neUid')"
name="neId" name="neId"
> >
{{ modalState.from.neId }} {{ modalState.from.neId }}

View File

@@ -1,5 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, toRaw, defineAsyncComponent } from 'vue'; import {
reactive,
ref,
onMounted,
toRaw,
defineAsyncComponent,
nextTick,
} from 'vue';
import { PageContainer } from 'antdv-pro-layout'; import { PageContainer } from 'antdv-pro-layout';
import { Modal, TableColumnsType, message } from 'ant-design-vue/es'; import { Modal, TableColumnsType, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
@@ -10,6 +17,7 @@ import useDictStore from '@/store/modules/dict';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { listNeLicense, stateNeLicense } from '@/api/ne/neLicense'; import { listNeLicense, stateNeLicense } from '@/api/ne/neLicense';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { t } = useI18n(); const { t } = useI18n();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const neStore = useNeStore(); const neStore = useNeStore();
@@ -22,10 +30,10 @@ let dictStatus = ref<DictType[]>([]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**核心网标识 */
coreUid: currentCoreUid(),
/**网元类型 */ /**网元类型 */
neType: undefined, neType: undefined,
/**网元ID */
neId: '',
/**序列号 */ /**序列号 */
serialNum: '', serialNum: '',
/**当前页数 */ /**当前页数 */
@@ -38,7 +46,6 @@ let queryParams = reactive({
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
neType: undefined, neType: undefined,
neId: '',
serialNum: '', serialNum: '',
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
@@ -79,12 +86,6 @@ let tableColumns = ref<TableColumnsType>([
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{ {
title: t('views.ne.neLicense.status'), title: t('views.ne.neLicense.status'),
dataIndex: 'status', dataIndex: 'status',
@@ -105,8 +106,8 @@ let tableColumns = ref<TableColumnsType>([
width: 120, width: 120,
}, },
{ {
title: t('views.ne.common.capability'), title: t('views.ne.common.ueNumber'),
dataIndex: 'capability', dataIndex: 'ueNumber',
align: 'left', align: 'left',
customRender(opt) { customRender(opt) {
if (['UDM', 'AMF', 'MME'].includes(opt.record.neType)) { if (['UDM', 'AMF', 'MME'].includes(opt.record.neType)) {
@@ -116,6 +117,18 @@ let tableColumns = ref<TableColumnsType>([
}, },
width: 100, width: 100,
}, },
{
title: t('views.ne.common.nbNumber'),
dataIndex: 'nbNumber',
align: 'left',
customRender(opt) {
if (['AMF', 'MME'].includes(opt.record.neType)) {
return opt.value;
}
return '-';
},
width: 100,
},
{ {
title: t('common.remark'), title: t('common.remark'),
dataIndex: 'remark', dataIndex: 'remark',
@@ -216,8 +229,9 @@ function fnGetList(pageNum?: number) {
type ModalStateType = { type ModalStateType = {
/**新增框或修改框是否显示 */ /**新增框或修改框是否显示 */
openByEdit: boolean; openByEdit: boolean;
/**授权记录ID */ coreUid: string;
licenseId: number; neUid: string;
neType: string;
/**确定按钮 loading */ /**确定按钮 loading */
confirmLoading: boolean; confirmLoading: boolean;
}; };
@@ -225,17 +239,23 @@ type ModalStateType = {
/**对话框对象信息状态 */ /**对话框对象信息状态 */
let modalState: ModalStateType = reactive({ let modalState: ModalStateType = reactive({
openByEdit: false, openByEdit: false,
licenseId: 0, coreUid: '',
neUid: '',
neType: '',
confirmLoading: false, confirmLoading: false,
}); });
/** /**
* 对话框弹出显示为 新增或者修改 * 对话框弹出显示为 新增或者修改
* @param licenseId id * @param row id
*/ */
function fnModalVisibleByEdit(licenseId: number) { function fnModalVisibleByEdit(row: Record<string, any>) {
modalState.licenseId = licenseId; modalState.coreUid = row.coreUid;
modalState.openByEdit = true; modalState.neUid = row.neUid;
modalState.neType = row.neType;
nextTick(() => {
modalState.openByEdit = true;
});
} }
/** /**
@@ -243,13 +263,9 @@ function fnModalVisibleByEdit(licenseId: number) {
* 进行表达规则校验 * 进行表达规则校验
*/ */
function fnModalOk(e: any) { function fnModalOk(e: any) {
const next = () => { // 刷新授权状态
// 刷新授权状态 stateNeLicense(e.coreUid, e.neUid);
stateNeLicense(e.neType, e.neId); setTimeout(() => fnGetList(), 2_000);
// 获取列表数据
fnGetList();
};
setTimeout(() => next(), 2_000);
} }
/** /**
@@ -258,7 +274,9 @@ function fnModalOk(e: any) {
*/ */
function fnModalCancel() { function fnModalCancel() {
modalState.openByEdit = false; modalState.openByEdit = false;
modalState.licenseId = 0; modalState.coreUid = '';
modalState.neUid = '';
modalState.neType = '';
} }
/**刷新网元授权状态 */ /**刷新网元授权状态 */
@@ -270,22 +288,23 @@ function fnRecordState(row: Record<string, any>) {
onOk() { onOk() {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
stateNeLicense(row.neType, row.neId) stateNeLicense(row.coreUid, row.neUid)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
row.status = '1'; row.status = '1';
row.serialNum = res.data.sn; row.serialNum = res.data.sn;
row.expiryDate = res.data.expire; row.expiryDate = res.data.expire;
row.capability = res.data.capability; row.ueNumber = res.data.ueNumber;
row.nbNumber = res.data.nbNumber;
row.updateTime = new Date().getTime(); row.updateTime = new Date().getTime();
message.success( message.success(
`${row.neType} ${row.neId} ${dictStatus.value[1].label}`, `${row.id} ${row.neType} ${dictStatus.value[1].label}`,
3 3
); );
} else { } else {
row.status = '0'; row.status = '0';
message.warning( message.warning(
`${row.neType} ${row.neId} ${dictStatus.value[0].label}`, `${row.id} ${row.neType} ${dictStatus.value[0].label}`,
3 3
); );
} }
@@ -311,7 +330,7 @@ function fnRecordStateReload() {
if (row.neType.toUpperCase() === 'OMC') { if (row.neType.toUpperCase() === 'OMC') {
continue; continue;
} }
await stateNeLicense(row.neType, row.neId); await stateNeLicense(row.coreUid, row.neUid);
} }
hide(); hide();
message.success(t('common.operateOk'), 3); message.success(t('common.operateOk'), 3);
@@ -354,15 +373,6 @@ onMounted(() => {
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.ne.common.neId')" name="neId">
<a-input
v-model:value="queryParams.neId"
:allow-clear="true"
:placeholder="t('common.inputPlease')"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.ne.common.serialNum')" :label="t('views.ne.common.serialNum')"
@@ -483,7 +493,7 @@ onMounted(() => {
<template #title>{{ t('views.ne.neLicense.change') }}</template> <template #title>{{ t('views.ne.neLicense.change') }}</template>
<a-button <a-button
type="link" type="link"
@click.prevent="fnModalVisibleByEdit(record.id)" @click.prevent="fnModalVisibleByEdit(record)"
> >
<template #icon><UploadOutlined /> </template> <template #icon><UploadOutlined /> </template>
</a-button> </a-button>
@@ -497,7 +507,9 @@ onMounted(() => {
<!-- 文件上传框 --> <!-- 文件上传框 -->
<EditModal <EditModal
v-model:open="modalState.openByEdit" v-model:open="modalState.openByEdit"
:edit-id="modalState.licenseId" :core-uid="modalState.coreUid"
:ne-uid="modalState.neUid"
:ne-type="modalState.neType"
@ok="fnModalOk" @ok="fnModalOk"
@cancel="fnModalCancel" @cancel="fnModalCancel"
></EditModal> ></EditModal>

View File

@@ -23,6 +23,7 @@ import useAppStore from '@/store/modules/app';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import { listAllNeInfo } from '@/api/ne/neInfo'; import { listAllNeInfo } from '@/api/ne/neInfo';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import { currentCoreUid } from '@/hooks/useCoreUid';
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const appStore = useAppStore(); const appStore = useAppStore();
const route = useRoute(); const route = useRoute();
@@ -126,7 +127,10 @@ let serverState: any = ref({});
async function fnGetList(reload: boolean = false) { async function fnGetList(reload: boolean = false) {
tableState.loading = !reload; tableState.loading = !reload;
try { try {
const res = await listAllNeInfo({ bandStatus: true }); const res = await listAllNeInfo({
coreUid: currentCoreUid(),
bandStatus: true,
});
tableState.data = res.data; tableState.data = res.data;
} catch (error) { } catch (error) {
console.error(error); console.error(error);
@@ -151,10 +155,10 @@ async function fnGetList(reload: boolean = false) {
if (!reload) { if (!reload) {
// //
if (tableState.data.length > 0) { if (tableState.data.length > 0) {
const item = tableState.data.find((item: any) => item.status === 1) const item = tableState.data.find((item: any) => item.status === 1);
if (item) { if (item) {
const id = item.id; const id = item.id;
fnTableSelectedRowKeys([id]); fnTableSelectedRowKeys([id]);
} }
} else { } else {
fnTableSelectedRowKeys(tableState.selectedRowKeys); fnTableSelectedRowKeys(tableState.selectedRowKeys);
@@ -250,8 +254,8 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
serverState.value = Object.assign( serverState.value = Object.assign(
{ {
// cpuUse: `NE:${nfCpuP}%; SYS:${sysCpuP}%`, // cpuUse: `NE:${nfCpuP}%; SYS:${sysCpuP}%`,
// memoryUse: `Total: ${totalMemInMB}MB; NE: ${nfUsedMemInMB}MB; SYS: ${sysMemUsageInMB}MB`, // memoryUse: `Total: ${totalMemInMB}MB; NE: ${nfUsedMemInMB}MB; SYS: ${sysMemUsageInMB}MB`,
}, },
neState neState
); );

View File

@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { Form, Modal, message } from 'ant-design-vue/es'; import { Form, Modal, message } from 'ant-design-vue/es';
import { onMounted, reactive, toRaw } from 'vue'; import { onMounted, reactive, toRaw } from 'vue';
import { addNeInfo, getNeInfoByTypeAndID, updateNeInfo } from '@/api/ne/neInfo'; import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { NE_TYPE_LIST } from '@/constants/ne-constants'; import { NE_TYPE_LIST } from '@/constants/ne-constants';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
@@ -9,6 +9,8 @@ import { fnRestStepState, fnToStepName, stepState } from '../hooks/useStep';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import useNeStore from '@/store/modules/ne'; import useNeStore from '@/store/modules/ne';
import { currentCoreUid } from '@/hooks/useCoreUid';
import { getNeInfoByNF } from '@/api/ne/neAction';
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const neStore = useNeStore(); const neStore = useNeStore();
const { t } = useI18n(); const { t } = useI18n();
@@ -51,8 +53,8 @@ let modalState: ModalStateType = reactive({
ip: '', ip: '',
port: 33030, port: 33030,
pvFlag: 'PNF', pvFlag: 'PNF',
rmUid: '4400HXAMF001', coreUid: currentCoreUid(),
neAddress: '', macAddr: '',
dn: '-', dn: '-',
vendorName: '-', vendorName: '-',
province: 'Area', province: 'Area',
@@ -102,7 +104,7 @@ const modalStateFrom = Form.useForm(
neId: [ neId: [
{ {
required: true, required: true,
message: t('views.ne.common.neIdPlease'), message: t('views.ne.common.neUidPlease'),
}, },
], ],
ip: [ ip: [
@@ -146,7 +148,7 @@ function fnModalOk() {
.validate() .validate()
.then(e => { .then(e => {
modalState.confirmLoading = true; modalState.confirmLoading = true;
return getNeInfoByTypeAndID(from.neType, from.neId); return getNeInfoByNF(from.coreUid, from.neUid);
}) })
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
@@ -378,7 +380,7 @@ onMounted(() => {
</a-col> </a-col>
<a-col :lg="6" :md="6" :xs="24"> <a-col :lg="6" :md="6" :xs="24">
<a-form-item <a-form-item
:label="t('views.ne.common.neId')" :label="t('views.ne.common.neUid')"
name="neId" name="neId"
v-bind="modalStateFrom.validateInfos.neId" v-bind="modalStateFrom.validateInfos.neId"
> >
@@ -391,7 +393,7 @@ onMounted(() => {
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.ne.common.neIdTip') }} {{ t('views.ne.common.neUidTip') }}
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>

Some files were not shown because too many files have changed in this diff Show More