Merge branch 'main-v2' into lite-ba

This commit is contained in:
TsMask
2025-09-19 14:55:52 +08:00
34 changed files with 2135 additions and 122 deletions

View File

@@ -36,3 +36,33 @@ export function updateBackupFTP(data: Record<string, any>) {
data,
});
}
/**
* 备份文件-导出OMC
* @returns object
*/
export function exportBackupOMC() {
return request({
url: '/neData/backup/export-omc',
method: 'POST',
responseType: 'blob',
timeout: 180_000,
});
}
/**
* 备份文件-导入OMC
* @param filePath 备份文件上传返回的/upload 路径
* @returns object
*/
export function importBackupOMC(filePath: string) {
return request({
url: '/neData/backup/import-omc',
method: 'POST',
data: {
neType: 'OMC',
path: filePath,
},
timeout: 180_000,
});
}

View File

@@ -485,7 +485,7 @@ export default {
resultOk: "Success",
resultFail: "Fail",
delTip: "Confirm deletion of the data item numbered [{msg}]?",
exportTip: "Do you confirm to export the current query conditions of the CDR data? (Maximum 10,000 items can be exported.)",
exportTip: "Do you confirm to export the current query conditions of the CDR data?",
chargingID: 'Charging ID',
smfSubscriptionIDData: 'Subscription ID Data',
smfSubscriptionIDType: 'Subscription ID Type',
@@ -517,7 +517,7 @@ export default {
result: "Result",
resultOk: "Successes",
delTip: "Confirm deletion of the data item numbered [{msg}]?",
exportTip: "Do you confirm to export the event data of the current query condition? (Maximum 10,000 items can be exported.)",
exportTip: "Do you confirm to export the event data of the current query condition?",
},
},
ne: {
@@ -590,6 +590,21 @@ export default {
kpiTimerPlease: 'Please enter the reporting period (in seconds)',
omcIP: 'OMC IP',
},
quickOam: {
title: 'Quick OAM Configuration',
selectNe: 'Select NE',
omcIP: 'OMC IP',
oamPort: 'OAM Port',
progress:'Progress',
processing:'Progressing',
result:'Result',
success:'Success',
default:'Default',
},
quickUpload: {
title: 'Quick License Upload',
selectNe: 'Select NE',
},
backConf: {
export: 'Config Export',
import: 'Config Import',
@@ -701,6 +716,10 @@ export default {
uploadFile: "Upload License",
uploadChangeOk: 'Network Element renewed license successfully and is being calibrated in the background!',
uploadChangeFail: "Some network elements failed to update the license, please check whether the service terminal environment is available!",
quickUpload: {
title: 'Quick License Upload',
selectNe: 'Select NE',
},
},
neConfig: {
treeTitle: "Navigation Configuration",
@@ -826,7 +845,7 @@ export default {
passwordPlease: "Please enter your password correctly",
addTitle: 'Add VOIP subscriber',
delTip: 'Confirm that you want to delete the information of VOIP user as [{num}]?',
exportTip: "Confirm exporting xlsx table files based on search criteria?",
exportTip: "Confirm exporting all VOIP user data based on the current search criteria?",
},
udmVolteIMS: {
startMSISDN: 'Starting MSISDN',
@@ -835,7 +854,7 @@ export default {
vniTip: 'Example: ims.mnc000.mcc000.3gppnetwork.org',
vniPlease: 'Please enter VNI correctly',
delTip: 'Are you sure you want to delete the information of IMS signing as [{num}]?',
exportTip: "Confirm exporting xlsx table files based on search criteria?",
exportTip: "Confirm exporting all VoLTE user data based on the current search criteria?",
},
pcfSub: {
exportTip: 'Confirm exporting all user policy control information data?',
@@ -886,7 +905,7 @@ export default {
neTypePlease: 'Query network element Object',
neType: 'UDM Object',
export: 'Export',
exportConfirm: 'Are you sure to export all authentication user data?',
exportConfirm: 'Confirm exporting all Authentication user data based on the current search criteria?',
checkExport : 'Check Export',
checkExportConfirm: 'Confirm exporting the checked authenticated user data?',
import: 'Import',
@@ -915,7 +934,7 @@ export default {
subInfo:' Subscription Info',
neType: 'UDM Object',
export: 'Export',
exportConfirm: 'Are you sure to export all signed user data?',
exportConfirm: 'Confirm exporting all Subscribers user data based on the current search criteria?',
checkExport : 'Check Export',
checkExportConfirm: 'Are you sure to export the data of the checked subscribers?',
import: 'Import',
@@ -1341,10 +1360,18 @@ export default {
deleteTipErr: "Failed to delete file",
sysloginLog:'System Login Log',
sysOperateLog:'System Operation Log',
cdrIMS:'CDR Voice',
cdrSMF:'CDR Data',
cdrSMSC:'CDR SMS',
cdrSGWC:'CDR Roaming Data',
cdrIMS:'CDR IMS Voice',
cdrSMF:'CDR SMF Data',
cdrSMSC:'CDR SMSC SMS',
cdrSGWC:'CDR SGWC Roaming Data',
kpiIMS:'KPI IMS',
kpiAMF:'KPI AMF',
kpiUDM:'KPI UDM',
kpiSMF:'KPI SMF',
kpiPCF:'KPI PCF',
kpiUPF:'KPI UPF',
kpiMME:'KPI MME',
kpiSMSC:'KPI SMSC',
}
},
monitor: {
@@ -1889,6 +1916,10 @@ export default {
home: 'Home Page',
homeTip:'Do you want to submit the current interface as the system interface?',
homeSet:'Home Page Settings',
backup: 'System Backup',
backupInstruction: 'System backup will back up the net element information records and configuration files running on the current system, and can restore the system to the previous state!',
backupExportTip: 'Confirm to export system backup?',
backupImportTip: 'Confirm to import system backup?',
},
role:{
allScopeOptions:'All data permissions',

View File

@@ -485,7 +485,7 @@ export default {
resultOk: "成功",
resultFail: "失败",
delTip: "确认删除编号为【{msg}】的数据项?",
exportTip: "确认导出当前查询条件的话单数据吗?(导出最大支持一万条)",
exportTip: "确认导出当前查询条件的话单数据吗?",
chargingID: '计费ID',
smfSubscriptionIDData: '订阅 ID 数据',
smfSubscriptionIDType: '订阅 ID 类型',
@@ -517,7 +517,7 @@ export default {
result: "结果",
resultOk: "成功",
delTip: "确认删除编号为【{msg}】的数据项?",
exportTip: "确认导出当前查询条件的事件数据吗?(导出最大支持一万条)",
exportTip: "确认导出当前查询条件的事件数据吗?",
},
},
ne: {
@@ -590,6 +590,21 @@ export default {
kpiTimerPlease: '请输入上报周期(单位秒)',
omcIP: 'OMC IP',
},
quickOam: {
title: '快速OAM配置',
selectNe: '选择网元',
omcIP: 'OMC IP地址',
oamPort: 'OAM端口',
progress:'配置进度',
processing:'正在处理',
result:'操作结果',
success:'成功',
default:'失败',
},
quickUpload: {
title: '快速许可证上传',
selectNe: '选择网元',
},
backConf: {
export: '配置导出',
import: '配置导入',
@@ -701,6 +716,10 @@ export default {
uploadFile: "上传许可证",
uploadChangeOk: '网元更新许可证成功,正在后台校验!',
uploadChangeFail: "部分网元更新许可证失败,请检查服务终端环境是否可用!",
quickUpload: {
title: '快速许可证上传',
selectNe: '选择网元',
},
},
neConfig: {
treeTitle: "配置导航",
@@ -826,7 +845,7 @@ export default {
passwordPlease: "请正确输入密码",
addTitle: '新增VOIP用户',
delTip: '确认要删除VOIP用户为【{num}】的信息吗?',
exportTip: "确认根据搜索条件导出xlsx表格文件吗?",
exportTip: "确认根据当前搜索条件导出全部VoIP用户数据吗",
},
udmVolteIMS: {
startMSISDN: '起始MSISDN',
@@ -835,7 +854,7 @@ export default {
vniTip: '示例ims.mnc000.mcc000.3gppnetwork.org',
vniPlease: '请正确输入VNI',
delTip: '确认要删除IMS签约为【{num}】的信息吗?',
exportTip: "确认根据搜索条件导出xlsx表格文件吗?",
exportTip: "确认根据当前搜索条件导出全部VoLTE用户数据吗",
},
pcfSub: {
exportTip: '确认导出全部用户策略控制信息数据吗?',
@@ -886,7 +905,7 @@ export default {
neTypePlease: '查询网元类型',
neType: 'UDM网元对象',
export: '导出',
exportConfirm: '确认导出全部鉴权用户数据吗?',
exportConfirm: '确认根据当前搜索条件导出全部鉴权用户数据吗?',
checkExport : '勾选导出',
checkExportConfirm: '确认导出已勾选的鉴权用户数据吗?',
import: '导入',
@@ -917,7 +936,7 @@ export default {
export: '导出',
exportConfirm: '确认导出全部签约用户数据吗?',
checkExport : '勾选导出',
checkExportConfirm: '确认导出已勾选的签约用户数据吗?',
checkExportConfirm: '确认根据当前搜索条件导出全部签约用户数据吗?',
import: '导入',
importFail: '失败记录',
loadDataConfirm: '确认要重新加载数据吗?',
@@ -1341,10 +1360,18 @@ export default {
deleteTipErr: "文件删除失败",
sysloginLog:'系统登录日志',
sysOperateLog:'系统操作日志',
cdrIMS:'语音话单',
cdrSMF:'数据话单',
cdrSMSC:'短信话单',
cdrSGWC:'漫游数据话单',
cdrIMS:'话单 IMS 语音',
cdrSMF:'话单 SMF 数据',
cdrSMSC:'话单 SMSC 短信',
cdrSGWC:'话单 SGWC 漫游数据',
kpiIMS:'KPI IMS',
kpiAMF:'KPI AMF',
kpiUDM:'KPI UDM',
kpiSMF:'KPI SMF',
kpiPCF:'KPI PCF',
kpiUPF:'KPI UPF',
kpiMME:'KPI MME',
kpiSMSC:'KPI SMSC',
}
},
monitor: {
@@ -1889,6 +1916,10 @@ export default {
home: '系统首页',
homeTip:'确认要提交当前界面为系统界面吗?',
homeSet:'系统首页设置',
backup: '系统备份',
backupInstruction: '系统备份将会对当前系统上运行的网元信息记录及配置文件进行备份,可进行系统的恢复操作!',
backupExportTip: '确认要导出系统备份吗?',
backupImportTip: '确认要导入系统备份吗?',
},
role:{
allScopeOptions:'全部数据权限',

View File

@@ -217,6 +217,7 @@ onMounted(() => {
let serverTimeInterval: any = null;
let serverTime = 0;
let serverTimeZone = getTimezoneOffset();
let activeAlarmRefresh = 0;
// 获取服务器时间
function fnGetServerTime() {
@@ -230,6 +231,7 @@ function fnGetServerTime() {
const serverTimeDom = document.getElementById('serverTimeDom');
serverTimeInterval = setInterval(() => {
serverTime += 1000;
activeAlarmRefresh += 1;
if (serverTimeDom) {
serverTimeDom.innerText = parseDateUTCToStr(
serverTime,
@@ -239,6 +241,10 @@ function fnGetServerTime() {
clearInterval(serverTimeInterval);
serverTimeInterval = null;
}
if (activeAlarmRefresh === 5) {
useAlarmStore().fnGetActiveAlarmInfo();
activeAlarmRefresh = 0;
}
}, 1000);
}
});

View File

@@ -17,6 +17,35 @@ export const RFC3339 = 'YYYY-MM-DDTHH:mm:ssZ';
/**国际时间 列如Thu, Nov 14 2024 10:19 GMT+08:00 */
export const RFC822Z = 'ddd, MMM DD YYYY HH:mm [GMT]Z';
// 映射时区偏移量与IANA时区名称关联
export const offsetToIanaMap: Record<string, string> = {
'+0000': 'UTC',
'+0100': 'Europe/London',
'+0200': 'Europe/Paris',
'+0300': 'Europe/Moscow',
'+0400': 'Asia/Dubai',
'+0500': 'Asia/Karachi',
'+0600': 'Asia/Almaty',
'+0700': 'Asia/Bangkok',
'+0800': 'Asia/Shanghai',
'+0900': 'Asia/Tokyo',
'+1000': 'Australia/Sydney',
'+1100': 'Pacific/Noumea',
'+1200': 'Pacific/Fiji',
'-0100': 'America/Noronha',
'-0200': 'Atlantic/Azores',
'-0300': 'America/Argentina/Buenos_Aires',
'-0400': 'America/New_York',
'-0500': 'America/New_York',
'-0600': 'America/Chicago',
'-0700': 'America/Denver',
'-0800': 'America/Los_Angeles',
'-0900': 'Pacific/Honolulu',
'-1000': 'Pacific/Honolulu',
'-1100': 'Pacific/Pago_Pago',
'-1200': 'Pacific/Kwajalein',
};
/**
* 格式时间字符串
* @param dateStr 时间字符串
@@ -53,9 +82,10 @@ export function parseDateUTCToStr(
date: string | number | Date,
offset: string = '+0000'
): string {
const ianaTimezone = offsetToIanaMap[offset] || 'UTC';
return dayjs
.utc(date) // 将时间戳按 UTC 时间
.tz(offset) // 使用时区偏移
.tz(ianaTimezone) // 使用时区偏移
.format(`YYYY-MM-DD HH:mm:ss [UTC${offset}]`); // 格式化时间
}

View File

@@ -342,7 +342,8 @@ function fnExportList() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageSize = 10000;
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportAMFDataUE(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -411,7 +411,8 @@ function fnExportList() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageSize = 10000;
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportIMSDataCDR(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -344,7 +344,8 @@ function fnExportList() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageSize = 10000;
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportMMEDataUE(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -381,7 +381,8 @@ function fnExportList() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageSize = 10000;
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportSGWCDataCDR(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -20,6 +20,7 @@ import { OptionsType, WS } from '@/plugins/ws-websocket';
import PQueue from 'p-queue';
import saveAs from 'file-saver';
import dayjs, { type Dayjs } from 'dayjs';
import { parseSizeFromByte } from '@/utils/parse-utils';
import { useClipboard } from '@vueuse/core';
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
@@ -165,7 +166,7 @@ let tableColumns = ref<ColumnsType>([
}
}
}
return dataVolumeUplink;
return parseSizeFromByte(dataVolumeUplink);
},
},
{
@@ -190,7 +191,7 @@ let tableColumns = ref<ColumnsType>([
}
}
}
return dataVolumeDownlink;
return parseSizeFromByte(dataVolumeDownlink);
},
},
{
@@ -215,7 +216,7 @@ let tableColumns = ref<ColumnsType>([
}
}
}
return dataTotalVolume;
return parseSizeFromByte(dataTotalVolume);
},
},
{
@@ -408,7 +409,8 @@ function fnExportList() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageSize = 10000;
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportSMFDataCDR(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -811,15 +813,21 @@ onBeforeUnmount(() => {
<div>
<div>
<span>Data Total Volume: </span>
<span>{{ udata.dataTotalVolume }}</span>
<span>
{{ parseSizeFromByte(udata.dataTotalVolume || 0) }}
</span>
</div>
<div>
<span>Data Volume Downlink: </span>
<span>{{ udata.dataVolumeDownlink }}</span>
<span>
{{ parseSizeFromByte(udata.dataVolumeDownlink || 0) }}
</span>
</div>
<div>
<span>Data Volume Uplink: </span>
<span>{{ udata.dataVolumeUplink }}</span>
<span>
{{ parseSizeFromByte(udata.dataVolumeUplink || 0) }}
</span>
</div>
<!-- <div>
<span>Time: </span>

View File

@@ -375,7 +375,8 @@ function fnExportList() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageSize = 10000;
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportSMSCDataCDR(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue';
import { reactive, ref, onMounted, toRaw, onBeforeUnmount } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal';
import { message, Modal } from 'ant-design-vue/es';
@@ -560,7 +560,8 @@ function fnCancelConfirm() {
*/
function fnSync() {
const hide = message.loading(t('common.loading'), 0);
listSync().then(res => {
listSync()
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.faultManage.activeAlarm.sysncSuss'),
@@ -573,7 +574,8 @@ function fnSync() {
duration: 2,
});
}
}).finally(()=>{
})
.finally(() => {
hide();
});
}
@@ -821,6 +823,24 @@ function fnGetList(pageNum?: number) {
});
}
let interval: any = null;
/**自动刷新 */
function AutoRefresh() {
interval = setInterval(() => {
listAct(toRaw(queryParams)).then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS) {
const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
} else {
tablePagination.total = 0;
tableState.data = [];
}
});
}, 5_000);
}
onMounted(() => {
// 初始字典数据
Promise.allSettled([
@@ -844,7 +864,12 @@ onMounted(() => {
});
// 获取列表
fnGetList();
// 自动刷新
AutoRefresh();
});
onBeforeUnmount(() => {
clearInterval(interval);
})
</script>
<template>
@@ -957,7 +982,11 @@ onMounted(() => {
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
</a-button>
<a-button type="primary" @click.prevent="fnSync()">
<a-button
type="primary"
@click.prevent="fnSync()"
v-perms:has="['faultManage:active-alarm:async']"
>
<template #icon>
<ReloadOutlined />
</template>
@@ -974,6 +1003,7 @@ onMounted(() => {
danger
@click.prevent="fnClear()"
:disabled="state.selectedRowKeys.length <= 0"
v-perms:has="['faultManage:active-alarm:delete']"
>
<template #icon>
<DeleteOutlined />
@@ -981,7 +1011,11 @@ onMounted(() => {
{{ t('views.faultManage.activeAlarm.clear') }}
</a-button>
<a-button type="dashed" @click.prevent="fnExportList()">
<a-button
type="dashed"
@click.prevent="fnExportList()"
v-perms:has="['faultManage:active-alarm:export']"
>
<template #icon><ExportOutlined /></template>
{{ t('common.export') }}
</a-button>

View File

@@ -744,7 +744,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button type="dashed" @click.prevent="fnExportList()">
<a-button type="dashed" @click.prevent="fnExportList()" v-perms:has="['faultManage:history-alarm:export']">
<template #icon><ExportOutlined /></template>
{{ t('common.export') }}
</a-button>

View File

@@ -31,28 +31,70 @@ let sourceState = reactive({
path: '/usr/local/omc/backup',
},
{
value: '/cdr/ims_cdr_event',
value: '/cdr/ims',
label: t('views.logManage.exportFile.cdrIMS'),
path: '/usr/local/omc/backup',
neType: 'IMS',
},
{
value: '/cdr/smf_cdr_event',
value: '/cdr/smf',
label: t('views.logManage.exportFile.cdrSMF'),
path: '/usr/local/omc/backup',
neType: 'SMF',
},
{
value: '/cdr/smsc_cdr_event',
value: '/cdr/smsc',
label: t('views.logManage.exportFile.cdrSMSC'),
path: '/usr/local/omc/backup',
neType: 'SMSC',
},
{
value: '/cdr/sgwc_cdr_event',
label: t('views.logManage.exportFile.cdrSGWC'),
value: '/kpi/ims',
label: t('views.logManage.exportFile.kpiIMS'),
path: '/usr/local/omc/backup',
neType: 'SGWC',
neType: 'IMS',
},
{
value: '/kpi/amf',
label: t('views.logManage.exportFile.kpiAMF'),
path: '/usr/local/omc/backup',
neType: 'AMF',
},
{
value: '/kpi/udm',
label: t('views.logManage.exportFile.kpiUDM'),
path: '/usr/local/omc/backup',
neType: 'UDM',
},
{
value: '/kpi/smf',
label: t('views.logManage.exportFile.kpiSMF'),
path: '/usr/local/omc/backup',
neType: 'SMF',
},
{
value: '/kpi/pcf',
label: t('views.logManage.exportFile.kpiPCF'),
path: '/usr/local/omc/backup',
neType: 'PCF',
},
{
value: '/kpi/upf',
label: t('views.logManage.exportFile.kpiUPF'),
path: '/usr/local/omc/backup',
neType: 'UPF',
},
{
value: '/kpi/mme',
label: t('views.logManage.exportFile.kpiMME'),
path: '/usr/local/omc/backup',
neType: 'MME',
},
{
value: '/kpi/smsc',
label: t('views.logManage.exportFile.kpiSMSC'),
path: '/usr/local/omc/backup',
neType: 'SMSC',
},
],
/**选择value */

View File

@@ -0,0 +1,592 @@
<script setup lang="ts">
import { reactive, toRaw, watch, ref } from 'vue';
import { ProModal } from 'antdv-pro-modal';
import { Form, message } from 'ant-design-vue/es';
import useI18n from '@/hooks/useI18n';
import useNeListStore from '@/store/modules/ne_list';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import {
getNeConfigData,
addNeConfigData,
editNeConfigData,
} from '@/api/ne/neConfig';
const { t } = useI18n();
const neListStore = useNeListStore();
const emit = defineEmits(['ok', 'cancel', 'update:open']);
const props = defineProps({
open: {
type: Boolean,
default: false,
required: true,
},
});
/**网元类型_多neId */
let neCascaderOptions = ref<Record<string, any>[]>([]);
/**对话框对象信息状态类型 */
type ModalStateType = {
/**新增框或修改框是否显示 */
openByEdit: boolean;
/**标题 */
title: string;
/**表单数据 */
from: Record<string, any>;
/**网元类型 */
neType: string[];
/**需要配置的网元列表 */
toNe: {
neType: string;
neId: string;
}[];
/**提示信息 */
msg: string;
/**确定按钮 loading */
confirmLoading: boolean;
};
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
openByEdit: false,
title: 'PLMN Info',
from: {
plmnId: {
mcc: '001',
mnc: '01',
},
tac: '4388',
snssai: {
sst: '1',
sd: '000001',
},
dnn_data: 'internet',
dnn_ims: 'ims',
},
neType: [],
toNe: [],
msg: '',
confirmLoading: false,
});
/**对话框内表单属性和校验规则 */
const modalStateFrom = Form.useForm(
modalState.from.plmnId,
reactive({
mcc: [
{
required: true,
message: t('common.inputPlease'),
},
],
mnc: [
{
required: true,
message: t('common.inputPlease'),
},
],
})
);
/**网元类型选择对应修改 */
function fnNeChange(p: any, c: any) {
let neList: { neType: string; neId: string }[] = [];
for (let i = 0; i < p.length; i++) {
const v = p[i];
if (v.length === 1) {
c[i][0].children.forEach((item: any) => {
neList.push({
neType: item.neType,
neId: item.neId,
});
});
} else if (v.length === 2) {
neList.push({
neType: v[0],
neId: v[1],
});
}
}
if (neList.length > 0) {
modalState.toNe = neList;
} else {
modalState.toNe = [];
}
}
/**
* 对话框弹出确认执行函数
* 进行表达规则校验
*/
function fnModalOk() {
if (modalState.confirmLoading) return;
if (modalState.toNe.length === 0) {
message.warning({
content: 'Please select NE',
duration: 3,
});
return;
}
const form = toRaw(modalState.from);
// console.log(form);
modalStateFrom
.validate()
.then(async () => {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
let errArr = [];
for (const item of modalState.toNe) {
const err = await toConfig(item.neType, item.neId, form);
if (err.length > 0) {
errArr.push(...err);
}
}
modalState.msg = errArr.join('\n');
modalState.confirmLoading = false;
emit('ok', JSON.parse(JSON.stringify(form)));
hide();
})
.catch(e => {
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
});
}
/**
* 对话框弹出关闭执行函数
* 进行表达规则校验
*/
function fnModalCancel() {
modalState.openByEdit = false;
modalState.confirmLoading = false;
modalStateFrom.resetFields();
emit('cancel');
emit('update:open', false);
// 还原默认值
modalState.from = {
plmnId: {
mcc: '001',
mnc: '01',
},
tac: '4388',
snssai: {
sst: '1',
sd: '000001',
},
dnn_data: 'internet',
dnn_ims: 'ims',
};
modalState.neType = [];
modalState.toNe = [];
modalState.msg = '';
}
/**监听是否显示,初始数据 */
watch(
() => props.open,
val => {
if (val) {
// 获取网元网元列表
neCascaderOptions.value = neListStore.getNeCascaderOptions.filter(
(item: any) => {
return ['MME', 'AMF', 'UDM', 'IMS'].includes(item.value); // 过滤不可用的网元
}
);
if (neCascaderOptions.value.length === 0) {
message.warning({
content: t('common.noData'),
duration: 3,
});
return;
}
modalState.openByEdit = true;
}
}
);
// =============== 处理函数
const supportMapper: Record<string, any> = {
AMF: [
{
type: 'array',
name: 'guami',
display: 'GUAMI List',
key: ['plmnId'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
return {
index: index,
plmnId: plmn,
pointer: lastItem.pointer,
regionId: lastItem.regionId,
setId: lastItem.setId,
};
},
},
{
type: 'array',
name: 'tai',
display: 'TAI List',
key: ['plmnId'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
return {
index: index,
plmnId: plmn,
tac: param.tac,
};
},
},
{
type: 'array',
name: 'slice',
display: 'Slice List',
key: ['plmnId'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
const sdStr = param.snssai.sd.padStart(6, '0');
return {
index: index,
plmnId: plmn,
sst: parseInt(param.snssai.sst),
sd: sdStr,
};
},
},
],
IMS: [
{
type: 'array',
name: 'plmn',
display: 'PLMN List',
key: ['mcc', 'mnc'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
const mccDomain = param.plmnId.mcc.padStart(3, '0');
const domain = `ims.mnc${param.plmnId.mnc}.mcc${mccDomain}.3gppnetwork.org`;
return {
index: index,
domain: domain,
mcc: param.plmnId.mcc,
mnc: param.plmnId.mnc,
};
},
},
],
UDM: [
{
type: 'list',
name: 'system',
display: 'System',
key: [
'supportedPlmn1',
'supportedPlmn2',
'supportedPlmn3',
'supportedPlmn4',
],
},
],
MME: [
{
type: 'array',
name: 'gummei',
display: 'Gummei List',
key: ['plmnId'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
return Object.assign(lastItem, {
index: index,
plmnId: plmn,
});
},
},
{
type: 'array',
name: 'tai',
display: 'TAI List',
key: ['plmnId'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
return {
index: index,
plmnId: plmn,
tac: parseInt(param.tac),
};
},
},
{
type: 'array',
name: 'hss',
display: 'HSS List',
key: ['imsiPre'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
return Object.assign(lastItem, {
index: index,
imsiPre: plmn,
});
},
},
{
type: 'array',
name: 'sgw',
display: 'SGW List',
key: ['plmnId'],
item: (index: any, param: any, lastItem: any) => {
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
return Object.assign(lastItem, {
index: index,
plmnId: plmn,
tac: parseInt(param.tac),
});
},
},
],
};
async function toConfig(
ntType: string,
neId: string,
param: Record<string, any>
) {
let errMsgArr = [];
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
for (const rule of supportMapper[ntType]) {
const res = await getNeConfigData({
neType: ntType,
neId: neId,
paramName: rule.name,
});
if (res.code != RESULT_CODE_SUCCESS) {
// console.log('获取数据失败', rule);
errMsgArr.push(`${ntType}_${neId} ${rule.display} get data failed`);
continue;
}
if (res.data.length === 0) {
// console.log('数据为空', rule);
errMsgArr.push(`${ntType}_${neId} ${rule.display} data empty`);
continue;
}
if (rule.type === 'list') {
// key
const data = res.data[0];
let vArr = [];
for (const k of rule.key) {
vArr.push(data[k]);
}
if (vArr.includes(plmn)) {
// console.log('存在跳过', rule.name, vArr, plmn);
errMsgArr.push(`${ntType}_${neId} ${rule.display} already exists`);
continue;
}
if (vArr.includes('')) {
const index = vArr.findIndex(s => s == '');
// console.log('空白新增', rule.name, rule.key[index], plmn);
const resList = await editNeConfigData({
neType: ntType,
neId: neId,
paramName: rule.name,
paramData: {
[rule.key[index]]: plmn,
},
});
const state =
resList.code != RESULT_CODE_SUCCESS ? 'failed' : 'success';
errMsgArr.push(
`${ntType}_${neId} ${rule.display} blank items added ${state}`
);
} else {
// console.log(
// '不存在替换最后的',
// rule.name,
// rule.key[rule.key.length - 1],
// plmn
// );
const resList = await editNeConfigData({
neType: ntType,
neId: neId,
paramName: rule.name,
paramData: {
[rule.key[rule.key.length - 1]]: plmn,
},
});
const state =
resList.code != RESULT_CODE_SUCCESS ? 'failed' : 'success';
errMsgArr.push(
`${ntType}_${neId} ${rule.display} replace the final ${state}`
);
}
}
if (rule.type === 'array') {
// item
let vArr = [];
for (const item of res.data) {
vArr.push(item[rule.key]);
}
if (vArr.includes(plmn)) {
const item = res.data.find((s: any) => s[rule.key] == plmn);
if (!item) {
// console.log('没有找到', rule.name, index);
errMsgArr.push(`${ntType}_${neId} ${rule.display} not found`);
continue;
}
const index = item.index;
const updateItem = rule.item(index, param, item);
// console.log('存在修改', rule.name, index, updateItem);
const resList = await editNeConfigData({
neType: ntType,
neId: neId,
paramName: rule.name,
paramData: updateItem,
loc: `${index}`,
});
const state =
resList.code != RESULT_CODE_SUCCESS ? 'failed' : 'success';
errMsgArr.push(`${ntType}_${neId} ${rule.display} modify ${state}`);
} else {
let lastIndex = 0;
const arr = res.data.sort((a: any, b: any) => b.index - a.index);
if (arr.length != 0) {
lastIndex = arr[0].index + 1;
}
const addItem = rule.item(lastIndex, param, arr[0]);
// console.log('不存在新增', rule.name, lastIndex, addItem);
const resList = await addNeConfigData({
neType: ntType,
neId: neId,
paramName: rule.name,
paramData: addItem,
loc: `${lastIndex}`,
});
const state =
resList.code != RESULT_CODE_SUCCESS ? 'failed' : 'success';
errMsgArr.push(`${ntType}_${neId} ${rule.display} added ${state}`);
}
}
}
return errMsgArr;
}
</script>
<template>
<ProModal
:drag="true"
:width="800"
:destroyOnClose="true"
:keyboard="false"
:mask-closable="false"
:open="modalState.openByEdit"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
@ok="fnModalOk"
@cancel="fnModalCancel"
>
<a-form
name="modalStateFromByEdit"
layout="horizontal"
:label-col="{ span: 6 }"
:label-wrap="true"
>
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="DNN_DATA" name="basic.dnn_data" v-if="false">
<a-input
v-model:value="modalState.from.dnn_data"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="50"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title> DNN </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
<a-form-item
label="MCC"
name="basic.plmnId.mcc"
v-bind="modalStateFrom.validateInfos.mcc"
>
<a-input
v-model:value="modalState.from.plmnId.mcc"
placeholder="1-65535"
></a-input>
</a-form-item>
<a-form-item label="SST" name="basic.snssai.sst">
<a-input-number
v-model:value="modalState.from.snssai.sst"
:min="1"
:max="3"
placeholder="1-3"
style="width: 100%"
>
</a-input-number>
</a-form-item>
<a-form-item label="TAC" name="basic.tac">
<a-input
v-model:value="modalState.from.tac"
placeholder="1-65535"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="DNN_IMS" name="basic.dnn_ims" v-if="false">
<a-input
v-model:value="modalState.from.dnn_ims"
allow-clear
:placeholder="t('common.inputPlease')"
:maxlength="50"
>
</a-input>
</a-form-item>
<a-form-item
label="MNC"
name="basic.plmnId.mnc"
v-bind="modalStateFrom.validateInfos.mnc"
>
<a-input
v-model:value="modalState.from.plmnId.mnc"
placeholder="1-65535"
></a-input>
</a-form-item>
<a-form-item label="SD" name="basic.snssai.sd">
<a-input
v-model:value="modalState.from.snssai.sd"
placeholder="1-65535"
></a-input>
</a-form-item>
</a-col>
</a-row>
<a-divider orientation="left">To NE</a-divider>
<a-form-item
:label="t('views.ne.common.neType')"
name="neType"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-cascader
v-model:value="modalState.neType"
:options="neCascaderOptions"
@change="fnNeChange"
multiple
:allow-clear="false"
:placeholder="t('views.ne.common.neTypePlease')"
/>
<a-textarea
:disabled="true"
:hidden="!modalState.msg"
:value="modalState.msg"
:auto-size="{ minRows: 2, maxRows: 8 }"
style="margin-top: 8px"
/>
</a-form-item>
</a-form>
</ProModal>
</template>
<style lang="less" scoped></style>

View File

@@ -7,6 +7,7 @@ import { message } from 'ant-design-vue/es';
import { DataNode } from 'ant-design-vue/es/tree';
import useI18n from '@/hooks/useI18n';
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
import QuickSetup from './components/QuickSetup.vue';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeListStore from '@/store/modules/ne_list';
import useOptions from './hooks/useOptions';
@@ -391,6 +392,12 @@ const { batchState, modalBatchOpen, modalBatchClose, modalBatchOk } =
fnActiveConfigNode,
});
/**快速修改编辑框 */
const quickOpen = ref(false);
function fnQuickOpen() {
quickOpen.value = !quickOpen.value;
}
onMounted(() => {
// 获取网元网元列表
neCascaderOptions.value = neListStore.getNeCascaderOptions.filter(
@@ -430,6 +437,13 @@ onMounted(() => {
<template>
<PageContainer>
<template #content> </template>
<template #contentExtra>
<a-button type="primary" @click="fnQuickOpen">
Quickly Modify PLMN
</a-button>
</template>
<a-row :gutter="16">
<a-col
:lg="6"
@@ -1053,6 +1067,9 @@ onMounted(() => {
</a-row>
</a-form>
</ProModal>
<!-- 快速修改 -->
<QuickSetup v-model:open="quickOpen"></QuickSetup>
</PageContainer>
</template>

View File

@@ -462,7 +462,7 @@ function fnSyncFileToFTP(row: Record<string, any>) {
<template #title>
{{ t('views.ne.neConfigBackup.backupModal.title') }}
</template>
<a-button type="text" @click.prevent="fnFTPModalOpen()">
<a-button type="text" @click.prevent="fnFTPModalOpen()" v-perms:has="['ne:neConfigBackup:ftp']">
<template #icon><DeliveredProcedureOutlined /></template>
</a-button>
</a-tooltip>
@@ -524,13 +524,13 @@ function fnSyncFileToFTP(row: Record<string, any>) {
<template #title>
{{ t('views.ne.neConfigBackup.backupModal.pushFileOper') }}
</template>
<a-button type="link" @click.prevent="fnSyncFileToFTP(record)">
<a-button type="link" @click.prevent="fnSyncFileToFTP(record)" v-perms:has="['ne:neConfigBackup:ftpSync']">
<template #icon><CloudServerOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.downloadText') }}</template>
<a-button type="link" @click.prevent="fnDownloadFile(record)">
<a-button type="link" @click.prevent="fnDownloadFile(record)" v-perms:has="['ne:neConfigBackup:download']">
<template #icon><DownloadOutlined /></template>
</a-button>
</a-tooltip>

View File

@@ -0,0 +1,423 @@
<script setup lang="ts">
import { reactive, toRaw, watch, ref } from 'vue';
import { ProModal } from 'antdv-pro-modal';
import { message, Form, Progress } from 'ant-design-vue/es';
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { getOAMFile, saveOAMFile, serviceNeAction } from '@/api/ne/neInfo';
import useNeListStore from '@/store/modules/ne_list';
const { t } = useI18n();
const neListStore = useNeListStore();
const emit = defineEmits(['ok', 'cancel', 'update:open']);
const props = defineProps({
open: {
type: Boolean,
default: false,
},
});
/**对话框对象信息状态类型 */
type ModalStateType = {
/**是否显示 */
openByEdit: boolean;
/**标题 */
title: string;
/**表单数据 */
from: {
selectedNeList: string[];
omcIP: string;
oamPort: number;
restart: boolean;
};
/**确定按钮 loading */
confirmLoading: boolean;
/**进度显示 */
progress: {
visible: boolean;
current: number;
total: number;
currentNe: string;
};
/**操作结果 */
results: Array<{
neType: string;
neId: string;
neName: string;
success: boolean;
message: string;
}>;
};
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
openByEdit: false,
title: '快速OAM配置',
from: {
selectedNeList: [],
omcIP: '127.0.0.1',
oamPort: 33030,
restart: false,
},
confirmLoading: false,
progress: {
visible: false,
current: 0,
total: 0,
currentNe: '',
},
results: [],
});
/**对话框内表单属性和校验规则 */
const modalStateFrom = Form.useForm(
modalState.from,
reactive({
selectedNeList: [
{
required: true,
message: t('views.ne.neInfo.quickOam.selectNe'),
},
],
omcIP: [
{
required: true,
},
{
pattern: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
oamPort: [
{
required: true,
},
],
})
);
/**获取网元列表选项 */
const neOptions = ref<Array<{ label: string; value: string; neType: string; neId: string; neName: string }>>([]);
/**
* 初始化网元选项
*/
async function initNeOptions() {
// 确保网元列表已加载
await neListStore.fnNelistRefresh();
// 从store获取网元列表过滤掉OMC类型
const neList = neListStore.getNeList.filter((ne: any) => ne.neType !== 'OMC');
neOptions.value = neList.map((ne: any) => ({
label: `${ne.neType}-${ne.neId} (${ne.neName})`,
value: `${ne.neType}@${ne.neId}`,
neType: ne.neType,
neId: ne.neId,
neName: ne.neName,
}));
}
/**
* 单个网元OAM配置复用OAMModal的逻辑
* @param neType 网元类型
* @param neId 网元ID
* @param omcIP OMC IP地址
* @param oamPort OAM端口
* @param restart 是否重启网元
* @returns Promise<{success: boolean, message: string}>
*/
async function configureSingleNeOAM(neType: string, neId: string, omcIP: string, oamPort: number, restart: boolean = false) {
try {
// 1. 获取当前OAM配置复用OAMModal的获取逻辑
const getRes = await getOAMFile(neType, neId);
if (getRes.code !== RESULT_CODE_SUCCESS) {
return {
success: false,
message: `${getRes.msg}`,
};
}
// 2. 构建保存数据复用OAMModal的数据结构转换逻辑
const data = getRes.data;
const ipType = data?.oamConfig?.ipType || 'ipv4';
const saveContent = {
omcIP: omcIP,
oamEnable: data?.oamConfig?.enable || false,
oamPort: oamPort,
snmpEnable: data?.snmpConfig?.enable || false,
snmpPort: data?.snmpConfig?.port || 4957,
kpiEnable: data?.kpiConfig?.enable || false,
kpiTimer: data?.kpiConfig?.timer || 60,
};
// 3. 保存配置复用OAMModal的保存逻辑
const saveRes = await saveOAMFile({
neType,
neId,
content: saveContent,
sync: true,
});
if (saveRes.code === RESULT_CODE_SUCCESS) {
// 如果需要重启网元调用重启服务复用OAMModal的重启逻辑
if (restart) {
try {
await serviceNeAction({
neType,
neId,
action: 'restart',
});
} catch (restartError: any) {
return {
success: true,
message: `${restartError.message || restartError}`,
};
}
}
return {
success: true,
message: restart ? `${t('views.ne.neInfo.quickOam.success')}` : `${t('views.ne.neInfo.quickOam.success')}`,
};
} else {
return {
success: false,
message: `${saveRes.msg}`,
};
}
} catch (error: any) {
return {
success: false,
message: `${error.message || error}`,
};
}
}
/**
* 对话框弹出确认执行函数
* 进行表达规则校验
*/
async function fnModalOk() {
try {
await modalStateFrom.validate();
modalState.confirmLoading = true;
modalState.progress.visible = true;
modalState.progress.current = 0;
modalState.progress.total = modalState.from.selectedNeList.length;
modalState.results = [];
const { omcIP, oamPort, restart } = modalState.from;
// 循环处理每个选中的网元
for (let i = 0; i < modalState.from.selectedNeList.length; i++) {
const neInfo = modalState.from.selectedNeList[i];
const [neType, neId] = neInfo.split('@');
const neName = neOptions.value.find(opt => opt.value === neInfo)?.neName || neId;
modalState.progress.current = i + 1;
modalState.progress.currentNe = `${neType}-${neId}`;
// 调用单个网元配置函数
const result = await configureSingleNeOAM(neType, neId, omcIP, oamPort, restart);
modalState.results.push({
neType,
neId,
neName,
success: result.success,
message: result.message,
});
}
// 显示操作结果
const successCount = modalState.results.filter(r => r.success).length;
const failCount = modalState.results.length - successCount;
if (failCount === 0) {
message.success(`${t('views.ne.neInfo.quickOam.success')} ${successCount} `, 5);
} else {
message.warning(`${t('views.ne.neInfo.quickOam.success')} ${successCount} ${t('views.ne.neInfo.quickOam.default')} ${failCount} `, 5);
}
emit('ok');
fnModalCancel();
} catch (error: any) {
message.error(t('common.errorFields', { num: error.errorFields?.length || 0 }), 3);
} finally {
modalState.confirmLoading = false;
modalState.progress.visible = false;
}
}
/**
* 对话框弹出关闭执行函数
*/
function fnModalCancel() {
modalState.openByEdit = false;
modalState.confirmLoading = false;
modalState.progress.visible = false;
modalState.progress.current = 0;
modalState.progress.total = 0;
modalState.progress.currentNe = '';
modalState.results = [];
modalStateFrom.resetFields();
emit('cancel');
emit('update:open', false);
}
/**监听是否显示,初始数据 */
watch(
() => props.open,
val => {
if (val) {
initNeOptions();
modalState.title = t('views.ne.neInfo.quickOam.title');
modalState.openByEdit = true;
}
}
);
</script>
<template>
<ProModal
:drag="true"
:destroyOnClose="true"
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
:keyboard="false"
:mask-closable="false"
:open="modalState.openByEdit"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
:width='500'
@ok="fnModalOk"
@cancel="fnModalCancel"
>
<a-form
name="modalStateFrom"
layout="horizontal"
:label-col="{ span: 8 }"
:labelWrap="true"
>
<a-form-item
:label="t('views.ne.neInfo.oam.restart')"
name="restart"
>
<a-switch
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
v-model:checked="modalState.from.restart"
/>
</a-form-item>
<a-form-item
:label="t('views.ne.neInfo.quickOam.omcIP')"
name="omcIP"
v-bind="modalStateFrom.validateInfos.omcIP"
>
<a-input
v-model:value="modalState.from.omcIP"
:maxlength="128"
/>
</a-form-item>
<a-form-item
:label="t('views.ne.neInfo.quickOam.oamPort')"
name="oamPort"
v-bind="modalStateFrom.validateInfos.oamPort"
>
<a-input-number
v-model:value="modalState.from.oamPort"
:min="3000"
:max="65535"
:step="1"
style="width: 100%"
/>
</a-form-item>
<a-form-item
:label="t('views.ne.neInfo.quickOam.selectNe')"
name="selectedNeList"
v-bind="modalStateFrom.validateInfos.selectedNeList"
>
<a-select
v-model:value="modalState.from.selectedNeList"
mode="multiple"
:options="neOptions"
:placeholder="t('common.selectPlease')"
:max-tag-count="3"
style="width: 100%"
/>
</a-form-item>
</a-form>
<!-- 进度显示 -->
<div v-if="modalState.progress.visible || modalState.results.length > 0" style="margin-top: 20px;">
<a-divider>{{ t('views.ne.neInfo.quickOam.progress') }}</a-divider>
<div style="margin-bottom: 10px;">
<span>{{ t('views.ne.neInfo.quickOam.processing') }}: {{ modalState.progress.currentNe }}</span>
<span style="float: right;">
{{ modalState.progress.current }} / {{ modalState.progress.total }}
</span>
</div>
<!-- <Progress-->
<!-- :percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"-->
<!-- :status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"-->
<!-- :show-info="false"-->
<!-- style="overflow: hidden;"-->
<!-- />-->
<div style="width: 100%; overflow: hidden;">
<Progress
:percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"
:status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"
:show-info="false"
style="width: 100%;"
/>
</div>
</div>
<!-- 操作结果 -->
<div v-if="modalState.results.length > 0" style="margin-top: 20px;">
<a-divider>{{ t('views.ne.neInfo.quickOam.result') }}</a-divider>
<div style="max-height: 200px; overflow-y: auto;">
<div
v-for="(result, index) in modalState.results"
:key="index"
style="margin-bottom: 8px; padding: 8px; border-radius: 4px;"
:style="{
backgroundColor: result.success ? '#f6ffed' : '#fff2f0',
border: `1px solid ${result.success ? '#b7eb8f' : '#ffccc7'}`,
}"
>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>
<CheckCircleOutlined
v-if="result.success"
:style="{ color: '#52c41a', marginRight: '8px' }"
/>
<CloseCircleOutlined
v-else
:style="{ color: '#ff4d4f', marginRight: '8px' }"
/>
{{ result.neType }}-{{ result.neId }} ({{ result.neName }})
</span>
<span :style="{ color: result.success ? '#52c41a' : '#ff4d4f', fontSize: '12px' }">
{{ result.message }}
</span>
</div>
</div>
</div>
</div>
</ProModal>
</template>
<style lang="less" scoped>
.ant-progress-text {
color: #1890ff;
}
</style>

View File

@@ -1,5 +1,12 @@
<script setup lang="ts">
import { reactive, onMounted, toRaw, defineAsyncComponent, ref } from 'vue';
import {
reactive,
onMounted,
toRaw,
defineAsyncComponent,
ref,
computed,
} from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { message, Modal } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
@@ -11,6 +18,7 @@ import useNeListStore from '@/store/modules/ne_list';
import { listNeInfo, delNeInfo, stateNeInfo } from '@/api/ne/neInfo';
import useDictStore from '@/store/modules/dict';
import useNeOptions from './hooks/useNeOptions';
import { hasPermissions } from '@/plugins/auth-user';
const { getDict } = useDictStore();
const neListStore = useNeListStore();
const { t } = useI18n();
@@ -33,6 +41,10 @@ const OAMModal = defineAsyncComponent(
const BackConfModal = defineAsyncComponent(
() => import('./components/BackConfModal.vue')
);
// 快速OAM配置
const QuickOAMModal = defineAsyncComponent(
() => import('./components/QuickOAMModal.vue')
);
const backConf = ref(); // 引用句柄,取导出函数
/**字典数据 */
@@ -186,6 +198,8 @@ type ModalStateType = {
openByBackConf: boolean;
/**OAM文件配置框是否显示 */
openByOAM: boolean;
/**快速OAM配置框是否显示 */
openByQuickOAM: boolean;
/**新增框或修改框是否显示 */
openByEdit: boolean;
/**新增框或修改框ID */
@@ -201,6 +215,7 @@ type ModalStateType = {
let modalState: ModalStateType = reactive({
openByBackConf: false,
openByOAM: false,
openByQuickOAM: false,
openByEdit: false,
editId: 0,
neId: '',
@@ -275,6 +290,7 @@ function fnModalEditCancel() {
modalState.openByEdit = false;
modalState.openByOAM = false;
modalState.openByBackConf = false;
modalState.openByQuickOAM = false;
}
/**
@@ -360,6 +376,9 @@ function fnRecordMore(type: string | number, row: Record<string, any>) {
modalState.neType = row.neType;
modalState.openByBackConf = !modalState.openByBackConf;
break;
case 'quickOAM':
modalState.openByQuickOAM = !modalState.openByQuickOAM;
break;
default:
console.warn(type);
break;
@@ -463,16 +482,30 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<a-button
type="primary"
@click.prevent="fnModalVisibleByEdit()"
v-perms:has="['ne:neInfo:add']"
>
<template #icon><PlusOutlined /></template>
{{ t('common.addText') }}
</a-button>
<a-button
type="default"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordMore('quickOAM', {})"
v-perms:has="['ne:neInfo:oam']"
>
<template #icon><SettingOutlined /></template>
{{ t('views.ne.neInfo.quickOam.title') }}
</a-button>
<a-button
type="default"
danger
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['ne:neInfo:delete']"
>
<template #icon><DeleteOutlined /></template>
{{ t('common.deleteText') }}
@@ -553,6 +586,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record)"
v-perms:has="['ne:neInfo:edit']"
>
<template #icon><FormOutlined /></template>
</a-button>
@@ -564,6 +598,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordMore('restart', record)"
v-perms:has="['ne:neInfo:restart']"
>
<template #icon><UndoOutlined /></template>
</a-button>
@@ -580,31 +615,53 @@ onMounted(() => {
<FileTextOutlined />
{{ t('views.ne.common.log') }}
</a-menu-item>
<a-menu-item key="start">
<a-menu-item
key="start"
v-if="hasPermissions(['ne:neInfo:start'])"
>
<ThunderboltOutlined />
{{ t('views.ne.common.start') }}
</a-menu-item>
<a-menu-item key="stop">
<a-menu-item
key="stop"
v-if="hasPermissions(['ne:neInfo:stop'])"
>
<CloseSquareOutlined />
{{ t('views.ne.common.stop') }}
</a-menu-item>
<a-menu-item key="delete">
<a-menu-item key="reload" v-if="false">
<SyncOutlined />
{{ t('views.ne.common.reload') }}
</a-menu-item>
<a-menu-item
key="delete"
v-if="hasPermissions(['ne:neInfo:delete'])"
>
<DeleteOutlined />
{{ t('common.deleteText') }}
</a-menu-item>
<a-menu-item
key="oam"
v-if="!['OMC'].includes(record.neType)"
v-if="
!['OMC'].includes(record.neType) ||
hasPermissions(['ne:neInfo:oam'])
"
>
<FileTextOutlined />
{{ t('views.ne.common.oam') }}
</a-menu-item>
<!-- 配置备份 -->
<a-menu-item key="backConfExport">
<a-menu-item
key="backConfExport"
v-if="hasPermissions(['ne:neInfo:export'])"
>
<ExportOutlined />
{{ t('views.ne.neInfo.backConf.export') }}
</a-menu-item>
<a-menu-item key="backConfImport">
<a-menu-item
key="backConfImport"
v-if="hasPermissions(['ne:neInfo:import'])"
>
<ImportOutlined />
{{ t('views.ne.neInfo.backConf.import') }}
</a-menu-item>
@@ -728,6 +785,12 @@ onMounted(() => {
:ne-type="modalState.neType"
@cancel="fnModalEditCancel"
></BackConfModal>
<!-- 快速OAM配置框 -->
<QuickOAMModal
v-model:open="modalState.openByQuickOAM"
@cancel="fnModalEditCancel"
></QuickOAMModal>
</PageContainer>
</template>

View File

@@ -0,0 +1,449 @@
<script setup lang="ts">
import { reactive, toRaw, watch, ref } from 'vue';
import { ProModal } from 'antdv-pro-modal';
import { message, Form, Progress, Upload } from 'ant-design-vue/es';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { FileType } from 'ant-design-vue/es/upload/interface';
import { UploadOutlined, CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { changeNeLicense, getNeLicenseByTypeAndID } from '@/api/ne/neLicense';
import { uploadFile } from '@/api/tool/file';
import useNeListStore from '@/store/modules/ne_list';
const { t } = useI18n();
const neListStore = useNeListStore();
const emit = defineEmits(['ok', 'cancel', 'update:open']);
const props = defineProps({
open: {
type: Boolean,
default: false,
},
});
/**对话框对象信息状态类型 */
type ModalStateType = {
/**是否显示 */
openByEdit: boolean;
/**标题 */
title: string;
/**表单数据 */
from: {
selectedNeList: string[];
licensePath: string;
remark: string;
};
/**确定按钮 loading */
confirmLoading: boolean;
/**上传文件 */
uploadFiles: any[];
/**进度显示 */
progress: {
visible: boolean;
current: number;
total: number;
currentNe: string;
};
/**操作结果 */
results: Array<{
neType: string;
neId: string;
neName: string;
success: boolean;
message: string;
}>;
};
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
openByEdit: false,
title: t('views.ne.neLicense.quickUpload.title'),
from: {
selectedNeList: [],
licensePath: '',
remark: '',
},
confirmLoading: false,
uploadFiles: [],
progress: {
visible: false,
current: 0,
total: 0,
currentNe: '',
},
results: [],
});
/**对话框内表单属性和校验规则 */
const modalStateFrom = Form.useForm(
modalState.from,
reactive({
selectedNeList: [
{
required: true,
},
],
licensePath: [
{
required: true,
},
],
})
);
/**获取网元列表选项 */
const neOptions = ref<Array<{ label: string; value: string; neType: string; neId: string; neName: string }>>([]);
/**
* 初始化网元选项
*/
async function initNeOptions() {
// 确保网元列表已加载
await neListStore.fnNelistRefresh();
// 从store获取网元列表过滤掉OMC类型
const neList = neListStore.getNeList.filter((ne: any) => ne.neType !== 'OMC');
neOptions.value = neList.map((ne: any) => ({
label: `${ne.neType}-${ne.neId} (${ne.neName})`,
value: `${ne.neType}@${ne.neId}`,
neType: ne.neType,
neId: ne.neId,
neName: ne.neName,
}));
}
/**
* 单个网元许可证上传复用EditModal的逻辑
* @param neType 网元类型
* @param neId 网元ID
* @param licensePath 许可证文件路径
* @param remark 备注
* @returns Promise<{success: boolean, message: string}>
*/
async function uploadSingleNeLicense(neType: string, neId: string, licensePath: string, remark: string = '') {
try {
// 1. 获取网元许可证信息复用EditModal的获取逻辑
const getRes = await getNeLicenseByTypeAndID(neType, neId);
if (getRes.code !== RESULT_CODE_SUCCESS) {
return {
success: false,
message: ` ${getRes.msg}`,
};
}
// 2. 构建上传数据复用EditModal的数据结构
const uploadData = {
id: getRes.data.id,
neType: neType,
neId: neId,
licensePath: licensePath,
remark: remark,
reload: false, // 网元授权不允许操作重启
};
// 3. 上传许可证复用EditModal的上传逻辑
const uploadRes = await changeNeLicense(uploadData);
if (uploadRes.code === RESULT_CODE_SUCCESS) {
return {
success: true,
message: t('views.ne.neInfo.quickOam.success'),
};
} else {
return {
success: false,
message: ` ${uploadRes.msg}`,
};
}
} catch (error: any) {
return {
success: false,
message: ` ${error.message || error}`,
};
}
}
/**
* 对话框弹出确认执行函数
* 进行表达规则校验
*/
async function fnModalOk() {
try {
await modalStateFrom.validate();
modalState.confirmLoading = true;
modalState.progress.visible = true;
modalState.progress.current = 0;
modalState.progress.total = modalState.from.selectedNeList.length;
modalState.results = [];
const { licensePath, remark } = modalState.from;
// 循环处理每个选中的网元
for (let i = 0; i < modalState.from.selectedNeList.length; i++) {
const neInfo = modalState.from.selectedNeList[i];
const [neType, neId] = neInfo.split('@');
const neName = neOptions.value.find(opt => opt.value === neInfo)?.neName || neId;
modalState.progress.current = i + 1;
modalState.progress.currentNe = `${neType}-${neId}`;
// 调用单个网元许可证上传函数
const result = await uploadSingleNeLicense(neType, neId, licensePath, remark);
modalState.results.push({
neType,
neId,
neName,
success: result.success,
message: result.message,
});
}
// 显示操作结果
const successCount = modalState.results.filter(r => r.success).length;
const failCount = modalState.results.length - successCount;
if (failCount === 0) {
message.success(`${t('views.ne.neInfo.quickOam.success')} ${successCount} `, 5);
} else {
message.warning(`${t('views.ne.neInfo.quickOam.success')} ${successCount} ${t('views.ne.neInfo.quickOam.default')} ${failCount} `, 5);
}
const firstSuccessNe = modalState.results.find(r => r.success);
const paramForMain = firstSuccessNe ? {
neType: firstSuccessNe.neType,
neId: firstSuccessNe.neId
} : {
neType: 'BATCH', // 批量操作
neId: 'OPERATION'
};
emit('ok', paramForMain);
fnModalCancel();
} catch (error: any) {
message.error(t('common.errorFields', { num: error.errorFields?.length || 0 }), 3);
} finally {
modalState.confirmLoading = false;
modalState.progress.visible = false;
}
}
/**
* 对话框弹出关闭执行函数
*/
function fnModalCancel() {
modalState.openByEdit = false;
modalState.confirmLoading = false;
modalState.progress.visible = false;
modalState.progress.current = 0;
modalState.progress.total = 0;
modalState.progress.currentNe = '';
modalState.results = [];
modalStateFrom.resetFields();
modalState.uploadFiles = [];
modalState.from.licensePath = '';
emit('cancel');
emit('update:open', false);
}
/**表单上传前删除 */
function fnBeforeRemoveFile(file: any) {
modalState.from.licensePath = '';
return true;
}
/**表单上传前检查或转换压缩 */
function fnBeforeUploadFile(file: FileType) {
if (modalState.confirmLoading) return false;
if (!file.name.endsWith('.ini')) {
const msg = `${t('components.UploadModal.onlyAllow')} .ini`;
message.error(msg, 3);
return Upload.LIST_IGNORE;
}
const isLt3M = file.size / 1024 / 1024 < 3;
if (!isLt3M) {
const msg = `${t('components.UploadModal.allowFilter')} 3MB`;
message.error(msg, 3);
return Upload.LIST_IGNORE;
}
return true;
}
/**表单上传文件 */
function fnUploadFile(up: UploadRequestOption) {
// 发送请求
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
let formData = new FormData();
formData.append('file', up.file);
formData.append('subPath', 'license');
uploadFile(formData)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
// 改为完成状态
const file = modalState.uploadFiles[0];
file.percent = 100;
file.status = 'done';
// 预置到表单
modalState.from.licensePath = res.data.filePath;
} else {
message.error(res.msg, 3);
}
})
.finally(() => {
hide();
modalState.confirmLoading = false;
});
}
/**监听是否显示,初始数据 */
watch(
() => props.open,
val => {
if (val) {
initNeOptions();
modalState.title = t('views.ne.neLicense.quickUpload.title');
modalState.openByEdit = true;
}
}
);
</script>
<template>
<ProModal
:drag="true"
:destroyOnClose="true"
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
:keyboard="false"
:mask-closable="false"
:open="modalState.openByEdit"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
:width="500"
@ok="fnModalOk"
@cancel="fnModalCancel"
>
<a-form
name="modalStateFrom"
layout="horizontal"
:label-col="{ span: 8 }"
:labelWrap="true"
>
<a-form-item
:label="t('views.ne.neLicense.licensePath')"
name="file"
v-bind="modalStateFrom.validateInfos.licensePath"
>
<a-upload
name="file"
v-model:file-list="modalState.uploadFiles"
accept=".ini"
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.neLicense.upload') }}
</a-button>
</a-upload>
</a-form-item>
<a-form-item :label="t('common.remark')" name="remark">
<a-textarea
v-model:value="modalState.from.remark"
:maxlength="200"
:show-count="true"
:placeholder="t('common.inputPlease')"
/>
</a-form-item>
<a-form-item
:label="t('views.ne.neLicense.quickUpload.selectNe')"
name="selectedNeList"
v-bind="modalStateFrom.validateInfos.selectedNeList"
>
<a-select
v-model:value="modalState.from.selectedNeList"
mode="multiple"
:options="neOptions"
:placeholder="t('common.selectPlease')"
:max-tag-count="3"
style="width: 100%"
/>
</a-form-item>
</a-form>
<!-- 进度显示 -->
<div v-if="modalState.progress.visible || modalState.results.length > 0" style="margin-top: 20px; overflow: hidden;">
<a-divider>{{ t('views.ne.neInfo.quickOam.progress') }}</a-divider>
<div style="margin-bottom: 10px;">
<span>{{ t('views.ne.neInfo.quickOam.processing') }}: {{ modalState.progress.currentNe }}</span>
<span style="float: right;">
{{ modalState.progress.current }} / {{ modalState.progress.total }}
</span>
</div>
<div style="width: 100%; overflow: hidden;">
<Progress
:percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"
:status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"
:show-info="false"
style="width: 100%;"
/>
</div>
</div>
<!-- 操作结果 -->
<div v-if="modalState.results.length > 0" style="margin-top: 20px;">
<a-divider>{{ t('views.ne.neInfo.quickOam.result') }}</a-divider>
<div style="max-height: 200px; overflow-y: auto;">
<div
v-for="(result, index) in modalState.results"
:key="index"
style="margin-bottom: 8px; padding: 8px; border-radius: 4px;"
:style="{
backgroundColor: result.success ? '#f6ffed' : '#fff2f0',
border: `1px solid ${result.success ? '#b7eb8f' : '#ffccc7'}`,
}"
>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>
<CheckCircleOutlined
v-if="result.success"
:style="{ color: '#52c41a', marginRight: '8px' }"
/>
<CloseCircleOutlined
v-else
:style="{ color: '#ff4d4f', marginRight: '8px' }"
/>
{{ result.neType }}-{{ result.neId }} ({{ result.neName }})
</span>
<span :style="{ color: result.success ? '#52c41a' : '#ff4d4f', fontSize: '12px' }">
{{ result.message }}
</span>
</div>
</div>
</div>
</div>
</ProModal>
</template>
<style lang="less" scoped>
.ant-progress-text {
color: #1890ff;
}
</style>

View File

@@ -16,6 +16,10 @@ const neListStore = useNeListStore();
const EditModal = defineAsyncComponent(
() => import('./components/EditModal.vue')
);
// 快速许可证上传
const QuickLicenseModal = defineAsyncComponent(
() => import('./components/QuickLicenseModal.vue')
);
/**字典数据-状态 */
let dictStatus = ref<DictType[]>([]);
@@ -228,6 +232,8 @@ function fnGetList(pageNum?: number) {
type ModalStateType = {
/**新增框或修改框是否显示 */
openByEdit: boolean;
/**快速许可证上传框是否显示 */
openByQuickUpload: boolean;
/**授权记录ID */
licenseId: number;
/**确定按钮 loading */
@@ -237,6 +243,7 @@ type ModalStateType = {
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
openByEdit: false,
openByQuickUpload: false,
licenseId: 0,
confirmLoading: false,
});
@@ -270,6 +277,7 @@ function fnModalOk(e: any) {
*/
function fnModalCancel() {
modalState.openByEdit = false;
modalState.openByQuickUpload = false;
modalState.licenseId = 0;
}
@@ -410,10 +418,20 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button
type="primary"
:loading="modalState.confirmLoading"
@click.prevent="modalState.openByQuickUpload = true"
v-perms:has="['ne:neLicense:upload']"
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neLicense.quickUpload.title') }}
</a-button>
<a-button
type="default"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordStateReload()"
v-perms:has="['ne:neLicense:reload']"
>
<template #icon><SyncOutlined /></template>
{{ t('views.ne.neLicense.reloadBatch') }}
@@ -488,7 +506,7 @@ onMounted(() => {
<a-space :size="8" align="center">
<a-tooltip placement="topRight">
<template #title>{{ t('views.ne.neLicense.reload') }}</template>
<a-button type="link" @click.prevent="fnRecordState(record)">
<a-button type="link" @click.prevent="fnRecordState(record)" v-perms:has="['ne:neLicense:sync']">
<template #icon><SyncOutlined /> </template>
</a-button>
</a-tooltip>
@@ -497,6 +515,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.id)"
v-perms:has="['ne:neLicense:edit']"
>
<template #icon><UploadOutlined /> </template>
</a-button>
@@ -514,6 +533,13 @@ onMounted(() => {
@ok="fnModalOk"
@cancel="fnModalCancel"
></EditModal>
<!-- 快速许可证上传框 -->
<QuickLicenseModal
v-model:open="modalState.openByQuickUpload"
@ok="fnModalOk"
@cancel="fnModalCancel"
></QuickLicenseModal>
</PageContainer>
</template>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, onMounted, toRaw, defineAsyncComponent } from 'vue';
import { reactive, ref, onMounted, toRaw, defineAsyncComponent,computed } 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';
@@ -11,6 +11,7 @@ import { listNeSoftware, delNeSoftware } from '@/api/ne/neSoftware';
import { parseDateToStr } from '@/utils/date-utils';
import { downloadFile } from '@/api/tool/file';
import { saveAs } from 'file-saver';
import { hasPermissions } from '@/plugins/auth-user';
const neListStore = useNeListStore();
const { t } = useI18n();
@@ -21,7 +22,10 @@ const EditModal = defineAsyncComponent(
const UploadMoreFile = defineAsyncComponent(
() => import('./components/UploadMoreFile.vue')
);
const hasAnyBatchPermission = computed(() => {
return hasPermissions(['ne:neSoftware:download']) ||
hasPermissions(['ne:neSoftware:delete']) ;
});
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
@@ -400,7 +404,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit(0)">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit(0)" v-perms:has="['ne:neSoftware:upload']">
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.upload') }}
</a-button>
@@ -410,6 +414,7 @@ onMounted(() => {
@click.prevent="
() => (modalState.openByMoreFile = !modalState.openByMoreFile)
"
v-perms:has="['ne:neSoftware:upload']"
>
<template #icon><UploadOutlined /></template>
<template v-if="tableState.selectedRowOne.neType">
@@ -426,6 +431,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['ne:neSoftware:delete']"
>
<template #icon><DeleteOutlined /></template>
{{ t('common.deleteText') }}
@@ -521,6 +527,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.id)"
v-perms:has="['ne:neSoftware:edit']"
>
<template #icon> <ProfileOutlined /></template>
</a-button>
@@ -528,17 +535,17 @@ onMounted(() => {
<a-tooltip placement="left">
<template #title>{{ t('common.moreText') }}</template>
<a-dropdown placement="bottomRight" trigger="click">
<a-dropdown placement="bottomRight" trigger="click" v-if="hasAnyBatchPermission">
<a-button type="link">
<template #icon><EllipsisOutlined /> </template>
</a-button>
<template #overlay>
<a-menu @click="({ key }:any) => fnRecordMore(key, record)">
<a-menu-item key="download">
<a-menu-item key="download" v-if="hasPermissions(['ne:neSoftware:download'])">
<DownloadOutlined />
{{ t('common.downloadText') }}
</a-menu-item>
<a-menu-item key="delete">
<a-menu-item key="delete" v-if="hasPermissions(['ne:neSoftware:delete'])">
<DeleteOutlined />
{{ t('common.deleteText') }}
</a-menu-item>

View File

@@ -506,6 +506,7 @@ onMounted(() => {
@click.prevent="
() => (modalState.openByEdit = !modalState.openByEdit)
"
v-perms:has="['ne:neVersion:upload']"
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.upload') }}
@@ -516,6 +517,7 @@ onMounted(() => {
@click.prevent="
() => (modalState.openByMoreFile = !modalState.openByMoreFile)
"
v-perms:has="['ne:neVersion:upload']"
>
<template #icon><UploadOutlined /></template>
<template v-if="tableState.selectedRowOne.neType">
@@ -532,6 +534,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordUpgradeConfirm()"
v-perms:has="['ne:neVersion:upgrade']"
>
<template #icon><ThunderboltOutlined /></template>
{{ t('views.ne.neVersion.upgradeBatch') }}
@@ -645,6 +648,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordVersion('upgrade', record)"
v-perms:has="['ne:neVersion:upgrade']"
>
<template #icon><ThunderboltOutlined /></template>
</a-button>
@@ -656,6 +660,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordVersion('rollback', record)"
v-perms:has="['ne:neVersion:rollback']"
>
<template #icon><RollbackOutlined /></template>
</a-button>

View File

@@ -21,27 +21,27 @@ let sourceState = reactive({
/**文件列表 */
list: [
{
value: '/auth',
value: '/udm/auth',
label: t('views.neData.backupData.auth'),
path: '/usr/local/omc/backup/udm_data',
path: '/usr/local/omc/backup',
neType: 'UDM',
},
{
value: '/sub',
value: '/udm/sub',
label: t('views.neData.backupData.sub'),
path: '/usr/local/omc/backup/udm_data',
path: '/usr/local/omc/backup',
neType: 'UDM',
},
{
value: '/voip',
value: '/udm/voip',
label: t('views.neData.backupData.voip'),
path: '/usr/local/omc/backup/udm_data',
path: '/usr/local/omc/backup',
neType: 'UDM',
},
{
value: '/volte',
value: '/udm/volte',
label: t('views.neData.backupData.volte'),
path: '/usr/local/omc/backup/udm_data',
path: '/usr/local/omc/backup',
neType: 'UDM+IMS',
},
],
@@ -353,7 +353,11 @@ onMounted(() => {
<template #title>
{{ t('views.ne.neConfigBackup.backupModal.title') }}
</template>
<a-button type="text" @click.prevent="fnFTPModalOpen()">
<a-button
type="text"
@click.prevent="fnFTPModalOpen()"
v-perms:has="['ne-data:backup-data:ftp']"
>
<template #icon><DeliveredProcedureOutlined /></template>
</a-button>
</a-tooltip>
@@ -387,6 +391,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnSyncFileToFTP(record.fileName)"
v-perms:has="['ne-data:backup-data:ftpSync']"
>
<template #icon><CloudServerOutlined /></template>
</a-button>
@@ -397,6 +402,7 @@ onMounted(() => {
type="link"
:loading="downLoading"
@click.prevent="fnDownloadFile(record)"
v-perms:has="['ne-data:backup-data:download']"
>
<template #icon><DownloadOutlined /></template>
</a-button>
@@ -407,6 +413,7 @@ onMounted(() => {
type="link"
:loading="delLoading"
@click.prevent="fnRecordDelete(record)"
v-perms:has="['ne-data:backup-data:delete']"
>
<template #icon><DeleteOutlined /></template>
</a-button>

View File

@@ -202,6 +202,8 @@ function fnExportList() {
onOk() {
const hide = message.loading(t('common.loading'), 0);
const querys = toRaw(queryParams);
querys.pageNum = 1;
querys.pageSize = tablePagination.total;
exportNBState(querys)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -505,6 +505,8 @@ function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const hide = message.loading(t('common.loading'), 0);
queryParams.pageNum = 1;
queryParams.pageSize = tablePagination.total;
exportUDMAuth(Object.assign({ type: type }, queryParams))
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -817,7 +819,11 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<a-button
type="primary"
@click.prevent="fnModalVisibleByEdit()"
v-perms:has="['neData:udm-auth:add']"
>
<template #icon>
<PlusOutlined />
</template>
@@ -829,6 +835,7 @@ onMounted(() => {
danger
ghost
@click.prevent="fnModalVisibleByBatch()"
v-perms:has="['neData:udm-auth:delete']"
>
<template #icon>
<DeleteOutlined />
@@ -848,13 +855,18 @@ onMounted(() => {
danger
:disabled="modalState.loadDataLoading"
:loading="modalState.loadDataLoading"
v-perms:has="['neData:udm-auth:reload']"
>
<template #icon><SyncOutlined /></template>
{{ t('views.neUser.auth.loadData') }}
</a-button>
</a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
<a-button
type="dashed"
@click.prevent="fnModalUploadImportOpen"
v-perms:has="['neData:udm-auth:import']"
>
<template #icon><ImportOutlined /></template>
{{ t('views.neUser.auth.import') }}
</a-button>
@@ -865,9 +877,8 @@ onMounted(() => {
ok-text="TXT"
ok-type="default"
@confirm="fnExportList('txt')"
v-if="false"
>
<a-button type="dashed">
<a-button type="dashed" v-perms:has="['neData:udm-auth:export']">
<template #icon><ExportOutlined /></template>
{{ t('views.neUser.auth.export') }}
</a-button>
@@ -879,6 +890,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['neData:udm-auth:delete']"
>
<template #icon><DeleteOutlined /></template>
{{ t('views.neUser.auth.checkDel') }}
@@ -891,11 +903,11 @@ onMounted(() => {
ok-type="default"
@confirm="fnRecordExport('txt')"
:disabled="tableState.selectedRowKeys.length <= 0"
v-if="false"
>
<a-button
type="default"
:disabled="tableState.selectedRowKeys.length <= 0"
v-perms:has="['neData:udm-auth:export']"
>
<template #icon><ExportOutlined /></template>
{{ t('views.neUser.auth.checkExport') }}
@@ -980,6 +992,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record)"
v-perms:has="['neData:udm-auth:edit']"
>
<template #icon>
<FormOutlined />
@@ -991,6 +1004,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordDelete(record.imsi)"
v-perms:has="['neData:udm-auth:delete']"
>
<template #icon>
<DeleteOutlined />

View File

@@ -986,6 +986,8 @@ function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const hide = message.loading(t('common.loading'), 0);
queryParams.pageNum = 1;
queryParams.pageSize = tablePagination.total;
exportUDMSub(Object.assign({ type: type }, queryParams))
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -1329,7 +1331,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neData:udm-sub:add']">
<template #icon>
<PlusOutlined />
</template>
@@ -1341,6 +1343,7 @@ onMounted(() => {
danger
ghost
@click.prevent="fnModalVisibleByBatch()"
v-perms:has="['neData:udm-sub:delete']"
>
<template #icon>
<DeleteOutlined />
@@ -1360,6 +1363,7 @@ onMounted(() => {
danger
:disabled="modalState.loadDataLoading"
:loading="modalState.loadDataLoading"
v-perms:has="['neData:udm-sub:reload']"
>
<template #icon>
<SyncOutlined />
@@ -1368,7 +1372,7 @@ onMounted(() => {
</a-button>
</a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neData:udm-sub:import']">
<template #icon>
<ImportOutlined />
</template>
@@ -1382,7 +1386,7 @@ onMounted(() => {
ok-type="default"
@confirm="fnExportList('txt')"
>
<a-button type="dashed">
<a-button type="dashed" v-perms:has="['neData:udm-sub:export']">
<template #icon>
<ExportOutlined />
</template>
@@ -1396,6 +1400,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['neData:udm-sub:delete']"
>
<template #icon>
<DeleteOutlined />
@@ -1414,6 +1419,7 @@ onMounted(() => {
<a-button
type="default"
:disabled="tableState.selectedRowKeys.length <= 0"
v-perms:has="['neData:udm-sub:export']"
>
<template #icon>
<ExportOutlined />
@@ -1519,6 +1525,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.imsi)"
v-perms:has="['neData:udm-sub:edit']"
>
<template #icon>
<FormOutlined />
@@ -1530,6 +1537,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordDelete(record.imsi)"
v-perms:has="['neData:udm-sub:delete']"
>
<template #icon>
<DeleteOutlined />

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue';
import { reactive, ref, onMounted, toRaw, computed } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal';
import {
@@ -28,6 +28,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { saveAs } from 'file-saver';
import { uploadFile } from '@/api/tool/file';
import { getNeViewFile } from '@/api/tool/neFile';
import { hasPermissions } from '@/plugins/auth-user';
const { t } = useI18n();
const neListStore = useNeListStore();
/**网元参数 */
@@ -49,6 +50,12 @@ let queryParams = reactive({
pageSize: 20,
});
const hasAnyBatchPermission = computed(() => {
return hasPermissions(['neData:udm-voip:add']) ||
hasPermissions(['neData:udm-voip:delete']) ;
});
/**查询参数重置 */
function fnQueryReset() {
queryParams = Object.assign(queryParams, {
@@ -363,6 +370,8 @@ function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const hide = message.loading(t('common.loading'), 0);
queryParams.pageNum = 1;
queryParams.pageSize = tablePagination.total;
exportUDMVOIP(Object.assign({ type: type }, queryParams))
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -659,7 +668,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neData:udm-voip:add']">
<template #icon>
<PlusOutlined />
</template>
@@ -672,23 +681,24 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['neData:udm-voip:delete']"
>
<template #icon><DeleteOutlined /></template>
{{ t('views.neData.common.checkDel') }}
</a-button>
<a-dropdown trigger="click">
<a-dropdown trigger="click" v-if="hasAnyBatchPermission">
<a-button>
{{ t('views.neData.common.batchOper') }}
<DownOutlined />
</a-button>
<template #overlay>
<a-menu @click="({ key }:any) => fnModalVisibleByBatch(key)">
<a-menu-item key="add">
<a-menu-item key="add" v-if="hasPermissions(['neData:udm-voip:add'])">
<PlusOutlined />
{{ t('views.neData.common.batchAddText') }}
</a-menu-item>
<a-menu-item key="delete">
<a-menu-item key="delete" v-if="hasPermissions(['neData:udm-voip:delete'])">
<DeleteOutlined />
{{ t('views.neData.common.batchDelText') }}
</a-menu-item>
@@ -709,13 +719,14 @@ onMounted(() => {
danger
:disabled="modalState.loadDataLoading"
:loading="modalState.loadDataLoading"
v-perms:has="['neData:udm-voip:reload']"
>
<template #icon><SyncOutlined /></template>
{{ t('views.neData.common.loadData') }}
</a-button>
</a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neData:udm-voip:import']">
<template #icon><ImportOutlined /></template>
{{ t('common.import') }}
</a-button>
@@ -726,7 +737,7 @@ onMounted(() => {
ok-type="default"
@confirm="fnExportList('txt')"
>
<a-button type="dashed">
<a-button type="dashed" v-perms:has="['neData:udm-voip:export']">
<template #icon><ExportOutlined /></template>
{{ t('common.export') }}
</a-button>
@@ -816,6 +827,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordDelete(record.username)"
v-perms:has="['neData:udm-voip:delete']"
>
<template #icon>
<DeleteOutlined />

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue';
import { reactive, ref, onMounted, toRaw ,computed} from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal';
import {
@@ -28,8 +28,13 @@ import {
listUDMVolteIMS,
resetUDMVolteIMS,
} from '@/api/neData/udm_volte_ims';
import { hasPermissions } from '@/plugins/auth-user';
const { t } = useI18n();
const neListStore = useNeListStore();
const hasAnyBatchPermission = computed(() => {
return hasPermissions(['neData:udm-volte:add']) ||
hasPermissions(['neData:udm-volte:delete']) ;
});
/**字典数据 */
let dict: {
/**Tag标签类型 0=VoIP, 1=VoLTE */
@@ -442,6 +447,8 @@ function fnExportList(type: string) {
const neId = queryParams.neId;
if (!neId) return;
const hide = message.loading(t('common.loading'), 0);
queryParams.pageNum = 1;
queryParams.pageSize = tablePagination.total;
exportUDMVolteIMS(Object.assign({ type: type }, queryParams))
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -449,7 +456,7 @@ function fnExportList(type: string) {
content: t('common.operateOk'),
duration: 2,
});
saveAs(res.data, `UDM_VOLTE_${neId}_${Date.now()}.${type}`);
saveAs(res.data, `UDM_VoLTE_${neId}_${Date.now()}.${type}`);
} else {
message.error({
content: `${res.msg}`,
@@ -755,7 +762,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neData:udm-volte:add']">
<template #icon>
<PlusOutlined />
</template>
@@ -768,23 +775,24 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['neData:udm-volte:delete']"
>
<template #icon><DeleteOutlined /></template>
{{ t('views.neData.common.checkDel') }}
</a-button>
<a-dropdown trigger="click">
<a-dropdown trigger="click" v-if="hasAnyBatchPermission">
<a-button>
{{ t('views.neData.common.batchOper') }}
<DownOutlined />
</a-button>
<template #overlay>
<a-menu @click="({ key }:any) => fnModalVisibleByBatch(key)">
<a-menu-item key="add">
<a-menu-item key="add" v-if="hasPermissions(['neData:udm-volte:add'])">
<PlusOutlined />
{{ t('views.neData.common.batchAddText') }}
</a-menu-item>
<a-menu-item key="delete">
<a-menu-item key="delete" v-if="hasPermissions(['neData:udm-volte:delete'])">
<DeleteOutlined />
{{ t('views.neData.common.batchDelText') }}
</a-menu-item>
@@ -805,13 +813,14 @@ onMounted(() => {
danger
:disabled="modalState.loadDataLoading"
:loading="modalState.loadDataLoading"
v-perms:has="['neData:udm-volte:reload']"
>
<template #icon><SyncOutlined /></template>
{{ t('views.neData.common.loadData') }}
</a-button>
</a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neData:udm-volte:import']">
<template #icon><ImportOutlined /></template>
{{ t('common.import') }}
</a-button>
@@ -822,7 +831,7 @@ onMounted(() => {
ok-type="default"
@confirm="fnExportList('txt')"
>
<a-button type="dashed">
<a-button type="dashed" v-perms:has="['neData:udm-volte:export']">
<template #icon><ExportOutlined /></template>
{{ t('common.export') }}
</a-button>
@@ -915,6 +924,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordDelete(record.id)"
v-perms:has="['neData:udm-volte:delete']"
>
<template #icon>
<DeleteOutlined />

View File

@@ -0,0 +1,140 @@
<script lang="ts" setup>
import { message, Modal } from 'ant-design-vue/es';
import { reactive } from 'vue';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { FileType } from 'ant-design-vue/es/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { uploadFileChunk } from '@/api/tool/file';
import { exportBackupOMC, importBackupOMC } from '@/api/neData/backup';
import saveAs from 'file-saver';
const { t } = useI18n();
type StateType = {
loading: boolean;
};
let state: StateType = reactive({
loading: false,
});
/**导出 */
function fnExport() {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.system.setting.backupExportTip'),
onOk() {
const hide = message.loading(t('common.loading'), 0);
exportBackupOMC()
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.operateOk'),
duration: 3,
});
saveAs(res.data, `BackupOMC-${Date.now()}.zip`);
} else {
message.error({
content: `${res.msg}`,
duration: 3,
});
}
})
.finally(() => {
hide();
});
},
});
}
/**上传前检查或转换压缩 */
function fnBeforeUpload(file: FileType) {
if (state.loading) return false;
console.log(file);
if (file.type !== 'application/x-zip-compressed') {
message.error(
t('views.system.setting.uploadFormat', { format: 'zip' }),
3
);
}
// const isLt10M = file.size / 1024 / 1024 < 10;
// if (!isLt10M) {
// message.error(t('views.system.setting.uploadSize', { size: 10 }), 3);
// }
return true;
}
/**上传变更 */
function fnUpload(up: UploadRequestOption) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.system.setting.backupImportTip'),
onOk() {
// 发送请求
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
uploadFileChunk(up.file as File, 5, 'import')
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
return importBackupOMC(res.data.filePath);
}
return undefined;
})
.then(res => {
if (!res) {
return;
}
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.operateOk'),
duration: 3,
});
} else {
message.error({
content: `${res.msg}`,
duration: 3,
});
}
})
.finally(() => {
state.loading = false;
hide();
});
},
});
}
</script>
<template>
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-button type="default" @click="fnExport()">
{{ t('common.export') }}
</a-button>
<a-upload
name="file"
list-type="picture"
accept=".zip"
:max-count="1"
:show-upload-list="false"
:before-upload="fnBeforeUpload"
:custom-request="fnUpload"
style="margin-left: 10px"
>
<a-button type="link" :disabled="state.loading">
{{ t('common.import') }}
</a-button>
</a-upload>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-typography>
<a-typography-paragraph>
{{ t('views.system.setting.backupInstruction') }}
</a-typography-paragraph>
</a-typography>
</a-col>
</a-row>
</template>
<style lang="less" scoped></style>

View File

@@ -8,6 +8,7 @@ import ChangeHelpDoc from './components/change-help-doc.vue';
import ChangeOfficialUrl from './components/change-official-url.vue';
import ChangeI18n from './components/change-i18n.vue';
import SystemReset from './components/system-reset.vue';
import SystemBackup from './components/system-backup.vue';
import ChangeHome from './components/change-home-index.vue';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
@@ -50,14 +51,24 @@ const { t } = useI18n();
</a-divider>
<ChangeI18n></ChangeI18n>
</div>
<div v-perms:has="['system:setting:homeSet']">
<a-divider orientation="left">
{{ t('views.system.setting.homeSet') }}
</a-divider>
<ChangeHome></ChangeHome>
</div>
<div v-perms:has="['system:setting:backup']">
<a-divider orientation="left">
{{ t('views.system.setting.backup') }}
</a-divider>
<SystemBackup></SystemBackup>
</div>
<div v-perms:has="['system:setting:reset']">
<a-divider orientation="left">
{{ t('views.system.setting.reset') }}
</a-divider>
<SystemReset></SystemReset>
</div>
</a-card>
</PageContainer>
</template>

View File

@@ -593,7 +593,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button @click="fnFileView()">
<a-button @click="fnFileView()" v-perms:has="['traceManage:pcap:fileview']">
<FileSearchOutlined />
{{ t('views.traceManage.pcap.fileView') }}
</a-button>
@@ -678,6 +678,7 @@ onMounted(() => {
size="small"
:disabled="modalState.from[record.id].loading"
@click.prevent="fnRecordStart(record)"
v-perms:has="['traceManage:pcap:start']"
>
<template #icon><PlayCircleOutlined /> </template>
</a-button>
@@ -697,6 +698,7 @@ onMounted(() => {
danger
size="small"
@click.prevent="fnRecordStop(record)"
v-perms:has="['traceManage:pcap:stop']"
>
<template #icon><StopOutlined /> </template>
</a-button>
@@ -736,6 +738,7 @@ onMounted(() => {
ghost
size="small"
@click.prevent="fnDownPCAP(record)"
v-perms:has="['traceManage:pcap:download']"
>
<template #icon><DownloadOutlined /> </template>
</a-button>

View File

@@ -701,7 +701,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalOpenByEdit()">
<a-button type="primary" @click.prevent="fnModalOpenByEdit()" v-perms:has="['traceManage:task:add']">
<template #icon><PlusOutlined /></template>
{{ t('common.addText') }}
</a-button>
@@ -712,6 +712,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')"
v-perms:has="['traceManage:task:delete']"
>
<template #icon><DeleteOutlined /></template>
{{ t('common.deleteText') }}
@@ -796,6 +797,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordView(record, 'data')"
v-perms:has="['traceManage:task:dataview']"
>
<template #icon><ContainerOutlined /></template>
</a-button>
@@ -809,6 +811,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnRecordView(record, 'analyze')"
v-perms:has="['traceManage:task:pcapview']"
>
<template #icon><BarsOutlined /></template>
</a-button>
@@ -820,6 +823,7 @@ onMounted(() => {
<a-button
type="link"
@click.prevent="fnModalOpenByEdit(record.id)"
v-perms:has="['traceManage:task:edit']"
>
<template #icon><ProfileOutlined /></template>
</a-button>
@@ -830,6 +834,7 @@ onMounted(() => {
type="link"
danger
@click.prevent="fnRecordDelete(record.id)"
v-perms:has="['traceManage:task:delete']"
>
<template #icon><DeleteOutlined /></template>
</a-button>

View File

@@ -582,6 +582,7 @@ onBeforeUnmount(() => {
type="primary"
@click="fnStart"
:disabled="!taskState.stop && taskState.task.taskNo !== ''"
v-perms:has="['traceManage:wireshark:start']"
>
<PlayCircleOutlined />
Start Trace
@@ -610,6 +611,7 @@ onBeforeUnmount(() => {
danger
@click.prevent="fnStop()"
:disabled="taskState.stop || taskState.task.taskNo === ''"
v-perms:has="['traceManage:wireshark:stop']"
>
<template #icon><CloseCircleOutlined /></template>
Stop Trace