ref: v3变更,,同步v2.2508.4
@@ -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>
|
||||
|
||||
@@ -160,7 +160,7 @@ onUnmounted(() => {
|
||||
</div>
|
||||
<div v-if="state.from.sn !== ''" style="font-size: 16px">
|
||||
<p>{{ t('views.ne.common.neType') }}:{{ state.from.neType }}</p>
|
||||
<p>{{ t('views.ne.common.neId') }}:{{ state.from.neId }}</p>
|
||||
<p>{{ t('views.ne.common.neUid') }}:{{ state.from.neId }}</p>
|
||||
<p>{{ t('views.ne.common.serialNum') }}:{{ state.from.sn }}</p>
|
||||
<p>{{ t('views.ne.common.expiryDate') }}:{{ state.from.expire }}</p>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { reactive, toRaw } from 'vue';
|
||||
import { getPara5GFilee, savePara5GFile, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { updateNeInfo } from '@/api/ne/neInfo';
|
||||
import useNeStore from '@/store/modules/ne';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { getPara5GFilee, savePara5GFile } from '@/api/ne/neAction';
|
||||
const neStore = useNeStore();
|
||||
|
||||
/**对象信息信息状态类型 */
|
||||
@@ -38,80 +39,78 @@ export function usePara5G() {
|
||||
/**载入数据*/
|
||||
function fnReloadData() {
|
||||
state.confirmLoading = true;
|
||||
Promise.all([getPara5GFilee(), neStore.fnNelistRefresh()]).then(
|
||||
resArr => {
|
||||
// 已保存的配置
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(state.from, resArr[0].data);
|
||||
}
|
||||
// 填充固定网元类型的ip
|
||||
if (
|
||||
resArr[1].code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(resArr[1].data)
|
||||
) {
|
||||
for (const item of resArr[1].data) {
|
||||
// 公共配置文件sbi的各网元IP
|
||||
switch (item.neType) {
|
||||
case 'OMC':
|
||||
state.from.sbi.omc_ip = item.ip;
|
||||
Object.assign(state.omcInfo, item); // 主动改OMC_IP
|
||||
break;
|
||||
case 'IMS':
|
||||
state.from.sbi.ims_ip = item.ip;
|
||||
state.hasNE.ims = true;
|
||||
break;
|
||||
case 'AMF':
|
||||
state.from.sbi.amf_ip = item.ip;
|
||||
state.hasNE.amf = true;
|
||||
break;
|
||||
case 'AUSF':
|
||||
state.from.sbi.ausf_ip = item.ip;
|
||||
break;
|
||||
case 'UDM':
|
||||
state.from.sbi.udm_ip = item.ip;
|
||||
state.from.sbi.db_ip = '0.0.0.0';
|
||||
break;
|
||||
case 'SMF':
|
||||
state.from.sbi.smf_ip = item.ip;
|
||||
break;
|
||||
case 'PCF':
|
||||
state.from.sbi.pcf_ip = item.ip;
|
||||
break;
|
||||
case 'NSSF':
|
||||
state.from.sbi.nssf_ip = item.ip;
|
||||
break;
|
||||
case 'NRF':
|
||||
state.from.sbi.nrf_ip = item.ip;
|
||||
break;
|
||||
case 'UPF':
|
||||
state.from.sbi.upf_ip = item.ip;
|
||||
state.hasNE.upf = true;
|
||||
break;
|
||||
case 'LMF':
|
||||
state.from.sbi.lmf_ip = item.ip;
|
||||
break;
|
||||
case 'NEF':
|
||||
state.from.sbi.nef_ip = item.ip;
|
||||
break;
|
||||
case 'MME':
|
||||
state.from.sbi.mme_ip = item.ip;
|
||||
if (item.ip.includes('.')) {
|
||||
state.from.external.mmes11_ip = item.ip + '/24';
|
||||
}
|
||||
state.hasNE.mme = true;
|
||||
break;
|
||||
case 'N3IWF':
|
||||
state.from.sbi.n3iwf_ip = item.ip;
|
||||
break;
|
||||
case 'SMSC':
|
||||
state.from.sbi.smsc_ip = item.ip;
|
||||
break;
|
||||
}
|
||||
Promise.all([getPara5GFilee(), neStore.fnNelistRefresh()]).then(resArr => {
|
||||
// 已保存的配置
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(state.from, resArr[0].data);
|
||||
}
|
||||
// 填充固定网元类型的ip
|
||||
if (
|
||||
resArr[1].code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(resArr[1].data)
|
||||
) {
|
||||
for (const item of resArr[1].data) {
|
||||
// 公共配置文件sbi的各网元IP
|
||||
switch (item.neType) {
|
||||
case 'OMC':
|
||||
state.from.sbi.omc_ip = item.ip;
|
||||
Object.assign(state.omcInfo, item); // 主动改OMC_IP
|
||||
break;
|
||||
case 'IMS':
|
||||
state.from.sbi.ims_ip = item.ip;
|
||||
state.hasNE.ims = true;
|
||||
break;
|
||||
case 'AMF':
|
||||
state.from.sbi.amf_ip = item.ip;
|
||||
state.hasNE.amf = true;
|
||||
break;
|
||||
case 'AUSF':
|
||||
state.from.sbi.ausf_ip = item.ip;
|
||||
break;
|
||||
case 'UDM':
|
||||
state.from.sbi.udm_ip = item.ip;
|
||||
state.from.sbi.db_ip = '0.0.0.0';
|
||||
break;
|
||||
case 'SMF':
|
||||
state.from.sbi.smf_ip = item.ip;
|
||||
break;
|
||||
case 'PCF':
|
||||
state.from.sbi.pcf_ip = item.ip;
|
||||
break;
|
||||
case 'NSSF':
|
||||
state.from.sbi.nssf_ip = item.ip;
|
||||
break;
|
||||
case 'NRF':
|
||||
state.from.sbi.nrf_ip = item.ip;
|
||||
break;
|
||||
case 'UPF':
|
||||
state.from.sbi.upf_ip = item.ip;
|
||||
state.hasNE.upf = true;
|
||||
break;
|
||||
case 'LMF':
|
||||
state.from.sbi.lmf_ip = item.ip;
|
||||
break;
|
||||
case 'NEF':
|
||||
state.from.sbi.nef_ip = item.ip;
|
||||
break;
|
||||
case 'MME':
|
||||
state.from.sbi.mme_ip = item.ip;
|
||||
if (item.ip.includes('.')) {
|
||||
state.from.external.mmes11_ip = item.ip + '/24';
|
||||
}
|
||||
state.hasNE.mme = true;
|
||||
break;
|
||||
case 'N3IWF':
|
||||
state.from.sbi.n3iwf_ip = item.ip;
|
||||
break;
|
||||
case 'SMSC':
|
||||
state.from.sbi.smsc_ip = item.ip;
|
||||
break;
|
||||
}
|
||||
}
|
||||
state.confirmLoading = false;
|
||||
}
|
||||
);
|
||||
state.confirmLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**保存数据 */
|
||||
|
||||
@@ -17,6 +17,7 @@ import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useMaskStore from '@/store/modules/mask';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const maskStore = useMaskStore();
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
@@ -35,10 +36,10 @@ let dictStatus = ref<DictType[]>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: undefined,
|
||||
/**网元ID */
|
||||
neId: '',
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
@@ -49,7 +50,6 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
neType: undefined,
|
||||
neId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
@@ -78,7 +78,7 @@ type TabeStateType = {
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
seached: false,
|
||||
seached: true,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
/**勾选单行记录 */
|
||||
@@ -99,15 +99,10 @@ let tableColumns = ref<TableColumnsType>([
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.neVersion.version'),
|
||||
dataIndex: 'version',
|
||||
key: 'version',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
resizable: true,
|
||||
@@ -331,7 +326,8 @@ function fnRecordVersion(
|
||||
}
|
||||
operateNeVersion({
|
||||
neType: row.neType,
|
||||
neId: row.neId,
|
||||
neUid: row.neUid,
|
||||
coreUid: row.coreUid,
|
||||
action: action,
|
||||
preinput: preinput,
|
||||
})
|
||||
@@ -469,15 +465,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
|
||||
:placeholder="t('common.inputPlease')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
@@ -605,6 +592,21 @@ onMounted(() => {
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dictStatus" :value="record.status" />
|
||||
</template>
|
||||
<template v-if="column.key === 'version'">
|
||||
{{ record.version }}
|
||||
<a-tooltip
|
||||
placement="topRight"
|
||||
v-if="
|
||||
record.version &&
|
||||
(record.path === '' || record.path === '-')
|
||||
"
|
||||
>
|
||||
<template #title>
|
||||
{{ t('views.ne.neVersion.noPath') }}
|
||||
</template>
|
||||
<InfoCircleOutlined />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template v-if="column.key === 'preVersion'">
|
||||
{{ record.preVersion }}
|
||||
<a-tooltip
|
||||
@@ -703,9 +705,9 @@ onMounted(() => {
|
||||
</a-alert>
|
||||
</p>
|
||||
|
||||
<p v-for="o in modalState.operateDataUpgrade" :key="o.neId">
|
||||
<p v-for="o in modalState.operateDataUpgrade" :key="o.neUid">
|
||||
<a-alert
|
||||
:message="`${o.neType}-${o.neId}`"
|
||||
:message="`${o.neType}-${o.neUid}`"
|
||||
:description="o.log"
|
||||
:type="o.status === 'done' ? 'success' : 'error'"
|
||||
show-icon
|
||||
|
||||
@@ -5,8 +5,8 @@ import { PageContainer } from 'antdv-pro-layout';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { ColumnsType } from 'ant-design-vue/es/table';
|
||||
import DissectionTree from '../tshark/components/DissectionTree.vue';
|
||||
import DissectionDump from '../tshark/components/DissectionDump.vue';
|
||||
import DissectionTree from '@/views/tool/tshark/components/DissectionTree.vue';
|
||||
import DissectionDump from '@/views/tool/tshark/components/DissectionDump.vue';
|
||||
import TaskInfoIcon from './components/TaskInfoIcon.vue';
|
||||
import {
|
||||
RESULT_CODE_ERROR,
|
||||
@@ -21,6 +21,7 @@ import useDictStore from '@/store/modules/dict';
|
||||
import useTabsStore from '@/store/modules/tabs';
|
||||
import saveAs from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
@@ -33,6 +34,8 @@ const wk = new wkUtil.WK();
|
||||
const traceId = ref<string>(route.query.traceId as string);
|
||||
/**任务编号 */
|
||||
const id = ref<string>(route.query.id as string);
|
||||
/**核心uid */
|
||||
const coreUid = currentCoreUid();
|
||||
|
||||
/**关闭跳转 */
|
||||
function fnClose() {
|
||||
@@ -590,7 +593,7 @@ onBeforeUnmount(() => {
|
||||
<strong>{{ traceId }}</strong>
|
||||
</span>
|
||||
<!-- 任务信息 -->
|
||||
<TaskInfoIcon :id="id" />
|
||||
<TaskInfoIcon :coreUid="coreUid" :id="id" />
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
596
src/views/ne/trace/task/components/EditModal.vue
Normal file
@@ -0,0 +1,596 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, onMounted, toRaw, watch, PropType } from 'vue';
|
||||
import { ProModal } from 'antdv-pro-modal';
|
||||
import { message, Form, Modal } from 'ant-design-vue/es';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import {
|
||||
addTraceTask,
|
||||
delTraceTask,
|
||||
getTraceTask,
|
||||
listTraceTask,
|
||||
updateTraceTask,
|
||||
} from '@/api/trace/task';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(['ok', 'cancel', 'update:open']);
|
||||
const props = defineProps({
|
||||
open: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
id: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
required: true,
|
||||
},
|
||||
options: {
|
||||
type: Array as PropType<any[]>,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
/**跟踪类型 */
|
||||
traceType: DictType[];
|
||||
/**跟踪接口 */
|
||||
traceInterfaces: DictType[];
|
||||
} = reactive({
|
||||
traceType: [],
|
||||
traceInterfaces: [],
|
||||
});
|
||||
|
||||
/**对话框对象信息状态类型 */
|
||||
type ModalStateType = {
|
||||
/**新增框或修改框是否显示 */
|
||||
openByEdit: boolean;
|
||||
/**标题 */
|
||||
title: string;
|
||||
/**网元类型设备对象 */
|
||||
neType: any[] | undefined;
|
||||
/**网元类型设备对象接口 */
|
||||
neTypeInterface: string[];
|
||||
/**任务开始结束时间 */
|
||||
timeRangePicker: [Dayjs, Dayjs] | undefined;
|
||||
/**表单数据 */
|
||||
from: {
|
||||
id?: string;
|
||||
neList: string; // 网元列表 neType_neUid 例如 UDM_001,AMF_001
|
||||
startTime?: number;
|
||||
endTime?: number;
|
||||
title: string;
|
||||
remark?: string;
|
||||
/**1-Interface,2-Device,3-User */
|
||||
traceType: string;
|
||||
/**1接口跟踪 */
|
||||
interfaces?: string;
|
||||
/**2设备跟踪 */
|
||||
srcIp?: string;
|
||||
dstIp?: string;
|
||||
signalPort?: number;
|
||||
/**3用户跟踪 */
|
||||
imsi?: string;
|
||||
msisdn?: string;
|
||||
};
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
};
|
||||
|
||||
/**对话框对象信息状态 */
|
||||
let modalState: ModalStateType = reactive({
|
||||
openByView: false,
|
||||
openByEdit: false,
|
||||
title: '',
|
||||
neType: [],
|
||||
neTypeInterface: [],
|
||||
timeRangePicker: undefined,
|
||||
from: {
|
||||
id: undefined,
|
||||
coreUid: currentCoreUid(),
|
||||
neList: '',
|
||||
traceId: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
title: '',
|
||||
remark: '',
|
||||
traceType: '3',
|
||||
/**1接口跟踪 */
|
||||
interfaces: '',
|
||||
/**2设备跟踪 */
|
||||
srcIp: '',
|
||||
dstIp: '',
|
||||
signalPort: undefined,
|
||||
/**3用户跟踪 */
|
||||
imsi: undefined,
|
||||
// msisdn: undefined,
|
||||
},
|
||||
confirmLoading: false,
|
||||
});
|
||||
|
||||
/**对话框内表单属性和校验规则 */
|
||||
const modalStateFrom = Form.useForm(
|
||||
modalState.from,
|
||||
reactive({
|
||||
traceType: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.trackTypePlease'),
|
||||
},
|
||||
],
|
||||
neList: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.ne.common.neTypePlease'),
|
||||
},
|
||||
],
|
||||
endTime: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.rangePickerPlease'),
|
||||
},
|
||||
],
|
||||
title: [
|
||||
{
|
||||
required: true,
|
||||
message: t('common.inputPlease'),
|
||||
},
|
||||
],
|
||||
// 用户跟踪
|
||||
imsi: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.imsiPlease'),
|
||||
},
|
||||
],
|
||||
msisdn: [
|
||||
{
|
||||
required: false,
|
||||
message: t('views.traceManage.task.msisdnPlease'),
|
||||
},
|
||||
],
|
||||
// 接口跟踪
|
||||
interfaces: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.interfacesPlease'),
|
||||
},
|
||||
],
|
||||
// 数据跟踪
|
||||
srcIp: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpIPv4,
|
||||
message: t('views.traceManage.task.srcIpPlease'),
|
||||
},
|
||||
],
|
||||
dstIp: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpIPv4,
|
||||
message: t('views.traceManage.task.dstIpPlease'),
|
||||
},
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
/**网元类型选择对应修改 */
|
||||
function fnNeChange(p: any, c: any) {
|
||||
let neList: 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(`${item.neType}_${item.neUid}`);
|
||||
});
|
||||
} else if (v.length === 2) {
|
||||
neList.push(`${v[0]}_${v[1]}`);
|
||||
}
|
||||
}
|
||||
if (neList.length > 0) {
|
||||
modalState.from.neList = neList.join(',');
|
||||
} else {
|
||||
modalState.from.neList = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**开始结束时间选择对应修改 */
|
||||
function fnRangePickerChange(item: any, _: any) {
|
||||
if (!item || item.length !== 2) {
|
||||
modalState.from.startTime = undefined;
|
||||
modalState.from.endTime = undefined;
|
||||
return;
|
||||
}
|
||||
// 获取当前时间
|
||||
const now = dayjs();
|
||||
// 如果开始时间小于当前时间,则设置为当前时间
|
||||
const startTime = item[0].isBefore(now) ? now : item[0];
|
||||
const endTime = item[1].isBefore(now) ? now : item[1];
|
||||
modalState.timeRangePicker = [startTime, endTime];
|
||||
|
||||
modalState.from.startTime = startTime.valueOf();
|
||||
modalState.from.endTime = endTime.valueOf();
|
||||
}
|
||||
function fnRangePickerDisabledDate(current: Dayjs) {
|
||||
return current && current < dayjs().startOf('day');
|
||||
}
|
||||
|
||||
/**信令接口选择对应修改 */
|
||||
function fnSelectInterface(s: any, _: any) {
|
||||
modalState.from.interfaces = s.join(',');
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* @param noticeId 网元id, 不传为新增
|
||||
*/
|
||||
function fnModalOpenByEdit() {
|
||||
if (!props.id) {
|
||||
fnModalCancel();
|
||||
modalState.title = t('views.traceManage.task.addTask');
|
||||
modalState.openByEdit = true;
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getTraceTask(props.coreUid, props.id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
// 回显网元类型
|
||||
const neType: any[] = [];
|
||||
const neList = res.data.neList.split(',');
|
||||
const neListMap: any = {};
|
||||
for (const v of neList) {
|
||||
const item: string[] = v.split('_');
|
||||
if (!neListMap[item[0]]) {
|
||||
neListMap[item[0]] = [];
|
||||
}
|
||||
neListMap[item[0]].push(item[1]);
|
||||
}
|
||||
for (const op of props.options) {
|
||||
const arr = neListMap[op.value];
|
||||
if (!arr) {
|
||||
continue;
|
||||
}
|
||||
const all = op.children.every((c: any) => {
|
||||
return arr.includes(c.neUid);
|
||||
});
|
||||
if (all) {
|
||||
neType.push([op.value]);
|
||||
} else {
|
||||
arr.forEach((v: string) => {
|
||||
neType.push([op.value, v]);
|
||||
});
|
||||
}
|
||||
}
|
||||
modalState.neType = neType;
|
||||
// 回显时间
|
||||
modalState.timeRangePicker = [
|
||||
dayjs(res.data.startTime),
|
||||
dayjs(res.data.endTime),
|
||||
];
|
||||
// 回显接口
|
||||
if (res.data.traceType === '1') {
|
||||
modalState.neTypeInterface = res.data.interfaces.split(',');
|
||||
}
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = t('views.traceManage.task.viewTask');
|
||||
modalState.openByEdit = true;
|
||||
} else {
|
||||
message.error(t('views.traceManage.task.errorTaskInfo'), 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出确认执行函数
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalOk() {
|
||||
const from = toRaw(modalState.from);
|
||||
let valids = ['title', 'traceType', 'neList', 'endTime'];
|
||||
if (from.traceType === '1') {
|
||||
valids = valids.concat(['interfaces']);
|
||||
}
|
||||
if (from.traceType === '2') {
|
||||
valids = valids.concat(['srcIp', 'dstIp']);
|
||||
}
|
||||
if (from.traceType === '3') {
|
||||
valids = valids.concat(['imsi']);
|
||||
}
|
||||
|
||||
modalStateFrom
|
||||
.validate(valids)
|
||||
.then(e => {
|
||||
modalState.confirmLoading = true;
|
||||
const traceTask = from.id ? updateTraceTask(from) : addTraceTask(from);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
traceTask
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
duration: 3,
|
||||
});
|
||||
// 返回无引用信息
|
||||
emit('ok', JSON.parse(JSON.stringify(from)));
|
||||
fnModalCancel();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
modalState.confirmLoading = false;
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出关闭执行函数
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalCancel() {
|
||||
modalState.openByEdit = false;
|
||||
modalState.confirmLoading = false;
|
||||
modalState.timeRangePicker = undefined;
|
||||
modalState.neType = undefined;
|
||||
modalState.neTypeInterface = [];
|
||||
modalStateFrom.resetFields();
|
||||
emit('cancel');
|
||||
emit('update:open', false);
|
||||
}
|
||||
|
||||
/**监听是否显示,初始数据 */
|
||||
watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) fnModalOpenByEdit();
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
// 初始字典数据
|
||||
Promise.allSettled([getDict('trace_type'), getDict('trace_interfaces')]).then(
|
||||
resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
dict.traceType = resArr[0].value;
|
||||
}
|
||||
if (resArr[1].status === 'fulfilled') {
|
||||
dict.traceInterfaces = resArr[1].value;
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
</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"
|
||||
:footer="modalState.from.id ? null : undefined"
|
||||
>
|
||||
<a-form
|
||||
name="modalStateFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 4 }"
|
||||
:label-wrap="true"
|
||||
:disabled="!!modalState.from.id"
|
||||
>
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.title')"
|
||||
name="title"
|
||||
v-bind="modalStateFrom.validateInfos.title"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.title"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.traceManage.task.remark')" name="remark">
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.remark"
|
||||
:auto-size="{ minRows: 1, maxRows: 6 }"
|
||||
:maxlength="450"
|
||||
:show-count="true"
|
||||
:placeholder="t('views.traceManage.task.remarkPlease')"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.ne.common.neType')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="neType"
|
||||
v-bind="modalStateFrom.validateInfos.neList"
|
||||
>
|
||||
<a-cascader
|
||||
v-model:value="modalState.neType"
|
||||
:options="props.options"
|
||||
@change="fnNeChange"
|
||||
multiple
|
||||
:allow-clear="false"
|
||||
:placeholder="t('views.ne.common.neTypePlease')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.trackType')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="traceType"
|
||||
v-bind="modalStateFrom.validateInfos.traceType"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.traceType"
|
||||
:options="dict.traceType"
|
||||
:allow-clear="false"
|
||||
:placeholder="t('views.traceManage.task.trackTypePlease')"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.rangePicker')"
|
||||
name="endTime"
|
||||
v-bind="modalStateFrom.validateInfos.endTime"
|
||||
>
|
||||
<a-range-picker
|
||||
v-model:value="modalState.timeRangePicker"
|
||||
@change="fnRangePickerChange"
|
||||
bordered
|
||||
:show-time="{ format: 'HH:mm:ss' }"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
:disabled-date="fnRangePickerDisabledDate"
|
||||
></a-range-picker>
|
||||
</a-form-item>
|
||||
|
||||
<!-- 接口跟踪 -->
|
||||
<template v-if="modalState.from.traceType === '1'">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.interfaces')"
|
||||
name="interfaces"
|
||||
v-bind="modalStateFrom.validateInfos.interfaces"
|
||||
>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
:placeholder="t('views.traceManage.task.interfacesPlease')"
|
||||
v-model:value="modalState.neTypeInterface"
|
||||
:options="dict.traceInterfaces"
|
||||
@change="fnSelectInterface"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<!-- 设备跟踪 -->
|
||||
<template v-if="modalState.from.traceType === '2'">
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.srcIp')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="srcIp"
|
||||
v-bind="modalStateFrom.validateInfos.srcIp"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.srcIp"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.srcIpPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.srcIpTip') }}</div>
|
||||
</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.traceManage.task.dstIp')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="dstIp"
|
||||
v-bind="modalStateFrom.validateInfos.dstIp"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.dstIp"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.dstIpPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.dstIpTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
|
||||
<!-- 用户跟踪 -->
|
||||
<template v-if="modalState.from.traceType === '3'">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.imsi')"
|
||||
name="imsi"
|
||||
v-bind="modalStateFrom.validateInfos.imsi"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.imsi"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.imsiPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.imsiTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item
|
||||
:label="t('views.traceManage.task.msisdn')"
|
||||
name="msisdn"
|
||||
v-bind="modalStateFrom.validateInfos.msisdn"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.msisdn"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.msisdnPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.msisdnTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item> -->
|
||||
</template>
|
||||
</a-form>
|
||||
</ProModal>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -9,8 +9,14 @@ const { t } = useI18n();
|
||||
const { getDict } = useDictStore();
|
||||
|
||||
const props = defineProps({
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
id: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
@@ -29,10 +35,13 @@ let dict: {
|
||||
const task = ref<Record<string, any>>({});
|
||||
|
||||
/**查询任务信息 */
|
||||
function fnGetTaskInfo(id: string | number) {
|
||||
getTraceTask(id).then(res => {
|
||||
function fnGetTaskInfo() {
|
||||
getTraceTask(props.coreUid, props.id).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(task.value, res.data);
|
||||
task.value.neList = task.value.neList
|
||||
.split(',')
|
||||
.map((item: string) => item.split('_')[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -50,7 +59,7 @@ onMounted(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
// 获取信息
|
||||
fnGetTaskInfo(props.id);
|
||||
fnGetTaskInfo();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -61,7 +70,7 @@ onMounted(() => {
|
||||
<template #content>
|
||||
<div>
|
||||
<strong>{{ t('views.ne.common.neType') }}: </strong>
|
||||
<span v-for="v in task.neList.split(',')"> {{ v }} </span>
|
||||
<span v-for="v in task.neList"> {{ v }} </span>
|
||||
</div>
|
||||
<div>
|
||||
<strong> {{ t('views.traceManage.task.startTime') }}: </strong>
|
||||
@@ -15,6 +15,7 @@ import useI18n from '@/hooks/useI18n';
|
||||
import { getTraceData, listTraceData } from '@/api/trace/task';
|
||||
import { decode } from 'js-base64';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
const { getDict } = useDictStore();
|
||||
const tabsStore = useTabsStore();
|
||||
@@ -25,6 +26,8 @@ const route = useRoute();
|
||||
const traceId = ref<string>(route.query.traceId as string);
|
||||
/**任务编号 */
|
||||
const id = ref<string>(route.query.id as string);
|
||||
/**核心uid */
|
||||
const coreUid = currentCoreUid();
|
||||
|
||||
/**关闭跳转 */
|
||||
function fnClose() {
|
||||
@@ -433,7 +436,7 @@ onMounted(() => {
|
||||
<strong>{{ traceId }}</strong>
|
||||
</span>
|
||||
<!-- 任务信息 -->
|
||||
<TaskInfoIcon :id="id" />
|
||||
<TaskInfoIcon :coreUid="coreUid" :id="id" />
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, onMounted, toRaw, ref } from 'vue';
|
||||
import {
|
||||
reactive,
|
||||
onMounted,
|
||||
toRaw,
|
||||
ref,
|
||||
defineAsyncComponent,
|
||||
nextTick,
|
||||
} from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { PageContainer } from 'antdv-pro-layout';
|
||||
import { ProModal } from 'antdv-pro-modal';
|
||||
@@ -20,14 +27,17 @@ import {
|
||||
updateTraceTask,
|
||||
} from '@/api/trace/task';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { regExpIPv4 } from '@/utils/regular-utils';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { parseObjHumpToLine } from '@/utils/parse-utils';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const EditModal = defineAsyncComponent(
|
||||
() => import('./components/EditModal.vue')
|
||||
);
|
||||
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
@@ -48,6 +58,8 @@ let neCascaderOptions = ref<Record<string, any>[]>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元类型 */
|
||||
neType: '',
|
||||
/**开始时间 */
|
||||
@@ -93,9 +105,11 @@ type TabeStateType = {
|
||||
/**搜索栏 */
|
||||
seached: boolean;
|
||||
/**记录数据 */
|
||||
data: object[];
|
||||
data: Record<string, any>[];
|
||||
/**勾选记录 */
|
||||
selectedRowKeys: (string | number)[];
|
||||
/**勾选记录 */
|
||||
selectedRows: Record<string, any>[];
|
||||
};
|
||||
|
||||
/**表格状态 */
|
||||
@@ -105,6 +119,7 @@ let tableState: TabeStateType = reactive({
|
||||
seached: true,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRows: [],
|
||||
});
|
||||
|
||||
/**表格字段列 */
|
||||
@@ -190,8 +205,14 @@ 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,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */
|
||||
@@ -211,7 +232,6 @@ function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) {
|
||||
* @param id 编号
|
||||
*/
|
||||
function fnRecordDelete(id: string) {
|
||||
if (!id || modalState.confirmLoading) return;
|
||||
let msg = t('views.traceManage.task.delTaskTip', { id: id });
|
||||
if (id === '0') {
|
||||
const mun = `...${tableState.selectedRowKeys.length}`;
|
||||
@@ -223,23 +243,33 @@ function fnRecordDelete(id: string) {
|
||||
title: t('common.tipTitle'),
|
||||
content: msg,
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
delTraceTask(id)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
let reqArr: any = [];
|
||||
if (id === '0') {
|
||||
tableState.selectedRows.forEach(item => {
|
||||
reqArr.push(delTraceTask(item.coreUid, item.id));
|
||||
});
|
||||
} else {
|
||||
tableState.data.forEach(item => {
|
||||
if (item.id === id) {
|
||||
reqArr.push(delTraceTask(item.coreUid, item.id));
|
||||
}
|
||||
});
|
||||
}
|
||||
Promise.all(reqArr)
|
||||
.then(resArr => {
|
||||
if (resArr.every((item: any) => item.code === RESULT_CODE_SUCCESS)) {
|
||||
message.success(t('common.operateOk'), 3);
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
content: t('common.operateErr'),
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
modalState.confirmLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -289,306 +319,46 @@ function fnGetList(pageNum?: number) {
|
||||
|
||||
/**对话框对象信息状态类型 */
|
||||
type ModalStateType = {
|
||||
/**新增框或修改框是否显示 */
|
||||
openByEdit: boolean;
|
||||
/**标题 */
|
||||
title: string;
|
||||
/**网元类型设备对象 */
|
||||
neType: any[] | undefined;
|
||||
/**网元类型设备对象接口 */
|
||||
neTypeInterface: string[];
|
||||
/**任务开始结束时间 */
|
||||
timeRangePicker: [Dayjs, Dayjs] | undefined;
|
||||
/**表单数据 */
|
||||
from: {
|
||||
id?: string;
|
||||
neList: string; // 网元列表 neType_neId 例如 UDM_001,AMF_001
|
||||
startTime?: number;
|
||||
endTime?: number;
|
||||
title: string;
|
||||
remark?: string;
|
||||
/**1-Interface,2-Device,3-User */
|
||||
traceType: string;
|
||||
/**1接口跟踪 */
|
||||
interfaces?: string;
|
||||
/**2设备跟踪 */
|
||||
srcIp?: string;
|
||||
dstIp?: string;
|
||||
signalPort?: number;
|
||||
/**3用户跟踪 */
|
||||
imsi?: string;
|
||||
msisdn?: string;
|
||||
};
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
open: boolean;
|
||||
id: number;
|
||||
coreUid: string;
|
||||
};
|
||||
|
||||
/**对话框对象信息状态 */
|
||||
let modalState: ModalStateType = reactive({
|
||||
openByView: false,
|
||||
openByEdit: false,
|
||||
title: '',
|
||||
neType: [],
|
||||
neTypeInterface: [],
|
||||
timeRangePicker: undefined,
|
||||
from: {
|
||||
id: undefined,
|
||||
neList: '',
|
||||
traceId: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
title: '',
|
||||
remark: '',
|
||||
traceType: '3',
|
||||
/**1接口跟踪 */
|
||||
interfaces: '',
|
||||
/**2设备跟踪 */
|
||||
srcIp: '',
|
||||
dstIp: '',
|
||||
signalPort: undefined,
|
||||
/**3用户跟踪 */
|
||||
imsi: undefined,
|
||||
// msisdn: undefined,
|
||||
},
|
||||
confirmLoading: false,
|
||||
open: false,
|
||||
id: 0,
|
||||
coreUid: '',
|
||||
});
|
||||
|
||||
/**对话框内表单属性和校验规则 */
|
||||
const modalStateFrom = Form.useForm(
|
||||
modalState.from,
|
||||
reactive({
|
||||
traceType: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.trackTypePlease'),
|
||||
},
|
||||
],
|
||||
neList: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.ne.common.neTypePlease'),
|
||||
},
|
||||
],
|
||||
endTime: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.rangePickerPlease'),
|
||||
},
|
||||
],
|
||||
title: [
|
||||
{
|
||||
required: true,
|
||||
message: t('common.inputPlease'),
|
||||
},
|
||||
],
|
||||
// 用户跟踪
|
||||
imsi: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.imsiPlease'),
|
||||
},
|
||||
],
|
||||
msisdn: [
|
||||
{
|
||||
required: false,
|
||||
message: t('views.traceManage.task.msisdnPlease'),
|
||||
},
|
||||
],
|
||||
// 接口跟踪
|
||||
interfaces: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.traceManage.task.interfacesPlease'),
|
||||
},
|
||||
],
|
||||
// 数据跟踪
|
||||
srcIp: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpIPv4,
|
||||
message: t('views.traceManage.task.srcIpPlease'),
|
||||
},
|
||||
],
|
||||
dstIp: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpIPv4,
|
||||
message: t('views.traceManage.task.dstIpPlease'),
|
||||
},
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
/**网元类型选择对应修改 */
|
||||
function fnNeChange(p: any, c: any) {
|
||||
let neList: 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(`${item.neType}_${item.neId}`);
|
||||
});
|
||||
} else if (v.length === 2) {
|
||||
neList.push(`${v[0]}_${v[1]}`);
|
||||
}
|
||||
}
|
||||
if (neList.length > 0) {
|
||||
modalState.from.neList = neList.join(',');
|
||||
} else {
|
||||
modalState.from.neList = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**开始结束时间选择对应修改 */
|
||||
function fnRangePickerChange(item: any, _: any) {
|
||||
if (!item || item.length !== 2) {
|
||||
modalState.from.startTime = undefined;
|
||||
modalState.from.endTime = undefined;
|
||||
return;
|
||||
}
|
||||
// 获取当前时间
|
||||
const now = dayjs();
|
||||
// 如果开始时间小于当前时间,则设置为当前时间
|
||||
const startTime = item[0].isBefore(now) ? now : item[0];
|
||||
const endTime = item[1].isBefore(now) ? now : item[1];
|
||||
modalState.timeRangePicker = [startTime, endTime];
|
||||
|
||||
modalState.from.startTime = startTime.valueOf();
|
||||
modalState.from.endTime = endTime.valueOf();
|
||||
}
|
||||
function fnRangePickerDisabledDate(current: Dayjs) {
|
||||
return current && current < dayjs().startOf('day');
|
||||
}
|
||||
|
||||
/**信令接口选择对应修改 */
|
||||
function fnSelectInterface(s: any, _: any) {
|
||||
modalState.from.interfaces = s.join(',');
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* @param noticeId 网元id, 不传为新增
|
||||
* @param id 网元id, 不传为新增
|
||||
*/
|
||||
function fnModalOpenByEdit(id?: string) {
|
||||
if (!id) {
|
||||
fnModalCancel();
|
||||
modalState.title = t('views.traceManage.task.addTask');
|
||||
modalState.openByEdit = true;
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getTraceTask(id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
// 回显网元类型
|
||||
const neType: any[] = [];
|
||||
const neList = res.data.neList.split(',');
|
||||
const neListMap: any = {};
|
||||
for (const v of neList) {
|
||||
const item: string[] = v.split('_');
|
||||
if (!neListMap[item[0]]) {
|
||||
neListMap[item[0]] = [];
|
||||
}
|
||||
neListMap[item[0]].push(item[1]);
|
||||
}
|
||||
for (const op of neCascaderOptions.value) {
|
||||
const arr = neListMap[op.value];
|
||||
if (!arr) {
|
||||
continue;
|
||||
}
|
||||
const all = op.children.every((c: any) => {
|
||||
return arr.includes(c.neId);
|
||||
});
|
||||
if (all) {
|
||||
neType.push([op.value]);
|
||||
} else {
|
||||
arr.forEach((v: string) => {
|
||||
neType.push([op.value, v]);
|
||||
});
|
||||
}
|
||||
}
|
||||
modalState.neType = neType;
|
||||
// 回显时间
|
||||
modalState.timeRangePicker = [
|
||||
dayjs(res.data.startTime),
|
||||
dayjs(res.data.endTime),
|
||||
];
|
||||
// 回显接口
|
||||
if (res.data.traceType === '1') {
|
||||
modalState.neTypeInterface = res.data.interfaces.split(',');
|
||||
}
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = t('views.traceManage.task.viewTask');
|
||||
modalState.openByEdit = true;
|
||||
} else {
|
||||
message.error(t('views.traceManage.task.errorTaskInfo'), 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
function fnModalOpenByEdit(id: number) {
|
||||
modalState.id = id;
|
||||
modalState.coreUid = currentCoreUid();
|
||||
nextTick(() => {
|
||||
modalState.open = !modalState.open;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出确认执行函数
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalOk() {
|
||||
const from = toRaw(modalState.from);
|
||||
let valids = ['title', 'traceType', 'neList', 'endTime'];
|
||||
if (from.traceType === '1') {
|
||||
valids = valids.concat(['interfaces']);
|
||||
}
|
||||
if (from.traceType === '2') {
|
||||
valids = valids.concat(['srcIp', 'dstIp']);
|
||||
}
|
||||
if (from.traceType === '3') {
|
||||
valids = valids.concat(['imsi']);
|
||||
}
|
||||
|
||||
modalStateFrom
|
||||
.validate(valids)
|
||||
.then(e => {
|
||||
modalState.confirmLoading = true;
|
||||
const traceTask = from.id ? updateTraceTask(from) : addTraceTask(from);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
traceTask
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
duration: 3,
|
||||
});
|
||||
fnModalCancel();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
modalState.confirmLoading = false;
|
||||
fnGetList(1);
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||
});
|
||||
function fnModalEditOk(from: Record<string, any>) {
|
||||
fnGetList(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出关闭执行函数
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalCancel() {
|
||||
modalState.openByEdit = false;
|
||||
modalState.confirmLoading = false;
|
||||
modalStateFrom.resetFields();
|
||||
modalState.neType = [];
|
||||
modalState.neTypeInterface = [];
|
||||
modalState.timeRangePicker = undefined;
|
||||
function fnModalEditCancel() {
|
||||
modalState.coreUid = '';
|
||||
modalState.id = 0;
|
||||
modalState.open = false;
|
||||
}
|
||||
|
||||
/**跳转内嵌详情页面 */
|
||||
@@ -613,11 +383,9 @@ onMounted(() => {
|
||||
);
|
||||
|
||||
// 获取网元网元列表
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter(
|
||||
(item: any) => {
|
||||
return ['AMF', 'AUSF', 'SMF', 'UDM', 'PCF', 'UPF'].includes(item.value); // 过滤不可用的网元
|
||||
}
|
||||
);
|
||||
neCascaderOptions.value = neStore.getNeCascaderOptions.filter((item: any) => {
|
||||
return ['AMF', 'AUSF', 'SMF', 'UDM', 'PCF', 'UPF'].includes(item.value); // 过滤不可用的网元
|
||||
});
|
||||
if (neCascaderOptions.value.length === 0) {
|
||||
message.warning({
|
||||
content: t('common.noData'),
|
||||
@@ -701,7 +469,7 @@ onMounted(() => {
|
||||
<!-- 插槽-卡片左侧侧 -->
|
||||
<template #title>
|
||||
<a-space :size="8" align="center">
|
||||
<a-button type="primary" @click.prevent="fnModalOpenByEdit()">
|
||||
<a-button type="primary" @click.prevent="fnModalOpenByEdit(0)">
|
||||
<template #icon><PlusOutlined /></template>
|
||||
{{ t('common.addText') }}
|
||||
</a-button>
|
||||
@@ -710,7 +478,6 @@ onMounted(() => {
|
||||
type="default"
|
||||
danger
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
:loading="modalState.confirmLoading"
|
||||
@click.prevent="fnRecordDelete('0')"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
@@ -841,219 +608,14 @@ onMounted(() => {
|
||||
</a-card>
|
||||
|
||||
<!-- 新增框或修改框 -->
|
||||
<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"
|
||||
:footer="modalState.from.id ? null : undefined"
|
||||
>
|
||||
<a-form
|
||||
name="modalStateFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 4 }"
|
||||
:label-wrap="true"
|
||||
:disabled="!!modalState.from.id"
|
||||
>
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.title')"
|
||||
name="title"
|
||||
v-bind="modalStateFrom.validateInfos.title"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.title"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.traceManage.task.remark')" name="remark">
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.remark"
|
||||
:auto-size="{ minRows: 1, maxRows: 6 }"
|
||||
:maxlength="450"
|
||||
:show-count="true"
|
||||
:placeholder="t('views.traceManage.task.remarkPlease')"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.ne.common.neType')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="neType"
|
||||
v-bind="modalStateFrom.validateInfos.neList"
|
||||
>
|
||||
<a-cascader
|
||||
v-model:value="modalState.neType"
|
||||
:options="neCascaderOptions"
|
||||
@change="fnNeChange"
|
||||
multiple
|
||||
:allow-clear="false"
|
||||
:placeholder="t('views.ne.common.neTypePlease')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.trackType')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="traceType"
|
||||
v-bind="modalStateFrom.validateInfos.traceType"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.traceType"
|
||||
:options="dict.traceType"
|
||||
:allow-clear="false"
|
||||
:placeholder="t('views.traceManage.task.trackTypePlease')"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.rangePicker')"
|
||||
name="endTime"
|
||||
v-bind="modalStateFrom.validateInfos.endTime"
|
||||
>
|
||||
<a-range-picker
|
||||
v-model:value="modalState.timeRangePicker"
|
||||
@change="fnRangePickerChange"
|
||||
bordered
|
||||
:show-time="{ format: 'HH:mm:ss' }"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
:disabled-date="fnRangePickerDisabledDate"
|
||||
></a-range-picker>
|
||||
</a-form-item>
|
||||
|
||||
<!-- 接口跟踪 -->
|
||||
<template v-if="modalState.from.traceType === '1'">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.interfaces')"
|
||||
name="interfaces"
|
||||
v-bind="modalStateFrom.validateInfos.interfaces"
|
||||
>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
:placeholder="t('views.traceManage.task.interfacesPlease')"
|
||||
v-model:value="modalState.neTypeInterface"
|
||||
:options="dict.traceInterfaces"
|
||||
@change="fnSelectInterface"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<!-- 设备跟踪 -->
|
||||
<template v-if="modalState.from.traceType === '2'">
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.srcIp')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="srcIp"
|
||||
v-bind="modalStateFrom.validateInfos.srcIp"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.srcIp"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.srcIpPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.srcIpTip') }}</div>
|
||||
</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.traceManage.task.dstIp')"
|
||||
:label-col="{ span: 8 }"
|
||||
name="dstIp"
|
||||
v-bind="modalStateFrom.validateInfos.dstIp"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.dstIp"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.dstIpPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.dstIpTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined
|
||||
style="opacity: 0.45; color: inherit"
|
||||
/>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
|
||||
<!-- 用户跟踪 -->
|
||||
<template v-if="modalState.from.traceType === '3'">
|
||||
<a-form-item
|
||||
:label="t('views.traceManage.task.imsi')"
|
||||
name="imsi"
|
||||
v-bind="modalStateFrom.validateInfos.imsi"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.imsi"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.imsiPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.imsiTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item
|
||||
:label="t('views.traceManage.task.msisdn')"
|
||||
name="msisdn"
|
||||
v-bind="modalStateFrom.validateInfos.msisdn"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.msisdn"
|
||||
allow-clear
|
||||
:placeholder="t('views.traceManage.task.msisdnPlease')"
|
||||
>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
<div>{{ t('views.traceManage.task.msisdnTip') }}</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item> -->
|
||||
</template>
|
||||
</a-form>
|
||||
</ProModal>
|
||||
<EditModal
|
||||
v-model:open="modalState.open"
|
||||
:core-uid="modalState.coreUid"
|
||||
:id="modalState.id"
|
||||
:options="neCascaderOptions"
|
||||
@ok="fnModalEditOk"
|
||||
@cancel="fnModalEditCancel"
|
||||
></EditModal>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
@@ -339,6 +339,7 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.dashboard.ue.exportTip'),
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const querys = toRaw(queryParams);
|
||||
querys.pageSize = 10000;
|
||||
@@ -20,6 +20,17 @@ 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: '/auth',
|
||||
label: t('views.neData.backupData.auth'),
|
||||
@@ -44,6 +55,31 @@ let sourceState = reactive({
|
||||
path: '/usr/local/omc/backup/udm_data',
|
||||
neType: 'UDM+IMS',
|
||||
},
|
||||
|
||||
{
|
||||
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,
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import { reactive, onMounted, ref, onBeforeUnmount, useTemplateRef } from 'vue';
|
||||
import { Graph, GraphData, Menu, Tooltip, Util } from '@antv/g6';
|
||||
import { listAMFNbStatelist } from '@/api/neData/amf';
|
||||
import { stateNeInfo } from '@/api/ne/neAction';
|
||||
import { parseBasePath } from '@/plugins/file-static-url';
|
||||
import { edgeLineAnimateState } from '@/views/monitor/topologyBuild/hooks/registerEdge';
|
||||
import { nodeImageAnimateState } from '@/views/monitor/topologyBuild/hooks/registerNode';
|
||||
import useNeStore from '@/store/modules/ne';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { stateNeInfo } from '@/api/ne/neInfo';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { useFullscreen } from '@vueuse/core';
|
||||
import { listMMENbStatelist } from '@/api/neData/mme';
|
||||
@@ -359,7 +359,7 @@ function handleRanderGraph(container: HTMLElement | null, data: GraphData) {
|
||||
/**
|
||||
* 获取图组数据渲染到画布
|
||||
*/
|
||||
async function fnGraphDataLoad() {
|
||||
async function fnGraphDataLoad() {
|
||||
const dataNe = await fnGraphDataBase();
|
||||
Object.assign(graphData, dataNe);
|
||||
graphG6.value = handleRanderGraph(graphG6Dom.value, dataNe);
|
||||
@@ -487,7 +487,7 @@ async function fnGraphState(reload: boolean = false) {
|
||||
if (onc) {
|
||||
const { id, nInfo } = onc as any;
|
||||
if (!nInfo) return;
|
||||
const res = await stateNeInfo(nInfo.neType, nInfo.neId);
|
||||
const res = await stateNeInfo(nInfo.coreUid, nInfo.neUid);
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(nInfo, res.data, {
|
||||
refreshTime: parseDateToStr(res.data.refreshTime, 'HH:mm:ss'),
|
||||
@@ -502,7 +502,7 @@ async function fnGraphState(reload: boolean = false) {
|
||||
.forEach(async (v: any) => {
|
||||
const { id, nInfo } = v;
|
||||
if (!nInfo) return;
|
||||
const res = await stateNeInfo(nInfo.neType, nInfo.neId);
|
||||
const res = await stateNeInfo(nInfo.coreUid, nInfo.neUid);
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(nInfo, res.data, {
|
||||
refreshTime: parseDateToStr(res.data.refreshTime, 'HH:mm:ss'),
|
||||
@@ -513,7 +513,10 @@ async function fnGraphState(reload: boolean = false) {
|
||||
|
||||
// 重载时更新下级基站状态
|
||||
if (reload && nInfo.neType === 'AMF') {
|
||||
const res = await listAMFNbStatelist({ neId: nInfo.neId });
|
||||
const res = await listAMFNbStatelist({
|
||||
coreUid: nInfo.coreUid,
|
||||
neUid: nInfo.neUid,
|
||||
});
|
||||
if (res.code == RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
for (const nb of res.data) {
|
||||
const nbItem = graphData.nodes.find(
|
||||
|
||||
@@ -341,6 +341,7 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.dashboard.ue.exportTip'),
|
||||
onOk() {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const querys = toRaw(queryParams);
|
||||
querys.pageSize = 10000;
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
import { uploadFile } from '@/api/tool/file';
|
||||
import { getNeViewFile } from '@/api/tool/neFile';
|
||||
const { t } = useI18n();
|
||||
const neStore = useNeStore();
|
||||
const neListStore = useNeStore();
|
||||
/**网元参数 */
|
||||
let neOtions = ref<Record<string, any>[]>([]);
|
||||
|
||||
@@ -232,12 +232,12 @@ const modalStateFrom = Form.useForm(
|
||||
],
|
||||
imsi: [
|
||||
{ required: true, message: 'IMSI' + t('common.unableNull') },
|
||||
{ min: 15, message: t('views.neUser.auth.imsiConfirm') },
|
||||
{ min: 15, max: 15, message: t('views.neUser.auth.imsiConfirm') },
|
||||
],
|
||||
amf: [{ required: true, message: 'AMF' + t('common.unableNull') }],
|
||||
ki: [
|
||||
{ required: true, message: 'KI' + t('common.unableNull') },
|
||||
{ min: 32, message: t('views.neUser.auth.kiTip') },
|
||||
{ min: 32, max: 32, message: t('views.neUser.auth.kiTip') },
|
||||
],
|
||||
algoIndex: [
|
||||
{ required: true, message: 'algoIndex' + t('common.unableNull') },
|
||||
@@ -739,7 +739,7 @@ function fnModalDownloadImportTemplate() {
|
||||
|
||||
onMounted(() => {
|
||||
// 获取网元网元列表
|
||||
neStore.neCascaderOptions.forEach(item => {
|
||||
neListStore.neCascaderOptions.forEach(item => {
|
||||
if (item.value === 'UDM') {
|
||||
neOtions.value = JSON.parse(JSON.stringify(item.children));
|
||||
}
|
||||
@@ -865,7 +865,6 @@ onMounted(() => {
|
||||
ok-text="TXT"
|
||||
ok-type="default"
|
||||
@confirm="fnExportList('txt')"
|
||||
v-if="false"
|
||||
>
|
||||
<a-button type="dashed">
|
||||
<template #icon><ExportOutlined /></template>
|
||||
@@ -891,7 +890,6 @@ onMounted(() => {
|
||||
ok-type="default"
|
||||
@confirm="fnRecordExport('txt')"
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
v-if="false"
|
||||
>
|
||||
<a-button
|
||||
type="default"
|
||||
|
||||
@@ -16,6 +16,7 @@ import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
|
||||
import { fnToStepName } from '../hooks/useStep';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
@@ -77,8 +78,8 @@ let modalState: ModalStateType = reactive({
|
||||
ip: '',
|
||||
port: 33030,
|
||||
pvFlag: 'PNF',
|
||||
rmUid: '',
|
||||
neAddress: '',
|
||||
coreUid: currentCoreUid(),
|
||||
macAddr: '',
|
||||
dn: '-',
|
||||
vendorName: '-',
|
||||
province: 'Area',
|
||||
@@ -106,7 +107,7 @@ let tableColumns: any = [
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
title: t('views.ne.common.neUid'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
@@ -241,7 +242,7 @@ function fnModalVisibleByEdit(record?: any) {
|
||||
port: 33030,
|
||||
pvFlag: 'PNF',
|
||||
rmUid: `4400HXNew${neId}`,
|
||||
neAddress: '',
|
||||
macAddr: '',
|
||||
dn: '-',
|
||||
vendorName: '-',
|
||||
province: 'Area',
|
||||
@@ -479,6 +480,7 @@ function save(key: string) {
|
||||
/**获取列表 */
|
||||
function fnGetList() {
|
||||
listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandHost: true,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
@@ -653,7 +655,7 @@ onMounted(() => {
|
||||
<template #title>
|
||||
{{ t('views.ne.common.neTypeTip') }}
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" />
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
@@ -663,25 +665,25 @@ onMounted(() => {
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.ne.common.neId')"
|
||||
:label="t('views.ne.common.neUid')"
|
||||
name="neId"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: t('views.ne.common.neIdPlease'),
|
||||
message: t('views.ne.common.neUidPlease'),
|
||||
}"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.neId"
|
||||
allow-clear
|
||||
:placeholder="t('views.ne.common.neIdPlease')"
|
||||
:placeholder="t('views.ne.common.neUidPlease')"
|
||||
:maxlength="24"
|
||||
>
|
||||
<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;" />
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
@@ -717,7 +719,7 @@ onMounted(() => {
|
||||
{{ t('views.ne.common.ipAddrTip') }}
|
||||
</div>
|
||||
</template>
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" />
|
||||
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-input>
|
||||
|
||||
@@ -3,14 +3,10 @@ import { Modal, message } from 'ant-design-vue/es';
|
||||
import { onMounted, reactive, toRaw } from 'vue';
|
||||
import { fnToStepName } from '../hooks/useStep';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import {
|
||||
listNeInfo,
|
||||
getPara5GFilee,
|
||||
savePara5GFile,
|
||||
updateNeInfo,
|
||||
} from '@/api/ne/neInfo';
|
||||
import { listNeInfo, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import Para5GForm from '@/views/ne/neQuickSetup/components/Para5GForm.vue';
|
||||
import { getPara5GFilee, savePara5GFile } from '@/api/ne/neAction';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**对象信息信息状态类型 */
|
||||
|
||||
@@ -27,7 +27,7 @@ let tableColumns = ref<TableColumnsType>([
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
title: t('views.ne.common.neUid'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
|
||||
@@ -29,7 +29,7 @@ let tableColumns = ref<TableColumnsType>([
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
title: t('views.ne.common.neUid'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
@@ -128,7 +128,7 @@ function fnRecordState() {
|
||||
if (row.neType.toUpperCase() === 'OMC') {
|
||||
continue;
|
||||
}
|
||||
const res = await stateNeLicense(row.neType, row.neId);
|
||||
const res = await stateNeLicense(row.coreUid, row.neUid);
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
row.status = '1';
|
||||
row.serialNum = res.data.sn;
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
import TerminalSSHView from '@/components/TerminalSSHView/index.vue';
|
||||
import useNeStore from '@/store/modules/ne';
|
||||
import { iperfI, iperfV } from '@/api/tool/iperf';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const neStore = useNeStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -31,7 +32,8 @@ let state = reactive({
|
||||
/**ws参数 */
|
||||
params: {
|
||||
neType: '',
|
||||
neId: '',
|
||||
neUid: '',
|
||||
coreUid: '',
|
||||
cols: 120,
|
||||
rows: 40,
|
||||
},
|
||||
@@ -58,8 +60,8 @@ let state = reactive({
|
||||
|
||||
/**连接发送 */
|
||||
async function fnIPerf() {
|
||||
const [neType, neId] = state.neType;
|
||||
if (!neType || !neId) {
|
||||
const [neType, neUid] = state.neType;
|
||||
if (!neType || !neUid) {
|
||||
message.warning({
|
||||
content: 'No Found NE Type',
|
||||
duration: 2,
|
||||
@@ -86,18 +88,21 @@ async function fnIPerf() {
|
||||
}
|
||||
|
||||
// 网元切换时重置
|
||||
if (neType !== state.params.neType || neId !== state.params.neId) {
|
||||
if (neType !== state.params.neType || neUid !== state.params.neUid) {
|
||||
state.initialized = false;
|
||||
state.params.neType = neType;
|
||||
state.params.neId = neId;
|
||||
state.params.neUid = neUid;
|
||||
state.params.coreUid = currentCoreUid();
|
||||
}
|
||||
|
||||
// 软件版本检查
|
||||
state.params.neType = neType;
|
||||
state.params.neId = neId;
|
||||
state.params.neUid = neUid;
|
||||
state.params.coreUid = currentCoreUid();
|
||||
const resVersion = await iperfV({
|
||||
neType,
|
||||
neId,
|
||||
neUid,
|
||||
coreUid: currentCoreUid(),
|
||||
version: state.data.version,
|
||||
});
|
||||
if (resVersion.code !== RESULT_CODE_SUCCESS) {
|
||||
@@ -123,8 +128,13 @@ async function fnIPerf() {
|
||||
function fnInstall() {
|
||||
const key = 'iperfI';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
const { neType, neId } = state.params;
|
||||
iperfI({ neType, neId, version: state.data.version }).then(res => {
|
||||
const { neType, neUid, coreUid } = state.params;
|
||||
iperfI({
|
||||
neType,
|
||||
neUid,
|
||||
coreUid,
|
||||
version: state.data.version,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: 'install success',
|
||||
@@ -233,7 +243,7 @@ function fnMessage(res: Record<string, any>) {
|
||||
/**钩子函数,界面打开初始化*/
|
||||
onMounted(() => {
|
||||
// 获取网元网元列表
|
||||
for (const item of neListStore.getNeCascaderOptions) {
|
||||
for (const item of neStore.getNeCascaderOptions) {
|
||||
neCascaderOptions.value.push(item); // 过滤不可用的网元
|
||||
}
|
||||
if (neCascaderOptions.value.length === 0) {
|
||||
@@ -525,7 +535,8 @@ onBeforeUnmount(() => {});
|
||||
prefix="iperf"
|
||||
url="/tool/iperf/run"
|
||||
:ne-type="state.params.neType"
|
||||
:ne-id="state.params.neId"
|
||||
:ne-uid="state.params.neUid"
|
||||
:core-uid="state.params.coreUid"
|
||||
:rows="state.params.rows"
|
||||
:cols="state.params.cols"
|
||||
:process-messages="fnProcessMessage"
|
||||
|
||||
@@ -12,6 +12,7 @@ import saveAs from 'file-saver';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { MENU_PATH_INLINE } from '@/constants/menu-constants';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
@@ -150,7 +151,7 @@ let tableColumns: ColumnsType = [
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neId'),
|
||||
title: t('views.ne.common.neUid'),
|
||||
dataIndex: 'neId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
@@ -191,6 +192,7 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listAllNeInfo({
|
||||
coreUid: currentCoreUid(),
|
||||
bandStatus: false,
|
||||
}).then(res => {
|
||||
if (
|
||||