--添加解析execl插件,活动告警部分功能

This commit is contained in:
lai
2023-09-27 09:57:01 +08:00
parent 3b9b56fec9
commit ccf2eeef4d
23 changed files with 416 additions and 100 deletions

View File

@@ -1,15 +1,18 @@
<script setup lang="ts">
import { useRoute } from 'vue-router';
import dayjs, { Dayjs } from 'dayjs';
import { reactive, ref, onMounted, toRaw } from 'vue';
import { PageContainer } from '@ant-design-vue/pro-layout';
import { message } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { listUE } from '@/api/neUser/ue';
import useUserStore from '@/store/modules/user';
import { listAct } from '@/api/faultManage/actAlarm';
import useNeInfoStore from '@/store/modules/neinfo';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { parseStrToDate } from '@/utils/execl-utils';
const { t } = useI18n();
const route = useRoute();
@@ -21,12 +24,22 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元ID */
neId: undefined,
/**IMSI */
imsi: '',
/**msisdn */
msisdn: '',
/**告警设备类型 */
ne_type: '',
/**告警网元名称 */
ne_name: '',
/**告警网元标识 */
ne_id: '',
/**告警编号 */
alarm_code: '',
/**告警级别 */
orig_severity: "'Critical','Major','Minor','Warning','Event'",
/**告警产生时间 */
eventTime: '',
/**虚拟化标识 */
pv_flag: '',
/**告警类型 */
alarm_type: '',
/**当前页数 */
pageNum: 1,
/**每页条数 */
@@ -72,54 +85,104 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */
let tableColumns: ColumnsType = [
{
title: 'IMSI',
dataIndex: 'imsi',
title: t('views.faultManage.activeAlarm.alarmId'),
dataIndex: 'alarmId',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.neId'),
dataIndex: 'neId',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.neName'),
dataIndex: 'neName',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.neType'),
dataIndex: 'neType',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.origLevel'),
dataIndex: 'origSeverity',
align: 'center',
customRender(opt) {
const idx = opt.value.lastIndexOf('-');
if (idx != -1) {
return opt.value.substring(idx + 1);
let levelName: any = {
Critical: '严重告警',
Major: '主要告警',
Minor: '次要告警',
Warning: '警告告警',
Event: '事件告警',
};
if (levelName[opt.value]) {
return levelName[opt.value];
}
return opt.value;
},
},
{
title: 'MSISDN',
dataIndex: 'msisdn',
title: t('views.faultManage.activeAlarm.alarmCode'),
dataIndex: 'alarmCode',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.alarmTitle'),
dataIndex: 'alarmTitle',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.eventTime'),
dataIndex: 'eventTime',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.alarmType'),
dataIndex: 'alarmType',
align: 'center',
customRender(opt) {
const idx = opt.value.lastIndexOf('-');
if (idx != -1) {
return opt.value.substring(idx + 1);
let levelName: any = {
CommunicationAlarm: '通信告警',
EquipmentAlarm: '设备告警',
ProcessingFailure: '处理错误告警',
EnvironmentalAlarm: '环境告警',
QualityOfServiceAlarm: '服务质量告警',
};
if (levelName[opt.value]) {
return levelName[opt.value];
}
return opt.value;
},
},
{
title: 'RatType',
dataIndex: 'ratType',
title: t('views.faultManage.activeAlarm.pvFlag'),
dataIndex: 'alarm_id',
align: 'center',
},
{
title: 'DnnList',
dataIndex: 'pduSessionInfo',
title: t('views.faultManage.activeAlarm.clearUser'),
dataIndex: 'clearUser',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.clearType'),
dataIndex: 'clearType',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.ackState'),
dataIndex: 'ackState',
align: 'center',
},
{
title: t('views.faultManage.activeAlarm.ackUser'),
dataIndex: 'ackUser',
align: 'center',
customRender(opt) {
if (opt.value) {
let arr = [];
for (const v of opt.value) {
if (v.dnn) {
arr.push(v.dnn);
}
}
return arr.sort().join(',');
}
return '';
},
},
{
title: t('common.operate'),
key: 'imsi',
key: 'alarm_id',
align: 'center',
},
];
@@ -157,6 +220,47 @@ function fnTableSize({ key }: MenuInfo) {
tableState.size = key as SizeType;
}
/**表格所需option */
const actAlarmOption = reactive({
pvFlag: [
{ label: 'PNF', value: "'PNF'" },
{ label: 'VNF', value: "'VNF'" },
],
alarmType: [
{
label: t('views.faultManage.activeAlarm.communicationAlarm'),
value: "'CommunicationAlarm'",
},
{
label: t('views.faultManage.activeAlarm.equipmentAlarm'),
value: "'EquipmentAlarm'",
},
{
label: t('views.faultManage.activeAlarm.processingFailure'),
value: "'ProcessingFailure'",
},
{
label: t('views.faultManage.activeAlarm.environmentalAlarm'),
value: "'EnvironmentalAlarm'",
},
{
label: t('views.faultManage.activeAlarm.qualityOfServiceAlarm'),
value: "'QualityOfServiceAlarm'",
},
],
origSeverity: [
{
label: t('views.faultManage.activeAlarm.all'),
value: "'Critical','Major','Minor','Warning','Event'",
},
{ label: t('views.faultManage.activeAlarm.critical'), value: "'Critical'" },
{ label: t('views.faultManage.activeAlarm.major'), value: "'Major'" },
{ label: t('views.faultManage.activeAlarm.minor'), value: "'Minor'" },
{ label: t('views.faultManage.activeAlarm.warning'), value: "'Warning'" },
{ label: t('views.faultManage.activeAlarm.eventAlarm'), value: "'Event'" },
],
});
/**对话框对象信息状态类型 */
type ModalStateType = {
/**详情框是否显示 */
@@ -175,12 +279,31 @@ type ModalStateType = {
let modalState: ModalStateType = reactive({
visibleByView: false,
visibleByEdit: false,
title: '在线信息',
title: '全部信息',
from: {
imsi: '',
msisdn: '',
pduSessionInfo: undefined,
ratType: '',
alarmId: '',
alarmSeq: '',
neId:'',
neName: '',
neType: '',
alarmCode: '',
alarmTitle: '',
eventTime: '',
alarmType: '',
pvFlag: '',
objectName: '',
locationInfo: '',
province: '',
alarmStatus: '',
specificProblemId: '',
specificProblem: '',
addInfo: '',
clearType: '',
clearTime: '',
ackState: '',
ackUser: '',
ackTime: '',
origSeverity: '',
},
confirmLoading: false,
});
@@ -190,10 +313,9 @@ let modalState: ModalStateType = reactive({
* @param row 单行记录信息
*/
function fnModalVisibleByVive(row: Record<string, any>) {
if (!row.imsi) {
message.error(`记录信息存在错误`, 2);
return;
}
console.log(toRaw(row))
return false;
const imsiIdx = row.imsi.lastIndexOf('-');
if (imsiIdx != -1) {
row.imsi = row.imsi.substring(imsiIdx + 1);
@@ -206,6 +328,11 @@ function fnModalVisibleByVive(row: Record<string, any>) {
modalState.title = `${row.imsi} 记录信息`;
modalState.visibleByView = true;
}
function fnModalVisibleBy() {
parseStrToDate();
}
/**
* 对话框弹出关闭执行函数
@@ -220,7 +347,7 @@ function fnModalCancel() {
function fnGetList() {
if (tableState.loading) return;
tableState.loading = true;
listUE(toRaw(queryParams)).then(res => {
listAct(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
@@ -236,8 +363,10 @@ function fnGetList() {
});
}
const profile = useUserStore().profile;
onMounted(() => {
fnGetList();
});
</script>
@@ -249,7 +378,7 @@ onMounted(() => {
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
>
<!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal" >
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<!-- <a-form-item :label="t('views.neUser.ue.neType')" name="neId ">
@@ -259,34 +388,42 @@ onMounted(() => {
:placeholder="t('views.neUser.ue.neTypePlease')"
/>
</a-form-item> -->
<a-form-item :label="t('views.neUser.ue.neTypePlease')" name="imsi">
<a-form-item
:label="t('views.faultManage.activeAlarm.neType')"
name="ne_type"
>
<a-input
v-model:value="queryParams.imsi"
v-model:value="queryParams.ne_type"
allow-clear
placeholder="查询IMSI"
placeholder="查询告警设备类型"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="IMSI" name="imsi">
<a-form-item
:label="t('views.faultManage.activeAlarm.neName')"
name="ne_name"
>
<a-input
v-model:value="queryParams.imsi"
v-model:value="queryParams.ne_name"
allow-clear
placeholder="查询IMSI"
placeholder="查询告警网元名称"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-form-item
:label="t('views.faultManage.activeAlarm.neId')"
name="ne_id"
>
<a-input
v-model:value="queryParams.msisdn"
v-model:value="queryParams.ne_id"
allow-clear
placeholder="查询MSISDN"
placeholder="查询告警网元标识"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
@@ -304,50 +441,67 @@ onMounted(() => {
</a-row>
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-form-item
:label="t('views.faultManage.activeAlarm.alarmCode')"
name="alarm_code"
>
<a-input
v-model:value="queryParams.msisdn"
v-model:value="queryParams.alarm_code"
allow-clear
placeholder="查询MSISDN"
placeholder="查询告警编号"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-input
v-model:value="queryParams.msisdn"
allow-clear
placeholder="查询MSISDN"
></a-input>
<a-form-item
:label="t('views.faultManage.activeAlarm.origLevel')"
name="orig_severity"
>
<a-select
v-model:value="queryParams.orig_severity"
placeholder="Select alarm Type"
show-search
:options="actAlarmOption.origSeverity"
/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-input
v-model:value="queryParams.msisdn"
allow-clear
placeholder="查询MSISDN"
></a-input>
<a-form-item
:label="t('views.faultManage.activeAlarm.eventTime')"
name="eventTime"
>
<a-range-picker show-time style="width: 400px" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-input
v-model:value="queryParams.msisdn"
allow-clear
placeholder="查询MSISDN"
></a-input>
<a-form-item
:label="t('views.faultManage.activeAlarm.pvFlag')"
name="pv_flag"
>
<a-select
v-model:value="queryParams.pv_flag"
placeholder="Select a person"
show-search
:options="actAlarmOption.pvFlag"
/>
<!-- <a-select-option value="'PNF'">PNF</a-select-option>
<a-select-option value="'VNF'">VNF</a-select-option>
</a-select> -->
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-input
v-model:value="queryParams.msisdn"
allow-clear
placeholder="查询MSISDN"
></a-input>
<a-form-item
:label="t('views.faultManage.activeAlarm.alarmType')"
name="alarm_type"
>
<a-select
v-model:value="queryParams.alarm_type"
placeholder="Select alarm Type"
show-search
:options="actAlarmOption.alarmType"
/>
</a-form-item>
</a-col>
</a-row>
@@ -415,7 +569,7 @@ onMounted(() => {
:scroll="{ x: true }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'imsi'">
<template v-if="column.key === 'alarm_id'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>查看详情</template>
@@ -423,7 +577,16 @@ onMounted(() => {
type="link"
@click.prevent="fnModalVisibleByVive(record)"
>
<template #icon><ProfileOutlined /></template>
<template #icon><InfoCircleOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>帮助文档</template>
<a-button
type="link"
@click.prevent="fnModalVisibleBy()"
>
<template #icon><QuestionCircleOutlined style="color:crimson;"/></template>
</a-button>
</a-tooltip>
</a-space>

View File

@@ -381,7 +381,7 @@ function fnBatchModalOk() {
* 对话框弹出 批量删除确认执行函数
* 进行表达规则校验
*/
function fnBatchDelModalOk() {
function fnBatchDelModalOk() {
modalStateBatchDelFrom
.validate()
.then(e => {
@@ -434,7 +434,7 @@ function fnBatchModalCancel() {
* 批量删除对话框弹出关闭执行函数
* 进行表达规则校验
*/
function fnBatchDelModalCancel() {
function fnBatchDelModalCancel() {
modalState.visibleByBatchDel = false;
modalState.visibleByView = false;
modalStateBatchDelFrom.resetFields();
@@ -859,7 +859,6 @@ onMounted(() => {
>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
{{ modalState.from }}
<a-form-item
label="IMSI"
name="imsi"
@@ -1058,9 +1057,8 @@ onMounted(() => {
</a-form>
</a-modal>
<!-- 批量删除框 -->
<a-modal
<!-- 批量删除框 -->
<a-modal
width="1000px"
:keyboard="false"
:mask-closable="false"
@@ -1090,7 +1088,7 @@ onMounted(() => {
></a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.neUser.sub.startIMSI')"
@@ -1115,8 +1113,7 @@ onMounted(() => {
</a-input>
</a-form-item>
</a-col>
</a-row>
</a-row>
</a-form>
</a-modal>