ref: v3变更,,同步v2.2508.4
@@ -6,12 +6,13 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
* 获取活动告警数
|
||||
* @returns object
|
||||
*/
|
||||
export async function getActiveAlarmTotal() {
|
||||
export async function getActiveAlarmTotal(coreUid: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/neData/alarm/list`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
coreUid: coreUid,
|
||||
alarmStatus: 'Active',
|
||||
sortField: 'event_time',
|
||||
sortOrder: 'desc',
|
||||
@@ -42,18 +43,15 @@ export async function listAct(query: Record<string, any>) {
|
||||
|
||||
/**
|
||||
* 确认告警信息
|
||||
* @param ids 记录ID
|
||||
* @param id 记录ID
|
||||
* @param state 状态 true确认 false取消确认
|
||||
* @returns object
|
||||
*/
|
||||
export function ackAlarm(ids: number[], state: boolean) {
|
||||
export function ackAlarm(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/neData/alarm/ack'`,
|
||||
method: 'PUT',
|
||||
data: {
|
||||
ids: ids,
|
||||
ackState: state,
|
||||
},
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -105,14 +103,14 @@ export function getPass() {
|
||||
|
||||
/**
|
||||
* 清除告警信息
|
||||
* @param ids 记录ID
|
||||
* @param id 记录ID
|
||||
* @returns object
|
||||
*/
|
||||
export function clearAlarm(ids: number[]) {
|
||||
export function clearAlarm(id: number, coreUid: string) {
|
||||
return request({
|
||||
url: `/neData/alarm/clear`,
|
||||
method: 'PUT',
|
||||
data: { ids },
|
||||
data: { id, coreUid },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -193,11 +191,12 @@ export async function exportAll(query: Record<string, any>) {
|
||||
* @param query 查询参数
|
||||
* @returns bolb
|
||||
*/
|
||||
export async function origGet() {
|
||||
export async function origGet(coreUid: string) {
|
||||
return await request({
|
||||
url: `/neData/alarm/count/severity`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
coreUid: coreUid,
|
||||
alarmStatus: 'Active',
|
||||
},
|
||||
});
|
||||
@@ -208,11 +207,12 @@ export async function origGet() {
|
||||
* @param filterFlag 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export async function top3Sel() {
|
||||
export async function top3Sel(coreUid: string) {
|
||||
return await request({
|
||||
url: `/neData/alarm/count/ne`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
coreUid: coreUid,
|
||||
alarmStatus: 'Active',
|
||||
top: 3,
|
||||
},
|
||||
|
||||
100
src/api/ne/neAction.ts
Normal 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,
|
||||
});
|
||||
}
|
||||
@@ -33,11 +33,11 @@ export function updateNeConfigBackup(data: Record<string, any>) {
|
||||
* @param id 记录ID
|
||||
* @returns object
|
||||
*/
|
||||
export async function downNeConfigBackup(id: string) {
|
||||
export async function downNeConfigBackup(query: Record<string, any>) {
|
||||
return await request({
|
||||
url: '/ne/config/backup/download',
|
||||
method: 'GET',
|
||||
params: { id },
|
||||
params: query,
|
||||
responseType: 'blob',
|
||||
timeout: 180_000,
|
||||
});
|
||||
@@ -48,11 +48,11 @@ export async function downNeConfigBackup(id: string) {
|
||||
* @param id 记录ID
|
||||
* @returns object
|
||||
*/
|
||||
export async function delNeConfigBackup(id: string) {
|
||||
export async function delNeConfigBackup(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/config/backup',
|
||||
method: 'DELETE',
|
||||
params: { id },
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,11 @@ export function listNeInfo(query: Record<string, any>) {
|
||||
* @param infoId 信息ID
|
||||
* @returns object
|
||||
*/
|
||||
export function getNeInfo(infoId: string | number) {
|
||||
export function getNeInfo(coreUid: string, id: string | number) {
|
||||
return request({
|
||||
url: `/ne/info/${infoId}`,
|
||||
url: `/ne/info`,
|
||||
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
|
||||
*/
|
||||
export function delNeInfo(infoIds: string | number) {
|
||||
export function delNeInfo(query: Record<string, any>) {
|
||||
return request({
|
||||
url: `/ne/info/${infoIds}`,
|
||||
url: `/ne/info`,
|
||||
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,
|
||||
timeout: 60_000,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网元状态
|
||||
* @param neType 网元类型
|
||||
* @param neId 网元ID
|
||||
* 查询网元列表全部无分页
|
||||
* @param query 查询参数 coreUid, neUid bandStatus bandHost
|
||||
* @returns object
|
||||
*/
|
||||
export function stateNeInfo(neType: string, neId: string) {
|
||||
export function listAllNeInfo(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/info/state',
|
||||
url: '/ne/info/list/all',
|
||||
method: 'GET',
|
||||
params: { neType, neId },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网元信息
|
||||
* @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,
|
||||
params: query,
|
||||
timeout: 60_000,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,24 +19,25 @@ export function listNeLicense(query: Record<string, any>) {
|
||||
* @param licenseId 信息ID
|
||||
* @returns object
|
||||
*/
|
||||
export function getNeLicense(licenseId: string | number) {
|
||||
export function getNeLicense(coreUid: string, id: string | number) {
|
||||
return request({
|
||||
url: `/ne/license/${licenseId}`,
|
||||
url: `/ne/license`,
|
||||
method: 'GET',
|
||||
params: { coreUid, id },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 网元neType和neID查询
|
||||
* @param neType 网元类型
|
||||
* @param neId 网元ID
|
||||
* @param neUid 网元ID
|
||||
* @returns object
|
||||
*/
|
||||
export function getNeLicenseByTypeAndID(neType: string, neId: string) {
|
||||
export function getNeLicenseByNF(coreUid: string, neUid: string) {
|
||||
return request({
|
||||
url: `/ne/license/byTypeAndID`,
|
||||
url: `/ne/license/nf`,
|
||||
method: 'GET',
|
||||
params: { neType, neId },
|
||||
params: { coreUid, neUid },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,14 +71,14 @@ export function changeNeLicense(data: Record<string, any>) {
|
||||
|
||||
/**
|
||||
* 网元授权激活状态
|
||||
* @param neType 网元类型
|
||||
* @param neId 网元id
|
||||
* @param coreUid 核心uid
|
||||
* @param neUid 网元uid
|
||||
* @returns object
|
||||
*/
|
||||
export function stateNeLicense(neType: string, neId: string) {
|
||||
export function stateNeLicense(coreUid: string, neUid: string) {
|
||||
return request({
|
||||
url: `/ne/license/state`,
|
||||
method: 'GET',
|
||||
params: { neType, neId },
|
||||
params: { coreUid, neUid },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
|
||||
// 更新网元配置重新载入
|
||||
export function updateNeConfigReload(neType: string, neId: string) {
|
||||
export function updateNeConfigReload(coreUid: string, neUid: string) {
|
||||
return request({
|
||||
url: '/tool/mml/command',
|
||||
method: 'POST',
|
||||
data: {
|
||||
neType: neType,
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
type: 'General',
|
||||
command: ['reload'],
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
*/
|
||||
export function listNeFiles(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/action/files',
|
||||
url: '/ne/action/file/list',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
});
|
||||
@@ -20,7 +20,7 @@ export function listNeFiles(query: Record<string, any>) {
|
||||
*/
|
||||
export function getNeFile(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/action/pullFile',
|
||||
url: '/ne/action/file/pull',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
responseType: 'blob',
|
||||
@@ -31,7 +31,7 @@ export function getNeFile(query: Record<string, any>) {
|
||||
// 从网元到本地获取目录压缩为ZIP
|
||||
export function getNeDirZip(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/action/pullDirZip',
|
||||
url: '/ne/action/file/pull/dirzip',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
responseType: 'blob',
|
||||
@@ -42,7 +42,7 @@ export function getNeDirZip(data: Record<string, any>) {
|
||||
// 查看网元端文件内容
|
||||
export function getNeViewFile(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/action/viewFile',
|
||||
url: '/ne/action/file/view',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
timeout: 60_000,
|
||||
|
||||
@@ -20,10 +20,11 @@ export async function listTraceTask(query: Record<string, any>) {
|
||||
* @param id 网元ID
|
||||
* @returns object
|
||||
*/
|
||||
export async function getTraceTask(id: string | number) {
|
||||
export async function getTraceTask(coreUid: string, id: string | number) {
|
||||
return request({
|
||||
url: `/trace/task/${id}`,
|
||||
url: `/trace/task`,
|
||||
method: 'GET',
|
||||
params: { coreUid, id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,10 +59,11 @@ export function updateTraceTask(data: Record<string, any>) {
|
||||
* @param ids ID多个逗号分隔
|
||||
* @returns object
|
||||
*/
|
||||
export async function delTraceTask(ids: string) {
|
||||
export async function delTraceTask(coreUid: string, id: string | number) {
|
||||
return request({
|
||||
url: `/trace/task/${ids}`,
|
||||
url: `/trace/task`,
|
||||
method: 'DELETE',
|
||||
params: { coreUid, id },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,16 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
/**网元ID,必传 */
|
||||
neId: {
|
||||
neUid: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
/**核心网标识 */
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
/**窗口单行字符数 */
|
||||
cols: {
|
||||
type: Number,
|
||||
@@ -111,7 +117,8 @@ function wsOpen(ev: any) {
|
||||
cols: terminal.value.cols,
|
||||
rows: terminal.value.rows,
|
||||
neType: props.neType,
|
||||
neId: props.neId,
|
||||
neUid: props.neUid,
|
||||
coreUid: props.coreUid,
|
||||
id: props.id,
|
||||
});
|
||||
});
|
||||
@@ -142,7 +149,8 @@ function wsClose(code: number) {
|
||||
emit('close', {
|
||||
code: code,
|
||||
neType: props.neType,
|
||||
neId: props.neId,
|
||||
neUid: props.neUid,
|
||||
coreUid: props.coreUid,
|
||||
id: props.id,
|
||||
});
|
||||
}
|
||||
@@ -161,8 +169,8 @@ function wsMessage(res: Record<string, any>) {
|
||||
let text = '';
|
||||
// 处理消息
|
||||
if (props.processMessages) {
|
||||
text = props.processMessages(data);
|
||||
}else{
|
||||
text = props.processMessages(data);
|
||||
} else {
|
||||
text = processMessage(data);
|
||||
}
|
||||
// 无消息是则不输出
|
||||
@@ -202,13 +210,14 @@ function processMessage(data: string): string {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.neType && props.neId) {
|
||||
if (props.neType && props.neUid && props.coreUid) {
|
||||
// 建立链接
|
||||
const options: OptionsType = {
|
||||
url: props.url,
|
||||
params: {
|
||||
neType: props.neType,
|
||||
neId: props.neId,
|
||||
neUid: props.neUid,
|
||||
coreUid: props.coreUid,
|
||||
cols: props.cols,
|
||||
rows: props.rows,
|
||||
},
|
||||
|
||||
@@ -7,6 +7,9 @@ export const CACHE_SESSION_FATCH = 'cache:session:fatch';
|
||||
/**会话缓存-当前选中核心网 */
|
||||
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';
|
||||
|
||||
|
||||
@@ -22,6 +22,12 @@ export const NE_TYPE_LIST = [
|
||||
'CHF',
|
||||
'HLR',
|
||||
'SGWC',
|
||||
'PGWC',
|
||||
'IP-SM-GW',
|
||||
'MMTel-AS',
|
||||
'I-CSCF',
|
||||
'P-CSCF',
|
||||
'S-CSCF',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
10
src/hooks/useCoreUid.ts
Normal 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) || '';
|
||||
}
|
||||
@@ -525,9 +525,9 @@ export default {
|
||||
neType: 'NE Type',
|
||||
neTypePlease: "Please select network element type",
|
||||
neTypeTip: 'Fill in the type of network element to be created, e.g. SMF.',
|
||||
neId: 'NE ID',
|
||||
neIdPlease: 'Please enter the network element identification',
|
||||
neIdTip: 'Fill in the unique identifier of the network element binding',
|
||||
neUid: 'NE UID',
|
||||
neUidPlease: 'Please enter the network element identification',
|
||||
neUidTip: 'Fill in the unique identifier of the network element binding',
|
||||
rmUid: 'Resource Unique ID',
|
||||
rmUidPlease: 'Please enter a resource unique ID',
|
||||
rmUidTip: "Tagging for data reporting of network element logs, alarms, metrics, etc.",
|
||||
@@ -539,6 +539,8 @@ export default {
|
||||
port: 'Port',
|
||||
portTip: "Network element port default:33030",
|
||||
capability: 'Capability',
|
||||
ueNumber: 'UE Number',
|
||||
nbNumber: 'Radio Number',
|
||||
serialNum: 'Serial Number',
|
||||
expiryDate: 'Expiry Date',
|
||||
normalcy: 'Normal',
|
||||
@@ -565,13 +567,13 @@ export default {
|
||||
sysDisk: "SYS Store",
|
||||
neCpu: "NE CPU",
|
||||
hostConfig: "Connection Configuration",
|
||||
pvflag: 'NE Virtualization',
|
||||
pvflag: 'Virtual Flag',
|
||||
pnf: 'physical network element',
|
||||
vnf: 'virtual network element',
|
||||
neAddress: 'MAC',
|
||||
neAddressTip: 'Record the physical address (MAC) of the network card of the network element',
|
||||
dn: 'network identifier',
|
||||
vendorName: 'provider',
|
||||
macAddr: 'MAC',
|
||||
macAddrTip: 'Record the physical address (MAC) of the network card of the network element',
|
||||
dn: 'Network Identifier',
|
||||
vendorName: 'Provider',
|
||||
province: 'Service Area',
|
||||
addTitle: 'New network element information',
|
||||
editTitle: 'Edit network element information',
|
||||
@@ -1291,8 +1293,6 @@ export default {
|
||||
mml:{
|
||||
account:'Account',
|
||||
ip:'IP',
|
||||
type:'NE Type',
|
||||
neId:'NE ID',
|
||||
MML:'MML',
|
||||
logTime:'Log Time'
|
||||
},
|
||||
|
||||
@@ -525,9 +525,9 @@ export default {
|
||||
neType: '网元类型',
|
||||
neTypePlease: "请选择网元类型",
|
||||
neTypeTip: '填写创建的网元类型,如:SMF',
|
||||
neId: '网元标识',
|
||||
neIdPlease: '请输入网元标识',
|
||||
neIdTip: '填写网元绑定的唯一标识',
|
||||
neUid: '网元标识',
|
||||
neUidPlease: '请输入网元标识',
|
||||
neUidTip: '填写网元绑定的唯一标识',
|
||||
rmUid: '资源唯一标识',
|
||||
rmUidPlease: '请输入资源唯一标识',
|
||||
rmUidTip: "用于网元日志、告警、指标等数据上报的标记",
|
||||
@@ -539,6 +539,8 @@ export default {
|
||||
port: '服务端口',
|
||||
portTip: "网元服务端口,默认:33030",
|
||||
capability: '容量',
|
||||
ueNumber: '用户数',
|
||||
nbNumber: '基站数',
|
||||
serialNum: '序列号',
|
||||
expiryDate: '许可证到期日期',
|
||||
normalcy: '正常',
|
||||
@@ -565,11 +567,11 @@ export default {
|
||||
sysDisk: "系统存储",
|
||||
neCpu: "网元CPU",
|
||||
hostConfig: "终端连接配置",
|
||||
pvflag: '网元虚拟化标识',
|
||||
pvflag: '虚拟化标识',
|
||||
pnf: '物理网元',
|
||||
vnf: '虚拟网元',
|
||||
neAddress: '物理地址(MAC)',
|
||||
neAddressTip: '记录网元的网卡物理地址(MAC)',
|
||||
macAddr: '物理地址(MAC)',
|
||||
macAddrTip: '记录网元的网卡物理地址(MAC)',
|
||||
dn: '网络标识',
|
||||
vendorName: '提供厂商',
|
||||
province: '服务地域',
|
||||
@@ -1291,8 +1293,6 @@ export default {
|
||||
mml:{
|
||||
account:'登录账号',
|
||||
ip:'IP地址',
|
||||
type:'网元类型',
|
||||
neId:'网元唯一标识',
|
||||
MML:'MML',
|
||||
logTime:'记录时间'
|
||||
},
|
||||
|
||||
@@ -270,6 +270,7 @@ onUnmounted(() => {
|
||||
v-bind="proConfig"
|
||||
:iconfont-url="scriptUrl"
|
||||
:locale="fnLocale"
|
||||
:sider-width="256"
|
||||
>
|
||||
<!--插槽-菜单头-->
|
||||
<template #menuHeaderRender>
|
||||
|
||||
@@ -19,7 +19,7 @@ const router = useRouter();
|
||||
|
||||
/**告警数按钮提示跳转 */
|
||||
function fnClickAlarm() {
|
||||
router.push({ name: 'ActiveAlarm_2088' });
|
||||
router.push({ name: 'Active_2088' });
|
||||
}
|
||||
|
||||
/**改变主题色 */
|
||||
|
||||
@@ -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>
|
||||
@@ -59,7 +59,7 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
path: '/trace-task-hlr',
|
||||
name: 'TraceTaskHLR', // 跟踪任务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',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { getActiveAlarmTotal } from '@/api/faultManage/actAlarm';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
/**告警数据信息类型 */
|
||||
@@ -15,8 +16,8 @@ const useAlarmStore = defineStore('alarm', {
|
||||
getters: {},
|
||||
actions: {
|
||||
// 获取活动告警数
|
||||
async fnGetActiveAlarmInfo() {
|
||||
const res = await getActiveAlarmTotal();
|
||||
async fnGetActiveAlarmInfo() {
|
||||
const res = await getActiveAlarmTotal(currentCoreUid());
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
this.activeAlarmTotal = res.data;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,15 @@ import {
|
||||
} from '@/constants/result-constants';
|
||||
import { defineStore } from 'pinia';
|
||||
import { listAllCoreInfo } from '@/api/core/coreInfo';
|
||||
import { localGetJSON, localSetJSON } from '@/utils/cache-local-utils';
|
||||
import { CACHE_SESSION_CORE } from '@/constants/cache-keys-constants';
|
||||
import {
|
||||
sessionGetJSON,
|
||||
sessionSet,
|
||||
sessionSetJSON,
|
||||
} from '@/utils/cache-session-utils';
|
||||
import {
|
||||
CACHE_SESSION_CORE,
|
||||
CACHE_SESSION_CORE_UID,
|
||||
} from '@/constants/cache-keys-constants';
|
||||
|
||||
/**核心网信息类型 */
|
||||
type Core = {
|
||||
@@ -20,10 +27,7 @@ type Core = {
|
||||
const useCoreStore = defineStore('core', {
|
||||
state: (): Core => ({
|
||||
coreList: [],
|
||||
current: localGetJSON(CACHE_SESSION_CORE) || {
|
||||
label: 'Global',
|
||||
value: 'all',
|
||||
},
|
||||
current: sessionGetJSON(CACHE_SESSION_CORE),
|
||||
coreSelectOtions: [],
|
||||
}),
|
||||
getters: {
|
||||
@@ -32,9 +36,10 @@ const useCoreStore = defineStore('core', {
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setCurrent(value: Record<string, any> = {}) {
|
||||
this.current = value;
|
||||
localSetJSON(CACHE_SESSION_CORE, value);
|
||||
setCurrent(v: Record<string, any> = {}) {
|
||||
this.current = v;
|
||||
sessionSetJSON(CACHE_SESSION_CORE, v);
|
||||
sessionSet(CACHE_SESSION_CORE_UID, v.value);
|
||||
},
|
||||
// 刷新核心网列表
|
||||
async fnCorelistRefresh() {
|
||||
@@ -64,6 +69,13 @@ const useCoreStore = defineStore('core', {
|
||||
};
|
||||
});
|
||||
}
|
||||
// 当前未选择时
|
||||
if (!this.current) {
|
||||
this.setCurrent({
|
||||
label: 'Global',
|
||||
value: 'YYMMDDHH',
|
||||
});
|
||||
}
|
||||
return res;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -70,9 +70,9 @@ const proRender = (render: any) => (render === false ? false : undefined);
|
||||
const proConfigLocal: LayoutStore['proConfig'] = localGetJSON(
|
||||
CACHE_LOCAL_PROCONFIG
|
||||
) || {
|
||||
layout: 'mix',
|
||||
layout: 'side',
|
||||
theme: 'light',
|
||||
menuTheme: 'light',
|
||||
menuTheme: 'dark',
|
||||
fixSiderbar: true,
|
||||
fixedHeader: true,
|
||||
splitMenus: true,
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
} from '@/constants/result-constants';
|
||||
import { listAllNeInfo } from '@/api/ne/neInfo';
|
||||
import { parseDataToOptions } from '@/utils/parse-tree-utils';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
|
||||
/**网元信息类型 */
|
||||
type Ne = {
|
||||
@@ -65,6 +66,7 @@ const useNeStore = defineStore('ne', {
|
||||
};
|
||||
}
|
||||
const res = await listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: false,
|
||||
bandHost: false,
|
||||
});
|
||||
@@ -77,7 +79,7 @@ const useNeStore = defineStore('ne', {
|
||||
res.data,
|
||||
'neType',
|
||||
'neName',
|
||||
'neId'
|
||||
'neUid'
|
||||
);
|
||||
this.neCascaderOptions = options;
|
||||
|
||||
|
||||
@@ -177,25 +177,6 @@ export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any {
|
||||
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
|
||||
|
||||
@@ -26,6 +26,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { readLoalXlsx } from '@/utils/execl-utils';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import dayjs, { type Dayjs } from 'dayjs';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { getDict } = useDictStore();
|
||||
const { t, currentLocale } = useI18n();
|
||||
@@ -70,27 +71,23 @@ let rangePickerPresets = ref([
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
alarmStatus: 'Active',
|
||||
sortField: 'event_time',
|
||||
sortOrder: 'desc',
|
||||
/**告警设备类型 */
|
||||
neType: '',
|
||||
/**告警网元名称 */
|
||||
neName: '',
|
||||
/**告警网元标识 */
|
||||
neId: '',
|
||||
/**告警编号 */
|
||||
alarmCode: '',
|
||||
/**告警级别 */
|
||||
origSeverity: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**告警产生时间开始时间 */
|
||||
beginTime: undefined as undefined | number,
|
||||
/**告警产生时间结束时间 */
|
||||
endTime: undefined as undefined | number,
|
||||
/**虚拟化标识 */
|
||||
pvFlag: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
@@ -105,22 +102,19 @@ function fnQueryReset() {
|
||||
alarmStatus: 'Active',
|
||||
/**告警设备类型 */
|
||||
neType: '',
|
||||
/**告警网元名称 */
|
||||
neName: '',
|
||||
/**告警网元标识 */
|
||||
neId: '',
|
||||
/**告警编号 */
|
||||
alarmCode: '',
|
||||
/**告警级别 */
|
||||
origSeverity: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**告警产生时间 */
|
||||
beginTime: undefined,
|
||||
endTime: undefined,
|
||||
/**虚拟化标识 */
|
||||
pvFlag: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
});
|
||||
queryRangePicker.value = undefined;
|
||||
tablePagination.current = 1;
|
||||
@@ -140,6 +134,8 @@ type TabeStateType = {
|
||||
data: object[];
|
||||
/**勾选记录 */
|
||||
selectedRowKeys: (string | number)[];
|
||||
/**勾选记录 */
|
||||
selectedRows: Record<string, any>[];
|
||||
};
|
||||
|
||||
/**表格状态 */
|
||||
@@ -149,6 +145,7 @@ let tableState: TabeStateType = reactive({
|
||||
seached: false,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
});
|
||||
|
||||
/**过滤设置 */
|
||||
@@ -164,6 +161,7 @@ let alarmTableState: TabeStateType = reactive({
|
||||
seached: true,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
});
|
||||
|
||||
/**表格字段列 */
|
||||
@@ -221,18 +219,6 @@ let tableColumns: ColumnsType = [
|
||||
align: 'left',
|
||||
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'),
|
||||
key: 'id',
|
||||
@@ -375,7 +361,6 @@ let modalState: ModalStateType = reactive({
|
||||
from: {
|
||||
alarmId: '',
|
||||
alarmSeq: '',
|
||||
neId: '',
|
||||
neName: '',
|
||||
neType: '',
|
||||
alarmCode: '',
|
||||
@@ -455,7 +440,11 @@ function fnModalOk() {
|
||||
return false;
|
||||
}
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
ackAlarm([from.id], true)
|
||||
ackAlarm({
|
||||
id: from.id,
|
||||
coreUid: from.coreUid,
|
||||
ackState: true,
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -506,25 +495,20 @@ function fnShowModalOk() {
|
||||
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 = (
|
||||
keys: (string | number)[],
|
||||
record: Record<string, any>
|
||||
) => {
|
||||
state.selectedRowKeys = keys;
|
||||
state.selectedRow = record;
|
||||
};
|
||||
/**表格多选 */
|
||||
function fnTableSelectedRowKeys(keys: (string | number)[], rows: any[]) {
|
||||
tableState.selectedRowKeys = keys;
|
||||
tableState.selectedRows = rows.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
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'),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const ids = state.selectedRowKeys.map(v => Number(v));
|
||||
ackAlarm(ids, false).then(res => {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('views.faultManage.activeAlarm.cancelSuss'),
|
||||
duration: 2,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
let reqArr: any = [];
|
||||
tableState.selectedRows.forEach(item => {
|
||||
reqArr.push(
|
||||
ackAlarm({
|
||||
id: item.id,
|
||||
coreUid: item.coreUid,
|
||||
ackState: false,
|
||||
})
|
||||
);
|
||||
});
|
||||
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() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
listSync().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('views.faultManage.activeAlarm.sysncSuss'),
|
||||
duration: 2,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
}).finally(()=>{
|
||||
hide();
|
||||
});
|
||||
listSync()
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('views.faultManage.activeAlarm.sysncSuss'),
|
||||
duration: 2,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,22 +585,28 @@ function fnClear() {
|
||||
content: t('views.faultManage.activeAlarm.delSure'),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const ids = state.selectedRowKeys.map(v => Number(v));
|
||||
clearAlarm(ids).then(res => {
|
||||
hide();
|
||||
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,
|
||||
});
|
||||
}
|
||||
let reqArr: any = [];
|
||||
tableState.selectedRows.forEach(item => {
|
||||
reqArr.push(clearAlarm(item.id, item.coreUid));
|
||||
});
|
||||
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) => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (state.selectedRowKeys.length > 0) {
|
||||
state.selectedRowKeys = [];
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
@@ -890,6 +894,7 @@ onMounted(() => {
|
||||
v-model:value="queryParams.alarmType"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.activeAlarmType"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -948,7 +953,7 @@ onMounted(() => {
|
||||
<a-button
|
||||
type="primary"
|
||||
@click.prevent="fnCancelConfirm()"
|
||||
:disabled="state.selectedRowKeys.length <= 0"
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
v-if="false"
|
||||
>
|
||||
<template #icon>
|
||||
@@ -973,7 +978,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
danger
|
||||
@click.prevent="fnClear()"
|
||||
:disabled="state.selectedRowKeys.length <= 0"
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
@@ -1049,8 +1054,8 @@ onMounted(() => {
|
||||
:row-selection="{
|
||||
type: 'checkbox',
|
||||
columnWidth: '48px',
|
||||
selectedRowKeys: state.selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
selectedRowKeys: tableState.selectedRowKeys,
|
||||
onChange: fnTableSelectedRowKeys,
|
||||
}"
|
||||
:pagination="tablePagination"
|
||||
:scroll="{ x: tableColumns.length * 150, y: 'calc(100vh - 480px)' }"
|
||||
@@ -1183,22 +1188,18 @@ onMounted(() => {
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.ne.common.neType')" name="neType">
|
||||
{{ modalState.from.neType }}
|
||||
{{ modalState.from.neType }} ({{ modalState.from.neUid }})
|
||||
</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-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.ne.common.neName')" name="neName">
|
||||
{{ modalState.from.neName }}
|
||||
</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
|
||||
:label="t('views.faultManage.activeAlarm.origLevel')"
|
||||
name="origSeverity"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.activeAlarmSeverity"
|
||||
:value="modalState.from.origSeverity"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -1252,30 +1253,6 @@ onMounted(() => {
|
||||
{{ modalState.from.locationInfo }}
|
||||
</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
|
||||
:label="t('views.faultManage.activeAlarm.addInfo')"
|
||||
name="addInfo"
|
||||
@@ -15,6 +15,7 @@ import { writeSheet } from '@/utils/execl-utils';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import dayjs, { type Dayjs } from 'dayjs';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -41,26 +42,22 @@ let rangePickerPresets = ref([
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
sortField: 'event_time',
|
||||
sortOrder: 'desc',
|
||||
/**告警设备类型 */
|
||||
neType: '',
|
||||
/**告警网元名称 */
|
||||
neName: '',
|
||||
/**告警网元标识 */
|
||||
neId: '',
|
||||
/**告警编号 */
|
||||
alarmCode: '',
|
||||
/**告警级别 */
|
||||
origSeverity: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**告警产生时间开始时间 */
|
||||
beginTime: undefined as undefined | number,
|
||||
/**告警产生时间结束时间 */
|
||||
endTime: undefined as undefined | number,
|
||||
/**虚拟化标识 */
|
||||
pvFlag: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
@@ -72,22 +69,19 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
/**告警设备类型 */
|
||||
neType: '',
|
||||
/**告警网元名称 */
|
||||
neName: '',
|
||||
/**告警网元标识 */
|
||||
neId: '',
|
||||
/**告警编号 */
|
||||
alarmCode: '',
|
||||
/**告警级别 */
|
||||
origSeverity: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**告警产生时间 */
|
||||
beginTime: undefined,
|
||||
endTime: undefined,
|
||||
/**虚拟化标识 */
|
||||
pvFlag: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
});
|
||||
queryRangePicker.value = undefined;
|
||||
tablePagination.current = 1;
|
||||
@@ -159,12 +153,6 @@ let tableColumns: ColumnsType = [
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('common.operate'),
|
||||
key: 'id',
|
||||
@@ -237,7 +225,6 @@ let modalState: ModalStateType = reactive({
|
||||
from: {
|
||||
alarmId: '',
|
||||
alarmSeq: '',
|
||||
neId: '',
|
||||
neName: '',
|
||||
neType: '',
|
||||
alarmCode: '',
|
||||
@@ -449,7 +436,7 @@ onMounted(() => {
|
||||
<!-- 表格搜索栏 -->
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<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-auto-complete
|
||||
v-model:value="queryParams.neType"
|
||||
@@ -643,6 +630,11 @@ onMounted(() => {
|
||||
</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 }} ({{ modalState.from.neUid }})
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.alarmCode')"
|
||||
@@ -653,19 +645,6 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</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-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
@@ -11,6 +11,7 @@ import useNeStore from '@/store/modules/ne';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import dayjs, { type Dayjs } from 'dayjs';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
const neStore = useNeStore();
|
||||
@@ -48,6 +49,8 @@ let rangePickerPresets = ref([
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: '',
|
||||
sortField: 'event_time',
|
||||
@@ -130,12 +133,6 @@ let tableColumns: ColumnsType = reactive([
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.logManage.forwarding.alarmId'),
|
||||
dataIndex: 'alarmId',
|
||||
@@ -308,7 +305,7 @@ onMounted(() => {
|
||||
<!-- 表格搜索栏 -->
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<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-auto-complete
|
||||
v-model:value="queryParams.neType"
|
||||
@@ -20,6 +20,7 @@ import { writeSheet } from '@/utils/execl-utils';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import dayjs, { type Dayjs } from 'dayjs';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
@@ -61,27 +62,23 @@ let rangePickerPresets = ref([
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
alarmStatus: 'Clear',
|
||||
sortField: 'event_time',
|
||||
sortOrder: 'desc',
|
||||
/**告警设备类型 */
|
||||
neType: '',
|
||||
/**告警网元名称 */
|
||||
neName: '',
|
||||
/**告警网元标识 */
|
||||
neId: '',
|
||||
/**告警编号 */
|
||||
alarmCode: '',
|
||||
/**告警级别 */
|
||||
origSeverity: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**告警产生时间开始时间 */
|
||||
beginTime: undefined as undefined | number,
|
||||
/**告警产生时间结束时间 */
|
||||
endTime: undefined as undefined | number,
|
||||
/**虚拟化标识 */
|
||||
pvFlag: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
@@ -94,22 +91,19 @@ function fnQueryReset() {
|
||||
alarmStatus: 'Clear',
|
||||
/**告警设备类型 */
|
||||
neType: '',
|
||||
/**告警网元名称 */
|
||||
neName: '',
|
||||
/**告警网元标识 */
|
||||
neId: '',
|
||||
/**告警编号 */
|
||||
alarmCode: '',
|
||||
/**告警级别 */
|
||||
origSeverity: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**告警产生时间 */
|
||||
beginTime: undefined,
|
||||
endTime: undefined,
|
||||
/**虚拟化标识 */
|
||||
pvFlag: undefined,
|
||||
/**告警类型 */
|
||||
alarmType: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
});
|
||||
queryRangePicker.value = undefined;
|
||||
tablePagination.current = 1;
|
||||
@@ -194,18 +188,6 @@ let tableColumns = ref<ColumnsType>([
|
||||
align: 'left',
|
||||
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'),
|
||||
dataIndex: 'clearUser',
|
||||
@@ -306,7 +288,6 @@ let modalState: ModalStateType = reactive({
|
||||
from: {
|
||||
alarmId: '',
|
||||
alarmSeq: '',
|
||||
neId: '',
|
||||
neName: '',
|
||||
neType: '',
|
||||
alarmCode: '',
|
||||
@@ -689,6 +670,7 @@ onMounted(() => {
|
||||
v-model:value="queryParams.alarmType"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.activeAlarmType"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -919,22 +901,18 @@ onMounted(() => {
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.ne.common.neType')" name="neType">
|
||||
{{ modalState.from.neType }}
|
||||
{{ modalState.from.neType }} ({{ modalState.from.neUid }})
|
||||
</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-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.ne.common.neName')" name="neName">
|
||||
{{ modalState.from.neName }}
|
||||
</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
|
||||
:label="t('views.faultManage.activeAlarm.origLevel')"
|
||||
name="origSeverity"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.activeAlarmSeverity"
|
||||
:value="modalState.from.origSeverity"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -987,27 +965,6 @@ onMounted(() => {
|
||||
>
|
||||
{{ modalState.from.locationInfo }}
|
||||
</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
|
||||
:label="t('views.faultManage.activeAlarm.addInfo')"
|
||||
@@ -11,6 +11,7 @@ import useNeStore from '@/store/modules/ne';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import dayjs, { type Dayjs } from 'dayjs';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
@@ -48,6 +49,8 @@ let rangePickerPresets = ref([
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: '',
|
||||
/**告警状态 */
|
||||
@@ -116,17 +119,11 @@ let tableColumns: ColumnsType = [
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.logManage.alarm.alarmId'),
|
||||
dataIndex: 'alarmId',
|
||||
align: 'left',
|
||||
width: 120,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.logManage.alarm.alarmSeq'),
|
||||
@@ -173,16 +170,17 @@ let tableColumns: ColumnsType = [
|
||||
title: t('views.logManage.alarm.eventTime'),
|
||||
dataIndex: 'eventTime',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
customRender(opt) {
|
||||
if (!opt.value) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
},
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.logManage.alarm.logTime'),
|
||||
dataIndex: 'createdAt',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
customRender(opt) {
|
||||
if (!opt.value) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
|
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
@@ -21,6 +21,7 @@ import { origGet } from '@/api/faultManage/actAlarm';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { useFullscreen } from '@vueuse/core';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -35,7 +36,7 @@ const trendRange = ref('1'); // '1':今天,'7':7天,'30':30天
|
||||
const loading = ref(false);
|
||||
|
||||
// 定时器引用
|
||||
let refreshTimer: number | null = null;
|
||||
let refreshTimer: any = null;
|
||||
|
||||
// 最新告警列表
|
||||
const allLatestAlarmsAct: any = ref([]);
|
||||
@@ -181,7 +182,7 @@ async function fetchLatestAlarmsHis() {
|
||||
allLatestAlarmsHis.value.map((alarm: any) => alarm.alarmId)
|
||||
);
|
||||
// 找出新告警
|
||||
res.rows.forEach((alarm:any) => {
|
||||
res.rows.forEach((alarm: any) => {
|
||||
if (!currentIds.has(alarm.alarmId)) {
|
||||
console.log('新历史告警:', alarm.alarmId, alarm.alarmTitle);
|
||||
newHistoryAlarms.value.add(alarm.alarmId);
|
||||
@@ -205,7 +206,7 @@ async function fetchLatestAlarmsHis() {
|
||||
async function fetchAlarmData() {
|
||||
try {
|
||||
loading.value = true;
|
||||
const res = await origGet();
|
||||
const res = await origGet(currentCoreUid());
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
// 重置告警数据
|
||||
alarmData.critical = 0;
|
||||
@@ -322,7 +323,7 @@ onMounted(() => {
|
||||
fetchAlarmTrend(); // 定时刷新趋势数据
|
||||
|
||||
// 设置定时刷新 - 每10秒刷新一次
|
||||
refreshTimer = window.setInterval(() => {
|
||||
refreshTimer = setInterval(() => {
|
||||
fetchAlarmData();
|
||||
fetchAlarmTrend(); // 定时刷新趋势数据
|
||||
}, 10000);
|
||||
@@ -492,10 +493,8 @@ onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
|
||||
// 清除定时器
|
||||
if (refreshTimer !== null) {
|
||||
clearInterval(refreshTimer);
|
||||
refreshTimer = null;
|
||||
}
|
||||
clearInterval(refreshTimer);
|
||||
refreshTimer = null;
|
||||
|
||||
// 销毁图表实例
|
||||
trendChartInstance?.dispose();
|
||||
@@ -408,6 +408,7 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.dashboard.cdr.exportTip'),
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const querys = toRaw(queryParams);
|
||||
querys.pageSize = 10000;
|
||||
@@ -378,6 +378,7 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.dashboard.cdr.exportTip'),
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const querys = toRaw(queryParams);
|
||||
querys.pageSize = 10000;
|
||||
@@ -405,6 +405,7 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.dashboard.cdr.exportTip'),
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const querys = toRaw(queryParams);
|
||||
querys.pageSize = 10000;
|
||||
@@ -372,6 +372,7 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.dashboard.cdr.exportTip'),
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const querys = toRaw(queryParams);
|
||||
querys.pageSize = 10000;
|
||||
@@ -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>
|
||||
@@ -35,7 +35,7 @@ function findView(dirName: string): () => Promise<Component> {
|
||||
return views[dir];
|
||||
}
|
||||
}
|
||||
return () => import('@/views/configManage/neOverview/index.vue');
|
||||
return () => import('@/views/ne/neOverview/index.vue');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -49,7 +49,7 @@ onMounted(() => {
|
||||
}
|
||||
} else {
|
||||
currentComponent.value = defineAsyncComponent(
|
||||
() => import('@/views/configManage/neOverview/index.vue')
|
||||
() => import('@/views/ne/neOverview/index.vue')
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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
|
||||
>
|
||||
<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>
|
||||
<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>
|
||||
@@ -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>
|
||||
@@ -82,14 +82,14 @@ let tableColumns: ColumnsType = reactive([
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.logManage.mml.type'),
|
||||
title: t('views.ne.common.neType'),
|
||||
dataIndex: 'neType',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.logManage.mml.neId'),
|
||||
dataIndex: 'neId',
|
||||
title: t('views.ne.common.neUid'),
|
||||
dataIndex: 'neUid',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
@@ -23,6 +23,7 @@ import { markRaw, onMounted, ref } from 'vue';
|
||||
import { origGet, top3Sel } from '@/api/faultManage/actAlarm';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -85,7 +86,8 @@ const alarmTypeTypeTop = ref<any>([
|
||||
|
||||
//
|
||||
function initPicture() {
|
||||
Promise.allSettled([origGet(), top3Sel()])
|
||||
const coreUid = currentCoreUid();
|
||||
Promise.allSettled([origGet(coreUid), top3Sel(coreUid)])
|
||||
.then(resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
const res0 = resArr[0].value;
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
notNeNodes,
|
||||
} from '../../hooks/useTopology';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**图DOM节点实例对象 */
|
||||
@@ -154,6 +155,7 @@ function fnGraphDataLoad(reload: boolean = false) {
|
||||
Promise.all([
|
||||
getGraphData(graphState.group),
|
||||
listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: false,
|
||||
}),
|
||||
])
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { parseSizeFromBits, parseSizeFromKbs } from '@/utils/parse-utils';
|
||||
import { parseSizeFromByte, parseSizeFromKbs } from '@/utils/parse-utils';
|
||||
import { ref } from 'vue';
|
||||
|
||||
type FDType = {
|
||||
@@ -81,9 +81,9 @@ export function upfTFParse(day: string, data: Record<string, number>) {
|
||||
let { up, down } = data;
|
||||
upfTotalFlow.value[day] = {
|
||||
up: up,
|
||||
upFrom: parseSizeFromBits(up),
|
||||
upFrom: parseSizeFromByte(up),
|
||||
down: down,
|
||||
downFrom: parseSizeFromBits(down),
|
||||
downFrom: parseSizeFromByte(down),
|
||||
requestFlag: false,
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -229,15 +229,15 @@ function loadData() {
|
||||
interval10s.value = setInterval(() => {
|
||||
if (!interval10s.value || !initFlag) return;
|
||||
if (upfTFActive.value === '0') {
|
||||
upfTFSend('7');
|
||||
upfTFActive.value = '7';
|
||||
} else if (upfTFActive.value === '7') {
|
||||
upfTFSend('30');
|
||||
upfTFActive.value = '30';
|
||||
} else if (upfTFActive.value === '30') {
|
||||
upfTFSend('0');
|
||||
upfTFActive.value = '0';
|
||||
}
|
||||
upfTFSend('0');
|
||||
upfTFSend('7');
|
||||
upfTFSend('30');
|
||||
}, 10_000);
|
||||
|
||||
clearInterval(interval5s.value);
|
||||
@@ -307,11 +307,9 @@ onMounted(() => {
|
||||
fnSelectUDM({ key: udmOtions.value[0].value });
|
||||
}
|
||||
// 过滤不可用的网元
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
|
||||
(item: any) => {
|
||||
return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value);
|
||||
}
|
||||
);
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
|
||||
return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value);
|
||||
});
|
||||
if (neCascaderOptions.value.length === 0) {
|
||||
message.warning({
|
||||
content: t('common.noData'),
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
notNeNodes,
|
||||
} from '../../hooks/useTopology';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**图DOM节点实例对象 */
|
||||
@@ -26,7 +27,8 @@ const graphNodeTooltip = new Tooltip({
|
||||
offsetY: 20,
|
||||
getContent(evt) {
|
||||
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);
|
||||
if (notNeNodes.includes(id)) {
|
||||
return `<div><span>${label || id}</span></div>`;
|
||||
@@ -50,10 +52,10 @@ const graphNodeTooltip = new Tooltip({
|
||||
>
|
||||
<div><strong>${t('views.monitor.topology.state')}:</strong><span>
|
||||
${
|
||||
neState.online
|
||||
? t('views.monitor.topology.normalcy')
|
||||
: t('views.monitor.topology.exceptions')
|
||||
}
|
||||
neState.online
|
||||
? t('views.monitor.topology.normalcy')
|
||||
: t('views.monitor.topology.exceptions')
|
||||
}
|
||||
</span></div>
|
||||
<div><strong>${t('views.monitor.topology.refreshTime')}:</strong><span>
|
||||
${neState.refreshTime ?? '--'}
|
||||
@@ -88,10 +90,10 @@ const graphNodeTooltip = new Tooltip({
|
||||
>
|
||||
<div><strong>${t('views.monitor.topology.state')}:</strong><span>
|
||||
${
|
||||
neState.online
|
||||
? t('views.monitor.topology.normalcy')
|
||||
: t('views.monitor.topology.exceptions')
|
||||
}
|
||||
neState.online
|
||||
? t('views.monitor.topology.normalcy')
|
||||
: t('views.monitor.topology.exceptions')
|
||||
}
|
||||
</span></div>
|
||||
<div><strong>${t('views.monitor.topology.refreshTime')}:</strong><span>
|
||||
${neState.refreshTime ?? '--'}
|
||||
@@ -101,13 +103,17 @@ const graphNodeTooltip = new Tooltip({
|
||||
// 为每个同类型网元添加信息
|
||||
sameTypeNes.forEach((ne: any, index: number) => {
|
||||
// 获取该网元的状态信息
|
||||
const neStateInfo = neStateMap?.[ne.neId] ||
|
||||
(ne.neId === neState.neId ? neState : {});
|
||||
const neStateInfo =
|
||||
neStateMap?.[ne.neId] || (ne.neId === neState.neId ? neState : {});
|
||||
|
||||
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>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>
|
||||
${neStateInfo.version || ne.version || '--'}
|
||||
</span></div>
|
||||
@@ -120,13 +126,17 @@ const graphNodeTooltip = new Tooltip({
|
||||
<div><strong>${t('views.monitor.topology.state')}:</strong><span>
|
||||
${
|
||||
neStateInfo.online !== undefined
|
||||
? (neStateInfo.online
|
||||
? neStateInfo.online
|
||||
? t('views.monitor.topology.normalcy')
|
||||
: t('views.monitor.topology.exceptions'))
|
||||
: t('views.monitor.topology.exceptions')
|
||||
: 'undefined'
|
||||
}
|
||||
</span></div>
|
||||
${index < sameTypeNes.length - 1 ? '<div>------------------------</div>' : ''}
|
||||
${
|
||||
index < sameTypeNes.length - 1
|
||||
? '<div>------------------------</div>'
|
||||
: ''
|
||||
}
|
||||
`;
|
||||
});
|
||||
|
||||
@@ -136,8 +146,6 @@ const graphNodeTooltip = new Tooltip({
|
||||
itemTypes: ['node'],
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**图数据渲染 */
|
||||
function handleRanderGraph(
|
||||
container: HTMLElement | undefined,
|
||||
@@ -176,7 +184,6 @@ function handleRanderGraph(
|
||||
graph.data(data);
|
||||
graph.render();
|
||||
|
||||
|
||||
graphG6.value = graph;
|
||||
|
||||
// 创建 ResizeObserver 实例
|
||||
@@ -207,6 +214,7 @@ function fnGraphDataLoad(reload: boolean = false) {
|
||||
Promise.all([
|
||||
getGraphData(graphState.group),
|
||||
listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: false,
|
||||
}),
|
||||
])
|
||||
@@ -250,11 +258,11 @@ function fnGraphDataLoad(reload: boolean = false) {
|
||||
const nf: Record<string, any>[] = nodes.filter(
|
||||
(node: Record<string, any>) => {
|
||||
Reflect.set(node, 'neState', { online: false });
|
||||
Reflect.set(node, 'neStateMap', {}); // 初始化状态映射
|
||||
Reflect.set(node, 'neStateMap', {}); // 初始化状态映射
|
||||
|
||||
// 图片路径处理
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { parseSizeFromBits, parseSizeFromKbs } from '@/utils/parse-utils';
|
||||
import { parseSizeFromByte, parseSizeFromKbs } from '@/utils/parse-utils';
|
||||
import { ref } from 'vue';
|
||||
|
||||
type FDType = {
|
||||
@@ -79,9 +79,9 @@ export function upfTFParse(day: string, data: Record<string, number>) {
|
||||
let { up, down } = data;
|
||||
upfTotalFlow.value[day] = {
|
||||
up: up,
|
||||
upFrom: parseSizeFromBits(up),
|
||||
upFrom: parseSizeFromByte(up),
|
||||
down: down,
|
||||
downFrom: parseSizeFromBits(down),
|
||||
downFrom: parseSizeFromByte(down),
|
||||
requestFlag: false,
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -176,15 +176,15 @@ async function fnGetSkim() {
|
||||
{
|
||||
request: (neId: string) => listAMFNblist({ neId }),
|
||||
process: async (res: any, neId: any) => {
|
||||
console.log(neId)
|
||||
if (res.code === RESULT_CODE_SUCCESS&& Array.isArray(res.data)) {
|
||||
console.log(neId);
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
skimState.gnbNum += res.data.length;
|
||||
skimState.gnbUeNum += res.data.reduce(
|
||||
(sum: number, item: any) => sum + item.ueNum,
|
||||
0
|
||||
);
|
||||
const amfNbRes = await listAMFNbStatelist({ neId });
|
||||
console.log(amfNbRes)
|
||||
console.log(amfNbRes);
|
||||
if (
|
||||
amfNbRes.code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(amfNbRes.data)
|
||||
@@ -224,13 +224,13 @@ async function fnGetSkim() {
|
||||
);
|
||||
|
||||
const mmeNbRes = await listMMENbStatelist({ neId });
|
||||
console.log(mmeNbRes)
|
||||
console.log(mmeNbRes);
|
||||
if (
|
||||
mmeNbRes.code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(mmeNbRes.data)
|
||||
) {
|
||||
// skimState.eNbSumNum += mmeNbRes.data.length;
|
||||
console.log(mmeNbRes)
|
||||
console.log(mmeNbRes);
|
||||
tempEnbSumNum += mmeNbRes.data.length;
|
||||
}
|
||||
}
|
||||
@@ -238,21 +238,20 @@ async function fnGetSkim() {
|
||||
},
|
||||
],
|
||||
]);
|
||||
console.log(neCascaderOptions)
|
||||
console.log(neCascaderOptions);
|
||||
|
||||
const requests = neCascaderOptions.value.flatMap(
|
||||
(ne: any) =>
|
||||
ne.children
|
||||
?.map((child: any) => {
|
||||
console.log(child.neId)
|
||||
console.log(child.neId);
|
||||
const handler = neHandlers.get(child.neType);
|
||||
return handler
|
||||
? {
|
||||
promise: handler.request(child.neId),
|
||||
process: handler.process,
|
||||
neId: child.neId, // 这里加上neId
|
||||
|
||||
}
|
||||
neId: child.neId, // 这里加上neId
|
||||
}
|
||||
: null;
|
||||
})
|
||||
.filter(Boolean) || []
|
||||
@@ -311,15 +310,15 @@ function loadData() {
|
||||
interval10s.value = setInterval(() => {
|
||||
if (!interval10s.value || !initFlag) return;
|
||||
if (upfTFActive.value === '0') {
|
||||
upfTFSend('7');
|
||||
upfTFActive.value = '7';
|
||||
} else if (upfTFActive.value === '7') {
|
||||
upfTFSend('30');
|
||||
upfTFActive.value = '30';
|
||||
} else if (upfTFActive.value === '30') {
|
||||
upfTFSend('0');
|
||||
upfTFActive.value = '0';
|
||||
}
|
||||
upfTFSend('0');
|
||||
upfTFSend('7');
|
||||
upfTFSend('30');
|
||||
}, 10_000);
|
||||
|
||||
clearInterval(interval5s.value);
|
||||
@@ -375,12 +374,14 @@ async function fnSelectUDM(e: any) {
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
});
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
// listUDMSub({ neId: udmNeId.value, pageNum: 1, pageSize: 1 }).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && typeof res.data.total === 'number') {
|
||||
if (
|
||||
res.code === RESULT_CODE_SUCCESS &&
|
||||
typeof res.data.total === 'number'
|
||||
) {
|
||||
skimState.udmSubNum = res.data.total;
|
||||
console.log(res)
|
||||
|
||||
console.log(res);
|
||||
} else {
|
||||
skimState.udmSubNum = 0;
|
||||
}
|
||||
@@ -393,7 +394,7 @@ async function fnSelectUDM(e: any) {
|
||||
}
|
||||
/**资源控制-选择NE */
|
||||
function fnSelectNeRe(e: any) {
|
||||
console.log(e)
|
||||
console.log(e);
|
||||
graphNodeClickID.value = e.key;
|
||||
}
|
||||
//
|
||||
@@ -408,7 +409,7 @@ const getPopupContainer = () => {
|
||||
onMounted(() => {
|
||||
// 获取网元网元列表
|
||||
neStore.getNeCascaderOptions.forEach(item => {
|
||||
console.log(item)
|
||||
console.log(item);
|
||||
if (item.value === 'UPF') {
|
||||
neOtions.value = JSON.parse(JSON.stringify(item.children));
|
||||
}
|
||||
@@ -426,11 +427,9 @@ onMounted(() => {
|
||||
// fnSelectNeRe({ key: onlineArr[0].value });
|
||||
// }
|
||||
// 过滤不可用的网元
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
|
||||
(item: any) => {
|
||||
return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value);
|
||||
}
|
||||
);
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
|
||||
return ['UDM', 'SMF', 'IMS', 'AMF', 'MME'].includes(item.value);
|
||||
});
|
||||
if (neCascaderOptions.value.length === 0) {
|
||||
message.warning({
|
||||
content: t('common.noData'),
|
||||
@@ -3,11 +3,13 @@ import { reactive, onMounted, ref, onBeforeUnmount } from 'vue';
|
||||
import { PageContainer } from 'antdv-pro-layout';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
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 { randerGroph, switchLayout } from './graph';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { parseBasePath } from '@/plugins/file-static-url';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**图DOM节点实例对象 */
|
||||
@@ -38,7 +40,7 @@ async function fnGetState() {
|
||||
if (!interval.value) return;
|
||||
const ne = node.info;
|
||||
// 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) {
|
||||
ne.serverState = result.data;
|
||||
ne.serverState.refreshTime = parseDateToStr(
|
||||
@@ -56,6 +58,7 @@ async function fnGetState() {
|
||||
/**查询全部网元数据列表 */
|
||||
function fnGetList(refresh: boolean = false) {
|
||||
listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: false,
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
@@ -25,6 +25,7 @@ import useNeOptions from '@/views/ne/neInfo/hooks/useNeOptions';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { OptionsType, WS } from '@/plugins/ws-websocket';
|
||||
import { parseBasePath } from '@/plugins/file-static-url';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
const { fnNeRestart, fnNeStop, fnNeLogFile } = useNeOptions();
|
||||
const ws = new WS();
|
||||
@@ -105,17 +106,17 @@ const graphNodeMenu = new Menu({
|
||||
},
|
||||
handleMenuClick(target, item) {
|
||||
const { neInfo }: any = item?.getModel();
|
||||
const { neName, neType, neId } = neInfo;
|
||||
const { neName, neType, neUid, coreUid } = neInfo;
|
||||
const targetId = target.id;
|
||||
switch (targetId) {
|
||||
case 'restart':
|
||||
fnNeRestart({ neName, neType, neId });
|
||||
fnNeRestart({ neName, neType, neUid, coreUid });
|
||||
break;
|
||||
case 'stop':
|
||||
fnNeStop({ neName, neType, neId });
|
||||
fnNeStop({ neName, neType, neUid, coreUid });
|
||||
break;
|
||||
case 'log':
|
||||
fnNeLogFile({ neType, neId });
|
||||
fnNeLogFile({ neType, neUid, coreUid });
|
||||
break;
|
||||
}
|
||||
},
|
||||
@@ -153,11 +154,11 @@ const graphNodeTooltip = new Tooltip({
|
||||
${neState.refreshTime ?? '--'}
|
||||
</span></div>
|
||||
<div>========================</div>
|
||||
<div><strong>ID:</strong><span>${neState.neId}</span></div>
|
||||
<div><strong>ID:</strong><span>${neState.neUid}</span></div>
|
||||
<div><strong>${t('views.monitor.topology.name')}:</strong><span>
|
||||
${neState.neName ?? '--'}
|
||||
</span></div>
|
||||
<div><strong>IP:</strong><span>${neState.neIP}</span></div>
|
||||
<div><strong>IP:</strong><span>${neState.ipAddr}</span></div>
|
||||
<div><strong>${t('views.monitor.topology.version')}:</strong><span>
|
||||
${neState.version ?? '--'}
|
||||
</span></div>
|
||||
@@ -259,6 +260,7 @@ function fnGraphDataLoad(reload: boolean = false) {
|
||||
Promise.all([
|
||||
getGraphData(graphState.group),
|
||||
listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: false,
|
||||
}),
|
||||
])
|
||||
@@ -369,14 +371,15 @@ function fnGetState() {
|
||||
// 获取节点状态
|
||||
for (const node of graphState.data.nodes) {
|
||||
if (notNeNodes.includes(node.id)) continue;
|
||||
const { neType, neId } = node.neInfo;
|
||||
if (!neType || !neId) continue;
|
||||
const { neType, neUid, coreUid } = node.neInfo;
|
||||
if (!neType || !neUid) continue;
|
||||
ws.send({
|
||||
requestId: `${neType}_${neId}`,
|
||||
requestId: `${neType}_${neUid}`,
|
||||
type: 'ne_state',
|
||||
data: {
|
||||
neType: neType,
|
||||
neId: neId,
|
||||
neUid: neUid,
|
||||
coreUid: coreUid,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -396,7 +399,7 @@ function wsMessage(res: Record<string, any>) {
|
||||
return;
|
||||
}
|
||||
if (!requestId) return;
|
||||
const [neType, neId] = requestId.split('_');
|
||||
const [neType, neUid] = requestId.split('_');
|
||||
const { combos, edges, nodes } = graphState.data;
|
||||
const node = nodes.find((item: Record<string, any>) => item.id === neType);
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { delNeConfigData } from '@/api/ne/neConfig';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { reactive, toRaw } from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
/**
|
||||
* 批量删除array
|
||||
@@ -49,7 +50,8 @@ export default function useArrayBatch({
|
||||
for (let i = endIndex; i >= batchState.startIndex; i--) {
|
||||
const res = await delNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: batchState.paramName,
|
||||
loc: `${i}`,
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import { readSheet } from '@/utils/execl-utils';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { reactive } from 'vue';
|
||||
import saveAs from 'file-saver';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
|
||||
/**
|
||||
* 导入文件加array
|
||||
@@ -100,7 +101,6 @@ export default function useArrayImport({
|
||||
/**对话框表格信息导入上传 */
|
||||
async function modalImportUpload(file: File) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const [neType, neId] = neTypeSelect.value;
|
||||
importState.msgArr = [];
|
||||
|
||||
// 获取最大index
|
||||
@@ -138,8 +138,9 @@ export default function useArrayImport({
|
||||
// 已定义则更新
|
||||
rowItem.index = has.index.value;
|
||||
result = await editNeConfigData({
|
||||
neType: neType,
|
||||
neId: neId,
|
||||
neType: neTypeSelect.value[0],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: importState.paramName,
|
||||
paramData: rowItem,
|
||||
loc: `${rowItem.index}`,
|
||||
@@ -152,8 +153,9 @@ export default function useArrayImport({
|
||||
} else {
|
||||
// 未定义则新增
|
||||
result = await addNeConfigData({
|
||||
neType: neType,
|
||||
neId: neId,
|
||||
neType: neTypeSelect.value[0],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: importState.paramName,
|
||||
paramData: Object.assign(rowItem, { index }),
|
||||
loc: `${index}`,
|
||||
|
||||
@@ -4,7 +4,8 @@ import {
|
||||
editNeConfigData,
|
||||
} from '@/api/ne/neConfig';
|
||||
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 { reactive, watch } from 'vue';
|
||||
|
||||
@@ -134,7 +135,8 @@ export default function useConfigArray({
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
editNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
paramData: data,
|
||||
loc: loc,
|
||||
@@ -174,7 +176,8 @@ export default function useConfigArray({
|
||||
onOk() {
|
||||
delNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
loc: loc,
|
||||
}).then(res => {
|
||||
@@ -268,7 +271,8 @@ export default function useConfigArray({
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
addNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
paramData: data,
|
||||
loc: `${from['index']['value']}`,
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
delNeConfigData,
|
||||
} from '@/api/ne/neConfig';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { Modal, message } from 'ant-design-vue/es';
|
||||
import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { nextTick, reactive } from 'vue';
|
||||
@@ -202,7 +203,8 @@ export default function useConfigArrayChild({
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
editNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
paramData: data,
|
||||
loc,
|
||||
@@ -243,7 +245,8 @@ export default function useConfigArrayChild({
|
||||
onOk() {
|
||||
delNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
loc,
|
||||
}).then(res => {
|
||||
@@ -313,7 +316,8 @@ export default function useConfigArrayChild({
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
addNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
paramData: data,
|
||||
loc,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { reactive, toRaw } from 'vue';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
|
||||
/**
|
||||
* list类型参数处理
|
||||
@@ -88,7 +89,8 @@ export default function useConfigList({
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
editNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: treeState.selectNode.paramName,
|
||||
paramData: {
|
||||
[from['name']]: from['value'],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { getNeConfigData } from '@/api/ne/neConfig';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { regExpIPv4, regExpIPv6, validURL } from '@/utils/regular-utils';
|
||||
import { ref } from 'vue';
|
||||
|
||||
@@ -29,8 +30,13 @@ export default function useOptions({ t }: any) {
|
||||
case 'int':
|
||||
// filter: "0~128"
|
||||
|
||||
if (filter && filter.indexOf('~') !== -1) {
|
||||
const filterArr = filter.split('~');
|
||||
if (filter) {
|
||||
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 maxInt = parseInt(filterArr[1]);
|
||||
const valueInt = parseInt(value);
|
||||
@@ -47,18 +53,12 @@ export default function useOptions({ t }: any) {
|
||||
break;
|
||||
case 'ipv4':
|
||||
if (!regExpIPv4.test(value)) {
|
||||
return [
|
||||
false,
|
||||
t('views.ne.neConfig.requireIpv4', { display }),
|
||||
];
|
||||
return [false, t('views.ne.neConfig.requireIpv4', { display })];
|
||||
}
|
||||
break;
|
||||
case 'ipv6':
|
||||
if (!regExpIPv6.test(value)) {
|
||||
return [
|
||||
false,
|
||||
t('views.ne.neConfig.requireIpv6', { display }),
|
||||
];
|
||||
return [false, t('views.ne.neConfig.requireIpv6', { display })];
|
||||
}
|
||||
break;
|
||||
case 'enum':
|
||||
@@ -71,10 +71,7 @@ export default function useOptions({ t }: any) {
|
||||
}
|
||||
|
||||
if (!Object.keys(filterJson).includes(`${value}`)) {
|
||||
return [
|
||||
false,
|
||||
t('views.ne.neConfig.requireEnum', { display }),
|
||||
];
|
||||
return [false, t('views.ne.neConfig.requireEnum', { display })];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -90,10 +87,7 @@ export default function useOptions({ t }: any) {
|
||||
}
|
||||
|
||||
if (!Object.values(filterJson).includes(`${value}`)) {
|
||||
return [
|
||||
false,
|
||||
t('views.ne.neConfig.requireBool', { display }),
|
||||
];
|
||||
return [false, t('views.ne.neConfig.requireBool', { display })];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -101,12 +95,20 @@ export default function useOptions({ t }: any) {
|
||||
// filter: "0~128"
|
||||
|
||||
// 字符串长度判断
|
||||
if (filter && filter.indexOf('~') !== -1) {
|
||||
if (filter) {
|
||||
try {
|
||||
const filterArr = filter.split('~');
|
||||
let rule = new RegExp(
|
||||
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$'
|
||||
);
|
||||
let rule: RegExp = new RegExp('^.*$');
|
||||
if (filter.indexOf('-') !== -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)) {
|
||||
return [
|
||||
false,
|
||||
@@ -157,10 +159,7 @@ export default function useOptions({ t }: any) {
|
||||
break;
|
||||
|
||||
default:
|
||||
return [
|
||||
false,
|
||||
t('views.ne.neConfig.requireUn', { display }),
|
||||
];
|
||||
return [false, t('views.ne.neConfig.requireUn', { display })];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -168,10 +167,11 @@ export default function useOptions({ t }: any) {
|
||||
/**upfId可选择 */
|
||||
const smfByUPFIdOptions = ref<{ value: string; label: string }[]>([]);
|
||||
/**加载smf配置的upfId */
|
||||
function smfByUPFIdLoadData(neId: string) {
|
||||
function smfByUPFIdLoadData(neUid: string) {
|
||||
getNeConfigData({
|
||||
neType: 'SMF',
|
||||
neId: neId,
|
||||
neUid: neUid,
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: 'upfConfig',
|
||||
}).then(res => {
|
||||
smfByUPFIdOptions.value = [];
|
||||
|
||||
@@ -16,6 +16,7 @@ import useConfigArrayChild from './hooks/useConfigArrayChild';
|
||||
import useArrayImport from './hooks/useArrayImport';
|
||||
import useArrayBatchDel from './hooks/useArrayBatchDel';
|
||||
import { getAllNeConfig, getNeConfigData } from '@/api/ne/neConfig';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
@@ -26,7 +27,7 @@ const { ruleVerification, smfByUPFIdLoadData, smfByUPFIdOptions } = useOptions({
|
||||
/**网元类型_多neId */
|
||||
let neCascaderOptions = ref<Record<string, any>[]>([]);
|
||||
|
||||
/**网元类型选择 type,id */
|
||||
/**网元类型选择 type,neUid */
|
||||
let neTypeSelect = ref<string[]>(['', '']);
|
||||
|
||||
/**左侧导航是否可收起 */
|
||||
@@ -107,7 +108,8 @@ function fnActiveConfigNode(key: string | number) {
|
||||
// 获取网元端的配置数据
|
||||
getNeConfigData({
|
||||
neType: neTypeSelect.value[0],
|
||||
neId: neTypeSelect.value[1],
|
||||
neUid: neTypeSelect.value[1],
|
||||
coreUid: currentCoreUid(),
|
||||
paramName: key,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
@@ -393,11 +395,9 @@ const { batchState, modalBatchOpen, modalBatchClose, modalBatchOk } =
|
||||
|
||||
onMounted(() => {
|
||||
// 获取网元网元列表
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
|
||||
(item: any) => {
|
||||
return !['LMF', 'NEF'].includes(item.value); // 过滤不可用的网元
|
||||
}
|
||||
);
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
|
||||
return !['LMF', 'NEF'].includes(item.value); // 过滤不可用的网元
|
||||
});
|
||||
if (neCascaderOptions.value.length === 0) {
|
||||
message.warning({
|
||||
content: t('common.noData'),
|
||||
@@ -406,23 +406,23 @@ onMounted(() => {
|
||||
return;
|
||||
}
|
||||
// 默认选择AMF
|
||||
const queryNeType = (route.query.neType as string) || 'AMF';
|
||||
const queryNeId = (route.query.neId as string) || '001';
|
||||
const queryNeType = route.query.neType as string;
|
||||
const queryNeUid = route.query.neUid as string;
|
||||
const item = neCascaderOptions.value.find(s => s.value === queryNeType);
|
||||
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) {
|
||||
neTypeSelect.value = [info.neType, info.neId];
|
||||
neTypeSelect.value = [info.neType, info.neUid];
|
||||
} else {
|
||||
// 默认取第一个网元ID
|
||||
const info = item.children[0];
|
||||
if (info) {
|
||||
neTypeSelect.value = [info.neType, info.neId];
|
||||
neTypeSelect.value = [info.neType, info.neUid];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const info = neCascaderOptions.value[0].children[0];
|
||||
neTypeSelect.value = [info.neType, info.neId];
|
||||
neTypeSelect.value = [info.neType, info.neUid];
|
||||
}
|
||||
fnGetNeConfig();
|
||||
});
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
} from '@/api/ne/neConfigBackup';
|
||||
import { pushBackupFTP } from '@/api/neData/backup';
|
||||
import saveAs from 'file-saver';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
const { getDict } = useDictStore();
|
||||
const neStore = useNeStore();
|
||||
@@ -28,6 +29,8 @@ let dictStatus = ref<DictType[]>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: undefined,
|
||||
/**名称 */
|
||||
@@ -61,6 +64,8 @@ type TabeStateType = {
|
||||
data: any[];
|
||||
/**勾选记录 */
|
||||
selectedRowKeys: (string | number)[];
|
||||
/**勾选记录 */
|
||||
selectedRows: Record<string, any>[];
|
||||
};
|
||||
|
||||
/**表格状态 */
|
||||
@@ -69,6 +74,7 @@ let tableState: TabeStateType = reactive({
|
||||
size: 'middle',
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
});
|
||||
|
||||
/**表格字段列 */
|
||||
@@ -85,30 +91,14 @@ let tableColumns = ref<TableColumnsType>([
|
||||
align: 'left',
|
||||
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'),
|
||||
dataIndex: 'name',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
width: 250,
|
||||
resizable: true,
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
maxWidth: 400,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
@@ -122,6 +112,16 @@ let tableColumns = ref<TableColumnsType>([
|
||||
maxWidth: 300,
|
||||
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'),
|
||||
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.selectedRows = rows.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
coreUid: item.coreUid,
|
||||
neUid: item.neUid,
|
||||
neType: item.neType,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**查询列表, pageNum初始页数 */
|
||||
@@ -199,7 +207,7 @@ function fnDownloadFile(row: Record<string, any>) {
|
||||
content: t('views.ne.neConfigBackup.downTip', { txt: row.name }),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
downNeConfigBackup(row.id)
|
||||
downNeConfigBackup({ id: row.id, coreUid: row.coreUid, neUid: row.neUid })
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -230,7 +238,6 @@ function fnRecordDelete(id: string) {
|
||||
let msg = id;
|
||||
if (id === '0') {
|
||||
msg = `...${tableState.selectedRowKeys.length}`;
|
||||
id = tableState.selectedRowKeys.join(',');
|
||||
}
|
||||
|
||||
Modal.confirm({
|
||||
@@ -239,17 +246,38 @@ function fnRecordDelete(id: string) {
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
delNeConfigBackup(id)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.operateOk'),
|
||||
duration: 3,
|
||||
});
|
||||
let reqArr: any = [];
|
||||
if (id === '0') {
|
||||
tableState.selectedRows.forEach(item => {
|
||||
reqArr.push(
|
||||
delNeConfigBackup({
|
||||
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);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
content: t('common.operateErr'),
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
@@ -280,8 +308,16 @@ let modalState: ModalStateType = reactive({
|
||||
title: '备份记录',
|
||||
from: {
|
||||
id: undefined,
|
||||
coreUid: '',
|
||||
neUid: '',
|
||||
neType: '',
|
||||
name: '',
|
||||
path: '',
|
||||
remark: '',
|
||||
createBy: '',
|
||||
createTime: undefined,
|
||||
updateBy: '',
|
||||
updateTime: undefined,
|
||||
},
|
||||
confirmLoading: false,
|
||||
});
|
||||
@@ -292,9 +328,7 @@ let modalState: ModalStateType = reactive({
|
||||
*/
|
||||
function fnModalVisibleByEdit(row: Record<string, any>) {
|
||||
if (modalState.confirmLoading) return;
|
||||
modalState.from.id = row.id;
|
||||
modalState.from.name = row.name;
|
||||
modalState.from.remark = row.remark;
|
||||
Object.assign(modalState.from, row);
|
||||
modalState.title = t('views.ne.neConfigBackup.title', { txt: row.id });
|
||||
modalState.openByEdit = true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,13 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
/**网元ID */
|
||||
neId: {
|
||||
neUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
/**核心网标识 */
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: true,
|
||||
@@ -64,7 +70,7 @@ watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) {
|
||||
if (props.neType && props.neId) {
|
||||
if (props.neType && props.neUid) {
|
||||
const filePath = props.filePath;
|
||||
const fileName = filePath.substring(filePath.lastIndexOf('/') + 1);
|
||||
state.title = fileName;
|
||||
@@ -126,7 +132,8 @@ function fnReload() {
|
||||
prefix="tail"
|
||||
url="/ws/view"
|
||||
:ne-type="neType"
|
||||
:ne-id="neId"
|
||||
:ne-uid="neUid"
|
||||
:core-uid="coreUid"
|
||||
style="height: calc(100% - 36px)"
|
||||
@connect="fnInit()"
|
||||
></TerminalSSHView>
|
||||
|
||||
@@ -13,6 +13,7 @@ import ViewDrawer from './components/ViewDrawer.vue';
|
||||
import saveAs from 'file-saver';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { parseSizeFromFile } from '@/utils/parse-utils';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
@@ -25,9 +26,11 @@ let neTypeSelect = ref<string[]>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: '',
|
||||
neId: '',
|
||||
neUid: '',
|
||||
/**读取路径 */
|
||||
path: '',
|
||||
/**前缀过滤 */
|
||||
@@ -149,7 +152,8 @@ function fnDownloadFile(row: Record<string, any>) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
getNeFile({
|
||||
neType: queryParams.neType,
|
||||
neId: queryParams.neId,
|
||||
neUid: queryParams.neUid,
|
||||
coreUid: queryParams.coreUid,
|
||||
path: queryParams.path,
|
||||
fileName: row.fileName,
|
||||
delTemp: true,
|
||||
@@ -210,11 +214,11 @@ function fnDirCD(dir: string, index?: number) {
|
||||
function fnNeChange(keys: any, _: any) {
|
||||
if (!Array.isArray(keys)) return;
|
||||
const neType = keys[0];
|
||||
const neId = keys[1];
|
||||
const neUid = keys[1];
|
||||
// 不是同类型时需要重新加载
|
||||
if (queryParams.neType !== neType || queryParams.neId !== neId) {
|
||||
if (queryParams.neType !== neType || queryParams.neUid !== neUid) {
|
||||
queryParams.neType = neType;
|
||||
queryParams.neId = neId;
|
||||
queryParams.neUid = neUid;
|
||||
if (neType === 'IMS') {
|
||||
nePathArr.value = ['/var/log/ims'];
|
||||
queryParams.search = '';
|
||||
@@ -228,7 +232,7 @@ function fnNeChange(keys: any, _: any) {
|
||||
|
||||
/**查询备份信息列表, pageNum初始页数 */
|
||||
function fnGetList(pageNum?: number) {
|
||||
if (queryParams.neId === '') {
|
||||
if (queryParams.neUid === '') {
|
||||
message.warning({
|
||||
content: t('views.logManage.neFile.neTypePlease'),
|
||||
duration: 2,
|
||||
@@ -271,20 +275,22 @@ const viewDrawerState = reactive({
|
||||
/**网元类型 */
|
||||
neType: '',
|
||||
/**网元ID */
|
||||
neId: '',
|
||||
neUid: '',
|
||||
coreUid: '',
|
||||
});
|
||||
|
||||
/**打开抽屉查看 */
|
||||
function fnDrawerOpen(row: Record<string, any>) {
|
||||
viewDrawerState.filePath = [...nePathArr.value, row.fileName].join('/');
|
||||
viewDrawerState.neType = neTypeSelect.value[0];
|
||||
viewDrawerState.neId = neTypeSelect.value[1];
|
||||
viewDrawerState.neUid = neTypeSelect.value[1];
|
||||
viewDrawerState.coreUid = currentCoreUid();
|
||||
viewDrawerState.open = !viewDrawerState.open;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (routeParams.neType) {
|
||||
neTypeSelect.value = [routeParams.neType, routeParams.neId];
|
||||
neTypeSelect.value = [routeParams.neType, routeParams.neUid];
|
||||
fnNeChange(neTypeSelect.value, undefined);
|
||||
}
|
||||
});
|
||||
@@ -385,7 +391,8 @@ onMounted(() => {
|
||||
v-model:open="viewDrawerState.open"
|
||||
:file-path="viewDrawerState.filePath"
|
||||
:ne-type="viewDrawerState.neType"
|
||||
:ne-id="viewDrawerState.neId"
|
||||
:ne-uid="viewDrawerState.neUid"
|
||||
:core-uid="viewDrawerState.coreUid"
|
||||
></ViewDrawer>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
@@ -20,8 +20,11 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**网元ID */
|
||||
neId: {
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@@ -42,15 +45,16 @@ const importState = reactive({
|
||||
|
||||
/**查询网元远程服务器备份文件 */
|
||||
function backupSearch(name?: string) {
|
||||
const { neType, neId } = modalState.from;
|
||||
const { neType, neUid, coreUid } = props;
|
||||
listNeConfigBackup({
|
||||
neType,
|
||||
neId,
|
||||
neUid,
|
||||
coreUid,
|
||||
name,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
importState.backupData = [];
|
||||
res.data.rows.forEach((item: any) => {
|
||||
importState.backupData.push({
|
||||
@@ -86,7 +90,8 @@ type ModalStateType = {
|
||||
/**表单数据 */
|
||||
from: {
|
||||
neType: string;
|
||||
neId: string;
|
||||
neUid: string;
|
||||
coreUid: string;
|
||||
type: 'upload' | 'backup';
|
||||
path: string | undefined;
|
||||
};
|
||||
@@ -102,7 +107,8 @@ let modalState: ModalStateType = reactive({
|
||||
title: '配置文件导入',
|
||||
from: {
|
||||
neType: '',
|
||||
neId: '',
|
||||
neUid: '',
|
||||
coreUid: '',
|
||||
type: 'upload',
|
||||
path: undefined,
|
||||
},
|
||||
@@ -227,9 +233,10 @@ watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) {
|
||||
if (props.neType && props.neId) {
|
||||
if (props.neType && props.neUid && props.coreUid) {
|
||||
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.openByEdit = true;
|
||||
}
|
||||
@@ -241,13 +248,13 @@ watch(
|
||||
* 网元导出配置
|
||||
* @param row 网元编号ID
|
||||
*/
|
||||
function fnExportConf(neType: string, neId: string) {
|
||||
function fnExportConf(coreUid: string, neUid: string, neType: string) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.ne.neInfo.backConf.exportTip'),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
exportNeConfigBackup({ neType, neId })
|
||||
exportNeConfigBackup({ neType, coreUid, neUid })
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
notification.success({
|
||||
@@ -256,7 +263,7 @@ function fnExportConf(neType: string, neId: string) {
|
||||
});
|
||||
saveAs(
|
||||
res.data,
|
||||
`${neType}_${neId}_config_backup_${Date.now()}.zip`
|
||||
`${neType}_${neUid}_config_backup_${Date.now()}.zip`
|
||||
);
|
||||
} else {
|
||||
message.error(`${res.msg}`, 3);
|
||||
@@ -280,7 +287,7 @@ defineExpose({
|
||||
<template>
|
||||
<ProModal
|
||||
:drag="true"
|
||||
:width="800"
|
||||
:width="500"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
:open="modalState.openByEdit"
|
||||
@@ -290,82 +297,77 @@ defineExpose({
|
||||
@cancel="fnModalCancel"
|
||||
>
|
||||
<a-form name="modalStateFrom" layout="horizontal" :label-col="{ span: 6 }">
|
||||
<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-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 :label="t('views.ne.common.neType')" name="neType">
|
||||
{{ modalState.from.neType }}
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.ne.common.neUid')" name="neId">
|
||||
{{ modalState.from.neUid }}
|
||||
</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-col>
|
||||
</a-row>
|
||||
<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-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
|
||||
: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>
|
||||
</ProModal>
|
||||
</template>
|
||||
|
||||
@@ -5,10 +5,12 @@ import { message, Form, Modal } from 'ant-design-vue/es';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { NE_TYPE_LIST } from '@/constants/ne-constants';
|
||||
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
|
||||
import { getNeInfo, addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { neHostAuthorizedRSA, testNeHost } from '@/api/ne/neHost';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { getNeInfoByNF } from '@/api/ne/neAction';
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(['ok', 'cancel', 'update:open']);
|
||||
@@ -17,9 +19,17 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
editId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -103,14 +113,14 @@ let modalState: ModalStateType = reactive({
|
||||
title: '网元',
|
||||
from: {
|
||||
id: undefined,
|
||||
neId: '001',
|
||||
neType: 'AMF',
|
||||
neName: '',
|
||||
ip: '',
|
||||
ipAddr: '',
|
||||
port: 33030,
|
||||
pvFlag: 'PNF',
|
||||
rmUid: '4400HXAMF001',
|
||||
neAddress: '',
|
||||
coreUid: currentCoreUid(),
|
||||
neUid: '',
|
||||
macAddr: '',
|
||||
dn: '',
|
||||
vendorName: '',
|
||||
province: 'Area',
|
||||
@@ -158,30 +168,18 @@ const modalStateFrom = Form.useForm(
|
||||
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: [
|
||||
{
|
||||
required: true,
|
||||
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) {
|
||||
if (editId <= 0) {
|
||||
function fnModalVisibleByEdit(coreUid: string, neUid: string) {
|
||||
if (!coreUid || !neUid) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.title = t('views.ne.neInfo.addTitle');
|
||||
modalState.openByEdit = true;
|
||||
@@ -220,7 +219,7 @@ function fnModalVisibleByEdit(editId: number) {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getNeInfo(editId).then(res => {
|
||||
getNeInfoByNF(coreUid, neUid).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
@@ -320,15 +319,6 @@ function fnNeTypeChange(v: any) {
|
||||
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 */
|
||||
@@ -344,7 +334,7 @@ function fnNeIPChange(e: any) {
|
||||
watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) fnModalVisibleByEdit(props.editId);
|
||||
if (val) fnModalVisibleByEdit(props.coreUid, props.neUid);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -439,58 +429,31 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.ne.common.neId')"
|
||||
name="neId"
|
||||
v-bind="modalStateFrom.validateInfos.neId"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.neId"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="32"
|
||||
@change="fnNeIdChange"
|
||||
:disabled="!!modalState.from.id"
|
||||
>
|
||||
<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-form-item
|
||||
:label="t('views.ne.common.neName')"
|
||||
name="neName"
|
||||
:label-col="{ span: 3 }"
|
||||
:label-wrap="true"
|
||||
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-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.ne.common.ipAddr')"
|
||||
name="ip"
|
||||
v-bind="modalStateFrom.validateInfos.ip"
|
||||
name="ipAddr"
|
||||
v-bind="modalStateFrom.validateInfos.ipAddr"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.ip"
|
||||
v-model:value="modalState.from.ipAddr"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="128"
|
||||
@@ -536,37 +499,11 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</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-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
|
||||
v-model:value="modalState.from.neAddress"
|
||||
v-model:value="modalState.from.macAddr"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="64"
|
||||
@@ -574,7 +511,7 @@ onMounted(() => {
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.ne.neInfo.neAddressTip') }}</div>
|
||||
<div>{{ t('views.ne.neInfo.macAddrTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ProModal } from 'antdv-pro-modal';
|
||||
import { message, Form } from 'ant-design-vue/es';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
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 emit = defineEmits(['ok', 'cancel', 'update:open']);
|
||||
const props = defineProps({
|
||||
@@ -12,8 +12,11 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**网元ID */
|
||||
neId: {
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@@ -72,9 +75,9 @@ const modalStateFrom = Form.useForm(
|
||||
* @param neType 网元类型
|
||||
* @param neId 网元ID
|
||||
*/
|
||||
function fnModalVisibleByTypeAndId(neType: string, neId: string) {
|
||||
function fnModalVisibleByTypeAndId(coreUid: string, neUid: string) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
getOAMFile(neType, neId)
|
||||
getOAMFile(coreUid, neUid)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
const data = res.data;
|
||||
@@ -116,8 +119,8 @@ function fnModalOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const from = toRaw(modalState.from);
|
||||
saveOAMFile({
|
||||
neType: props.neType,
|
||||
neId: props.neId,
|
||||
coreUid: props.coreUid,
|
||||
neUid: props.neUid,
|
||||
content: from,
|
||||
sync: true,
|
||||
})
|
||||
@@ -128,7 +131,8 @@ function fnModalOk() {
|
||||
if (modalState.restart) {
|
||||
serviceNeAction({
|
||||
neType: props.neType,
|
||||
neId: props.neId,
|
||||
neUid: props.neUid,
|
||||
coreUid: props.coreUid,
|
||||
action: 'restart',
|
||||
});
|
||||
}
|
||||
@@ -168,8 +172,8 @@ watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) {
|
||||
if (props.neType && props.neId) {
|
||||
fnModalVisibleByTypeAndId(props.neType, props.neId);
|
||||
if (props.coreUid && props.neUid) {
|
||||
fnModalVisibleByTypeAndId(props.coreUid, props.neUid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Modal, message } from 'ant-design-vue/es';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { updateNeConfigReload } from '@/api/tool/mml';
|
||||
import { serviceNeAction } from '@/api/ne/neInfo';
|
||||
import { serviceNeAction } from '@/api/ne/neAction';
|
||||
import useMaskStore from '@/store/modules/mask';
|
||||
|
||||
export default function useNeOptions() {
|
||||
@@ -24,7 +24,8 @@ export default function useNeOptions() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
serviceNeAction({
|
||||
neType: row.neType,
|
||||
neId: row.neId,
|
||||
neUid: row.neUid,
|
||||
coreUid: row.coreUid,
|
||||
action: 'start',
|
||||
})
|
||||
.then(res => {
|
||||
@@ -60,7 +61,8 @@ export default function useNeOptions() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
serviceNeAction({
|
||||
neType: row.neType,
|
||||
neId: row.neId,
|
||||
neUid: row.neUid,
|
||||
coreUid: row.coreUid,
|
||||
action: 'restart',
|
||||
})
|
||||
.then(res => {
|
||||
@@ -108,7 +110,8 @@ export default function useNeOptions() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
serviceNeAction({
|
||||
neType: row.neType,
|
||||
neId: row.neId,
|
||||
neUid: row.neUid,
|
||||
coreUid: row.coreUid,
|
||||
action: 'stop',
|
||||
})
|
||||
.then(res => {
|
||||
@@ -141,7 +144,7 @@ export default function useNeOptions() {
|
||||
content: t('views.ne.common.reloadTip'),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
updateNeConfigReload(row.neType, row.neId)
|
||||
updateNeConfigReload(row.coreUid, row.neUid)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success(t('common.operateOk'), 3);
|
||||
@@ -165,7 +168,8 @@ export default function useNeOptions() {
|
||||
name: 'NeFile_2123',
|
||||
query: {
|
||||
neType: row.neType,
|
||||
neId: row.neId,
|
||||
neUid: row.neUid,
|
||||
coreUid: row.coreUid,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,9 +8,11 @@ import { ColumnsType } from 'ant-design-vue/es/table';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
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 useNeOptions from './hooks/useNeOptions';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { getDict } = useDictStore();
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
@@ -45,6 +47,8 @@ let dict: {
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: '',
|
||||
/**带状态信息 */
|
||||
@@ -79,15 +83,18 @@ type TabeStateType = {
|
||||
data: Record<string, any>[];
|
||||
/**勾选记录 */
|
||||
selectedRowKeys: (string | number)[];
|
||||
/**勾选记录 */
|
||||
selectedRows: Record<string, any>[];
|
||||
};
|
||||
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
seached: false,
|
||||
seached: true,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
});
|
||||
|
||||
/**表格字段列 */
|
||||
@@ -98,18 +105,6 @@ let tableColumns: ColumnsType = [
|
||||
align: 'left',
|
||||
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'),
|
||||
dataIndex: 'neName',
|
||||
@@ -118,7 +113,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.ipAddr'),
|
||||
dataIndex: 'ip',
|
||||
dataIndex: 'ipAddr',
|
||||
align: 'left',
|
||||
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.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;
|
||||
/**新增框或修改框ID */
|
||||
editId: number;
|
||||
/**OAM框网元类型ID */
|
||||
neId: string;
|
||||
/**网元修改框 */
|
||||
coreUid: string;
|
||||
neUid: string;
|
||||
neType: string;
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
@@ -202,8 +205,8 @@ let modalState: ModalStateType = reactive({
|
||||
openByBackConf: false,
|
||||
openByOAM: false,
|
||||
openByEdit: false,
|
||||
editId: 0,
|
||||
neId: '',
|
||||
coreUid: '',
|
||||
neUid: '',
|
||||
neType: '',
|
||||
confirmLoading: false,
|
||||
});
|
||||
@@ -214,9 +217,13 @@ let modalState: ModalStateType = reactive({
|
||||
*/
|
||||
function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
if (!row) {
|
||||
modalState.editId = 0;
|
||||
modalState.coreUid = '';
|
||||
modalState.neUid = '';
|
||||
modalState.neType = '';
|
||||
} else {
|
||||
modalState.editId = row.id;
|
||||
modalState.coreUid = row.coreUid;
|
||||
modalState.neUid = row.neUid;
|
||||
modalState.neType = row.neType;
|
||||
}
|
||||
modalState.openByEdit = !modalState.openByEdit;
|
||||
}
|
||||
@@ -227,7 +234,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
*/
|
||||
function fnModalEditOk(from: Record<string, any>) {
|
||||
// 新增时刷新列表
|
||||
if (!from.id) {
|
||||
if (!from.neUid) {
|
||||
fnGetList();
|
||||
return;
|
||||
}
|
||||
@@ -237,16 +244,16 @@ function fnModalEditOk(from: Record<string, any>) {
|
||||
|
||||
/**局部更新信息 */
|
||||
function reloadRowInfo(row: Record<string, any>) {
|
||||
stateNeInfo(row.neType, row.neId)
|
||||
stateNeInfo(row.coreUid, row.neUid)
|
||||
.then(res => {
|
||||
// 找到编辑更新的网元
|
||||
const item = tableState.data.find(s => s.id === row.id);
|
||||
if (item && res.code === RESULT_CODE_SUCCESS) {
|
||||
item.neType = row.neType;
|
||||
item.neId = row.neId;
|
||||
item.rmUid = row.rmUid;
|
||||
item.neUid = row.neUid;
|
||||
item.coreUid = row.coreUid;
|
||||
item.neName = row.neName;
|
||||
item.ip = row.ip;
|
||||
item.ipAddr = row.ipAddr;
|
||||
item.port = row.port;
|
||||
if (res.data.online) {
|
||||
item.status = '1';
|
||||
@@ -271,7 +278,9 @@ function reloadRowInfo(row: Record<string, any>) {
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalEditCancel() {
|
||||
modalState.editId = 0;
|
||||
modalState.coreUid = '';
|
||||
modalState.neUid = '';
|
||||
modalState.neType = '';
|
||||
modalState.openByEdit = false;
|
||||
modalState.openByOAM = false;
|
||||
modalState.openByBackConf = false;
|
||||
@@ -282,7 +291,7 @@ function fnModalEditCancel() {
|
||||
* @param id 编号
|
||||
*/
|
||||
function fnRecordDelete(id: string) {
|
||||
if (!id || modalState.confirmLoading) return;
|
||||
if (modalState.confirmLoading) return;
|
||||
let msg = t('views.ne.neInfo.delTip');
|
||||
if (id === '0') {
|
||||
msg = `${msg} ...${tableState.selectedRowKeys.length}`;
|
||||
@@ -295,9 +304,29 @@ function fnRecordDelete(id: string) {
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
delNeInfo(id)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
let reqArr: any = [];
|
||||
if (id === '0') {
|
||||
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);
|
||||
// 过滤掉删除的id
|
||||
tableState.data = tableState.data.filter(item => {
|
||||
@@ -311,7 +340,7 @@ function fnRecordDelete(id: string) {
|
||||
neStore.fnNelistRefresh();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
content: t('common.operateErr'),
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
@@ -348,15 +377,17 @@ function fnRecordMore(type: string | number, row: Record<string, any>) {
|
||||
fnNeLogFile(row);
|
||||
break;
|
||||
case 'oam':
|
||||
modalState.neId = row.neId;
|
||||
modalState.coreUid = row.coreUid;
|
||||
modalState.neUid = row.neUid;
|
||||
modalState.neType = row.neType;
|
||||
modalState.openByOAM = !modalState.openByOAM;
|
||||
break;
|
||||
case 'backConfExport':
|
||||
backConf.value.exportConf(row.neType, row.neId);
|
||||
backConf.value.exportConf(row.coreUid, row.neUid, row.neType);
|
||||
break;
|
||||
case 'backConfImport':
|
||||
modalState.neId = row.neId;
|
||||
modalState.coreUid = row.coreUid;
|
||||
modalState.neUid = row.neUid;
|
||||
modalState.neType = row.neType;
|
||||
modalState.openByBackConf = !modalState.openByBackConf;
|
||||
break;
|
||||
@@ -711,7 +742,9 @@ onMounted(() => {
|
||||
<!-- 新增框或修改框 -->
|
||||
<EditModal
|
||||
v-model:open="modalState.openByEdit"
|
||||
:edit-id="modalState.editId"
|
||||
:core-uid="modalState.coreUid"
|
||||
:ne-uid="modalState.neUid"
|
||||
:ne-type="modalState.neType"
|
||||
@ok="fnModalEditOk"
|
||||
@cancel="fnModalEditCancel"
|
||||
></EditModal>
|
||||
@@ -719,7 +752,8 @@ onMounted(() => {
|
||||
<!-- OAM编辑框 -->
|
||||
<OAMModal
|
||||
v-model:open="modalState.openByOAM"
|
||||
:ne-id="modalState.neId"
|
||||
:core-uid="modalState.coreUid"
|
||||
:ne-uid="modalState.neUid"
|
||||
:ne-type="modalState.neType"
|
||||
@cancel="fnModalEditCancel"
|
||||
></OAMModal>
|
||||
@@ -728,7 +762,8 @@ onMounted(() => {
|
||||
<BackConfModal
|
||||
ref="backConf"
|
||||
v-model:open="modalState.openByBackConf"
|
||||
:ne-id="modalState.neId"
|
||||
:core-uid="modalState.coreUid"
|
||||
:ne-uid="modalState.neUid"
|
||||
:ne-type="modalState.neType"
|
||||
@cancel="fnModalEditCancel"
|
||||
></BackConfModal>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import {
|
||||
changeNeLicense,
|
||||
getNeLicense,
|
||||
getNeLicenseByTypeAndID,
|
||||
getNeLicenseByNF,
|
||||
} from '@/api/ne/neLicense';
|
||||
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
|
||||
import { FileType } from 'ant-design-vue/es/upload/interface';
|
||||
@@ -22,13 +22,15 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**记录ID 优先级高于neId */
|
||||
editId: {
|
||||
id: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
/**网元ID */
|
||||
neId: {
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@@ -218,9 +220,9 @@ function fnDownCode() {
|
||||
* 对话框弹出显示为 ID编辑
|
||||
* @param id id
|
||||
*/
|
||||
function fnModalVisibleById(id: number) {
|
||||
function fnModalVisibleById(coreUid: string, id: number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
getNeLicense(id)
|
||||
getNeLicense(coreUid, id)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(modalState.from, res.data);
|
||||
@@ -243,9 +245,9 @@ function fnModalVisibleById(id: number) {
|
||||
* @param neType 网元类型
|
||||
* @param neId 网元ID
|
||||
*/
|
||||
function fnModalVisibleByTypeAndId(neType: string, neId: string) {
|
||||
function fnModalVisibleByTypeAndId(coreUid: string, neUid: string) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
getNeLicenseByTypeAndID(neType, neId)
|
||||
getNeLicenseByNF(coreUid, neUid)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(modalState.from, res.data);
|
||||
@@ -267,12 +269,13 @@ function fnModalVisibleByTypeAndId(neType: string, neId: string) {
|
||||
watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) {
|
||||
if (props.editId > 0) {
|
||||
fnModalVisibleById(props.editId);
|
||||
console.log(props);
|
||||
if (val && props.coreUid) {
|
||||
if (props.neUid) {
|
||||
fnModalVisibleByTypeAndId(props.coreUid, props.neUid);
|
||||
}
|
||||
if (props.neType && props.neId) {
|
||||
fnModalVisibleByTypeAndId(props.neType, props.neId);
|
||||
if (props.id) {
|
||||
fnModalVisibleById(props.coreUid, props.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,7 +317,7 @@ onMounted(() => {});
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label-col="{ span: 12 }"
|
||||
:label="t('views.ne.common.neId')"
|
||||
:label="t('views.ne.common.neUid')"
|
||||
name="neId"
|
||||
>
|
||||
{{ modalState.from.neId }}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<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 { Modal, TableColumnsType, message } from 'ant-design-vue/es';
|
||||
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 { listNeLicense, stateNeLicense } from '@/api/ne/neLicense';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
const { getDict } = useDictStore();
|
||||
const neStore = useNeStore();
|
||||
@@ -22,10 +30,10 @@ let dictStatus = ref<DictType[]>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: undefined,
|
||||
/**网元ID */
|
||||
neId: '',
|
||||
/**序列号 */
|
||||
serialNum: '',
|
||||
/**当前页数 */
|
||||
@@ -38,7 +46,6 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
neType: undefined,
|
||||
neId: '',
|
||||
serialNum: '',
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
@@ -79,12 +86,6 @@ let tableColumns = ref<TableColumnsType>([
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.neLicense.status'),
|
||||
dataIndex: 'status',
|
||||
@@ -105,8 +106,8 @@ let tableColumns = ref<TableColumnsType>([
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.capability'),
|
||||
dataIndex: 'capability',
|
||||
title: t('views.ne.common.ueNumber'),
|
||||
dataIndex: 'ueNumber',
|
||||
align: 'left',
|
||||
customRender(opt) {
|
||||
if (['UDM', 'AMF', 'MME'].includes(opt.record.neType)) {
|
||||
@@ -116,6 +117,18 @@ let tableColumns = ref<TableColumnsType>([
|
||||
},
|
||||
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'),
|
||||
dataIndex: 'remark',
|
||||
@@ -216,8 +229,9 @@ function fnGetList(pageNum?: number) {
|
||||
type ModalStateType = {
|
||||
/**新增框或修改框是否显示 */
|
||||
openByEdit: boolean;
|
||||
/**授权记录ID */
|
||||
licenseId: number;
|
||||
coreUid: string;
|
||||
neUid: string;
|
||||
neType: string;
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
};
|
||||
@@ -225,17 +239,23 @@ type ModalStateType = {
|
||||
/**对话框对象信息状态 */
|
||||
let modalState: ModalStateType = reactive({
|
||||
openByEdit: false,
|
||||
licenseId: 0,
|
||||
coreUid: '',
|
||||
neUid: '',
|
||||
neType: '',
|
||||
confirmLoading: false,
|
||||
});
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* @param licenseId id
|
||||
* @param row id
|
||||
*/
|
||||
function fnModalVisibleByEdit(licenseId: number) {
|
||||
modalState.licenseId = licenseId;
|
||||
modalState.openByEdit = true;
|
||||
function fnModalVisibleByEdit(row: Record<string, any>) {
|
||||
modalState.coreUid = row.coreUid;
|
||||
modalState.neUid = row.neUid;
|
||||
modalState.neType = row.neType;
|
||||
nextTick(() => {
|
||||
modalState.openByEdit = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,13 +263,9 @@ function fnModalVisibleByEdit(licenseId: number) {
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalOk(e: any) {
|
||||
const next = () => {
|
||||
// 刷新授权状态
|
||||
stateNeLicense(e.neType, e.neId);
|
||||
// 获取列表数据
|
||||
fnGetList();
|
||||
};
|
||||
setTimeout(() => next(), 2_000);
|
||||
// 刷新授权状态
|
||||
stateNeLicense(e.coreUid, e.neUid);
|
||||
setTimeout(() => fnGetList(), 2_000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,7 +274,9 @@ function fnModalOk(e: any) {
|
||||
*/
|
||||
function fnModalCancel() {
|
||||
modalState.openByEdit = false;
|
||||
modalState.licenseId = 0;
|
||||
modalState.coreUid = '';
|
||||
modalState.neUid = '';
|
||||
modalState.neType = '';
|
||||
}
|
||||
|
||||
/**刷新网元授权状态 */
|
||||
@@ -270,22 +288,23 @@ function fnRecordState(row: Record<string, any>) {
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
stateNeLicense(row.neType, row.neId)
|
||||
stateNeLicense(row.coreUid, row.neUid)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
row.status = '1';
|
||||
row.serialNum = res.data.sn;
|
||||
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();
|
||||
message.success(
|
||||
`${row.neType} ${row.neId} ${dictStatus.value[1].label}`,
|
||||
`${row.id} ${row.neType} ${dictStatus.value[1].label}`,
|
||||
3
|
||||
);
|
||||
} else {
|
||||
row.status = '0';
|
||||
message.warning(
|
||||
`${row.neType} ${row.neId} ${dictStatus.value[0].label}`,
|
||||
`${row.id} ${row.neType} ${dictStatus.value[0].label}`,
|
||||
3
|
||||
);
|
||||
}
|
||||
@@ -311,7 +330,7 @@ function fnRecordStateReload() {
|
||||
if (row.neType.toUpperCase() === 'OMC') {
|
||||
continue;
|
||||
}
|
||||
await stateNeLicense(row.neType, row.neId);
|
||||
await stateNeLicense(row.coreUid, row.neUid);
|
||||
}
|
||||
hide();
|
||||
message.success(t('common.operateOk'), 3);
|
||||
@@ -354,15 +373,6 @@ onMounted(() => {
|
||||
/>
|
||||
</a-form-item>
|
||||
</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-form-item
|
||||
:label="t('views.ne.common.serialNum')"
|
||||
@@ -483,7 +493,7 @@ onMounted(() => {
|
||||
<template #title>{{ t('views.ne.neLicense.change') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.id)"
|
||||
@click.prevent="fnModalVisibleByEdit(record)"
|
||||
>
|
||||
<template #icon><UploadOutlined /> </template>
|
||||
</a-button>
|
||||
@@ -497,7 +507,9 @@ onMounted(() => {
|
||||
<!-- 文件上传框 -->
|
||||
<EditModal
|
||||
v-model:open="modalState.openByEdit"
|
||||
:edit-id="modalState.licenseId"
|
||||
:core-uid="modalState.coreUid"
|
||||
:ne-uid="modalState.neUid"
|
||||
:ne-type="modalState.neType"
|
||||
@ok="fnModalOk"
|
||||
@cancel="fnModalCancel"
|
||||
></EditModal>
|
||||
|
||||
@@ -23,6 +23,7 @@ import useAppStore from '@/store/modules/app';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { listAllNeInfo } from '@/api/ne/neInfo';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { getDict } = useDictStore();
|
||||
const appStore = useAppStore();
|
||||
const route = useRoute();
|
||||
@@ -126,7 +127,10 @@ let serverState: any = ref({});
|
||||
async function fnGetList(reload: boolean = false) {
|
||||
tableState.loading = !reload;
|
||||
try {
|
||||
const res = await listAllNeInfo({ bandStatus: true });
|
||||
const res = await listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: true,
|
||||
});
|
||||
tableState.data = res.data;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -151,10 +155,10 @@ async function fnGetList(reload: boolean = false) {
|
||||
if (!reload) {
|
||||
// 选择第一个
|
||||
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) {
|
||||
const id = item.id;
|
||||
fnTableSelectedRowKeys([id]);
|
||||
fnTableSelectedRowKeys([id]);
|
||||
}
|
||||
} else {
|
||||
fnTableSelectedRowKeys(tableState.selectedRowKeys);
|
||||
@@ -250,8 +254,8 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
||||
|
||||
serverState.value = Object.assign(
|
||||
{
|
||||
// cpuUse: `NE:${nfCpuP}%; SYS:${sysCpuP}%`,
|
||||
// memoryUse: `Total: ${totalMemInMB}MB; NE: ${nfUsedMemInMB}MB; SYS: ${sysMemUsageInMB}MB`,
|
||||
// cpuUse: `NE:${nfCpuP}%; SYS:${sysCpuP}%`,
|
||||
// memoryUse: `Total: ${totalMemInMB}MB; NE: ${nfUsedMemInMB}MB; SYS: ${sysMemUsageInMB}MB`,
|
||||
},
|
||||
neState
|
||||
);
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Form, Modal, message } from 'ant-design-vue/es';
|
||||
import { onMounted, reactive, toRaw } from 'vue';
|
||||
import { addNeInfo, getNeInfoByTypeAndID, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { NE_TYPE_LIST } from '@/constants/ne-constants';
|
||||
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
|
||||
@@ -9,6 +9,8 @@ import { fnRestStepState, fnToStepName, stepState } from '../hooks/useStep';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useNeStore from '@/store/modules/ne';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { getNeInfoByNF } from '@/api/ne/neAction';
|
||||
const { getDict } = useDictStore();
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
@@ -51,8 +53,8 @@ let modalState: ModalStateType = reactive({
|
||||
ip: '',
|
||||
port: 33030,
|
||||
pvFlag: 'PNF',
|
||||
rmUid: '4400HXAMF001',
|
||||
neAddress: '',
|
||||
coreUid: currentCoreUid(),
|
||||
macAddr: '',
|
||||
dn: '-',
|
||||
vendorName: '-',
|
||||
province: 'Area',
|
||||
@@ -102,7 +104,7 @@ const modalStateFrom = Form.useForm(
|
||||
neId: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.ne.common.neIdPlease'),
|
||||
message: t('views.ne.common.neUidPlease'),
|
||||
},
|
||||
],
|
||||
ip: [
|
||||
@@ -146,7 +148,7 @@ function fnModalOk() {
|
||||
.validate()
|
||||
.then(e => {
|
||||
modalState.confirmLoading = true;
|
||||
return getNeInfoByTypeAndID(from.neType, from.neId);
|
||||
return getNeInfoByNF(from.coreUid, from.neUid);
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
@@ -378,7 +380,7 @@ onMounted(() => {
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.ne.common.neId')"
|
||||
:label="t('views.ne.common.neUid')"
|
||||
name="neId"
|
||||
v-bind="modalStateFrom.validateInfos.neId"
|
||||
>
|
||||
@@ -391,7 +393,7 @@ onMounted(() => {
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
{{ t('views.ne.common.neIdTip') }}
|
||||
{{ t('views.ne.common.neUidTip') }}
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
|
||||