diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index fbfc7272..24ee5154 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -693,17 +693,6 @@ export default { mySelf: 'Personalization', exportAll: 'Export All', disPlayFilfter: 'Display Filters', - autoConfirm: 'Automatic Confirm', - critical:'Critical', - major:'Major', - minor:'Minor', - warning:'Warning', - eventAlarm:'Event', - communicationAlarm:'CommunicationAlarm', - equipmentAlarm:'EquipmentAlarm', - processingFailure:'ProcessingFailure', - environmentalAlarm:'EnvironmentalAlarm', - qualityOfServiceAlarm:'QualityOfServiceAlarm', alarmId:'ID', alarmTitle:'Title', clearUser:'Clear User', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 9f139e68..27fdfed3 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -693,17 +693,6 @@ export default { mySelf: '个性化设置', exportAll: '导出全部', disPlayFilfter: '显示过滤', - autoConfirm: '自动确认配置', - critical:'严重告警', - major:'主要告警', - minor:'次要告警', - warning:'警告告警', - eventAlarm:'事件告警', - communicationAlarm:'通信告警', - equipmentAlarm:'设备告警', - processingFailure:'处理错误告警', - environmentalAlarm:'环境告警', - qualityOfServiceAlarm:'服务质量告警', alarmId:'告警唯一标识', alarmTitle:'告警名称', clearUser:'告警清除用户', diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index 5f5b9306..5b298793 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -17,12 +17,31 @@ import { exportAll, } from '@/api/faultManage/actAlarm'; import useI18n from '@/hooks/useI18n'; +import useDictStore from '@/store/modules/dict'; import saveAs from 'file-saver'; import { writeSheet } from '@/utils/execl-utils'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { readLoalXlsx } from '@/utils/execl-utils'; +const { getDict } = useDictStore(); const { t } = useI18n(); +/**字典数据 */ +let dict: { + /**活动告警类型 */ + activeAlarmType: DictType[]; + /**告警清除类型 */ + activeClearType: DictType[]; + /**告警清除类型 */ + activeAckState: DictType[]; + /**原始严重程度 */ + activeAlarmSeverity: DictType[]; +} = reactive({ + activeAlarmType: [], + activeClearType: [], + activeAckState: [], + activeAlarmSeverity: [], +}); + /**记录开始结束时间 */ let queryRangePicker = ref<[string, string]>(['', '']); @@ -37,15 +56,15 @@ let queryParams = reactive({ /**告警编号 */ alarmCode: '', /**告警级别 */ - origSeverity: '', + origSeverity: undefined, beginTime: '', endTime: '', /**告警产生时间 */ - eventTime: (queryRangePicker.value = ['', '']), + eventTime: '', /**虚拟化标识 */ - pvFlag: '', + pvFlag: undefined, /**告警类型 */ - alarmType: '', + alarmType: undefined, /**当前页数 */ pageNum: 1, /**每页条数 */ @@ -64,13 +83,13 @@ function fnQueryReset() { /**告警编号 */ alarmCode: '', /**告警级别 */ - origSeverity: '', + origSeverity: undefined, /**告警产生时间 */ - eventTime: (queryRangePicker.value = ['', '']), + eventTime: '', /**虚拟化标识 */ - pvFlag: '', + pvFlag: undefined, /**告警类型 */ - alarmType: '', + alarmType: undefined, /**当前页数 */ }); tablePagination.current = 1; @@ -122,19 +141,19 @@ let tableColumns: ColumnsType = [ title: t('views.faultManage.activeAlarm.alarmId'), dataIndex: 'alarmId', align: 'center', - width: 8, + width: 5, }, { title: t('views.faultManage.activeAlarm.neId'), dataIndex: 'neId', align: 'center', - width: 8, + width: 5, }, { title: t('views.faultManage.activeAlarm.neName'), dataIndex: 'neName', align: 'center', - width: 8, + width: 5, }, { title: t('views.faultManage.activeAlarm.neType'), @@ -157,7 +176,7 @@ let tableColumns: ColumnsType = [ { title: t('views.faultManage.activeAlarm.alarmTitle'), dataIndex: 'alarmTitle', - align: 'center', + align: 'left', width: 5, }, { @@ -165,25 +184,13 @@ let tableColumns: ColumnsType = [ dataIndex: 'eventTime', align: 'center', sorter: (a: any, b: any) => 1, - width: 8, + width: 5, }, { title: t('views.faultManage.activeAlarm.alarmType'), dataIndex: 'alarmType', - align: 'center', - customRender(opt) { - let levelName: any = { - CommunicationAlarm: '通信告警', - EquipmentAlarm: '设备告警', - ProcessingFailure: '处理错误告警', - EnvironmentalAlarm: '环境告警', - QualityOfServiceAlarm: '服务质量告警', - }; - if (levelName[opt.value]) { - return levelName[opt.value]; - } - return opt.value; - }, + key: 'alarmType', + align: 'left', width: 5, }, { @@ -195,46 +202,27 @@ let tableColumns: ColumnsType = [ { title: t('views.faultManage.activeAlarm.clearUser'), dataIndex: 'clearUser', - align: 'center', - width: 10, + align: 'left', + width: 5, }, { title: t('views.faultManage.activeAlarm.clearType'), dataIndex: 'clearType', - align: 'center', - customRender(opt) { - let clearType: any = { - 0: '未清除', - 1: '自动清除', - 2: '手动清除', - }; - if (clearType[opt.value]) { - return clearType[opt.value]; - } - return opt.value; - }, + key: 'clearType', + align: 'left', width: 5, }, { title: t('views.faultManage.activeAlarm.ackState'), dataIndex: 'ackState', - align: 'center', - customRender(opt) { - let ackState: any = { - 0: '未确认', - 1: '已确认', - }; - if (ackState[opt.value]) { - return ackState[opt.value]; - } - return opt.value; - }, + key: 'ackState', + align: 'left', width: 5, }, { title: t('views.faultManage.activeAlarm.ackUser'), dataIndex: 'ackUser', - align: 'center', + align: 'left', width: 5, }, { @@ -246,9 +234,6 @@ let tableColumns: ColumnsType = [ }, ]; -// //监听点击的是升序还是降序,还是取消排序 -// const change= (pagination, filters, sorter) => {console.log(sorter)} - /**帮助文档表格字段列 */ let alarmTableColumns: ColumnsType = [ { @@ -346,52 +331,6 @@ 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.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' }, - ], - clearType: [ - { label: '告警未清除', value: 0 }, - { label: '自动清除', value: 1 }, - { label: '手动清除', value: 2 }, - ], - ackState: [ - { label: '未确认', value: 0 }, - { label: '已确认', value: 1 }, - ], -}); - /**对话框对象信息状态类型 */ type ModalStateType = { /**详情框是否显示 */ @@ -408,8 +347,6 @@ type ModalStateType = { from: Record; /**表单数据 */ showSetFrom: Record; - // /**表单数据 */ - // myselfSetFrom: Record; /**确定按钮 loading */ confirmLoading: boolean; }; @@ -466,7 +403,11 @@ let modalState: ModalStateType = reactive({ */ function fnModalVisibleByVive(row: Record) { modalState.from = Object.assign(modalState.from, row); - modalState.title = t('views.faultManage.activeAlarm.viewIdInfo',{alarmId:row.alarmId}); + modalState.from.clearType = `${modalState.from.clearType}`; + modalState.from.ackState = `${modalState.from.ackState}`; + modalState.title = t('views.faultManage.activeAlarm.viewIdInfo', { + alarmId: row.alarmId, + }); modalState.visibleByView = true; } @@ -672,7 +613,7 @@ function fnShowSet() { ? JSON.parse(res.data.data[0]['config'][0].value_json) : {}; modalState.showSetFrom = Object.assign(modalState.showSetFrom, realJson); - modalState.title = t('views.faultManage.activeAlarm.showSet'); + modalState.title = t('views.faultManage.activeAlarm.showSet'); modalState.visibleByShowSet = true; } else { message.error(t('common.getInfoFail'), 2); @@ -693,7 +634,7 @@ function fnExportAll() { exportAll(queryParams).then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: t('common.msgSuccess', { msg: t('common.export') }), + content: t('common.msgSuccess', { msg: t('common.export') }), key, duration: 3, }); @@ -711,6 +652,7 @@ function fnExportAll() { }, }); } + /** * 对话框弹出关闭执行函数 * 进行表达规则校验 @@ -725,7 +667,7 @@ function fnModalCancel() { function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; - if(pageNum){ + if (pageNum) { queryParams.pageNum = pageNum; } if (!queryRangePicker.value) { @@ -759,6 +701,26 @@ function fnGetList(pageNum?: number) { const profile = useUserStore().profile; onMounted(() => { + // 初始字典数据 + Promise.allSettled([ + getDict('active_alarm_type'), + getDict('active_clear_type'), + getDict('active_ack_state'), + getDict('active_alarm_severity'), + ]).then(resArr => { + if (resArr[0].status === 'fulfilled') { + dict.activeAlarmType = resArr[0].value; + } + if (resArr[1].status === 'fulfilled') { + dict.activeClearType = resArr[1].value; + } + if (resArr[2].status === 'fulfilled') { + dict.activeAckState = resArr[2].value; + } + if (resArr[3].status === 'fulfilled') { + dict.activeAlarmSeverity = resArr[3].value; + } + }); fnGetList(); }); @@ -774,21 +736,11 @@ onMounted(() => { - - + @@ -796,10 +748,7 @@ onMounted(() => { :label="t('views.faultManage.activeAlarm.neName')" name="ne_name" > - + @@ -807,10 +756,7 @@ onMounted(() => { :label="t('views.faultManage.activeAlarm.neId')" name="ne_id" > - + @@ -848,10 +794,9 @@ onMounted(() => { > @@ -878,13 +823,12 @@ onMounted(() => { > - @@ -894,9 +838,8 @@ onMounted(() => { > @@ -979,15 +922,15 @@ onMounted(() => { :selected-keys="[tableState.size as string]" @click="fnTableSize" > - {{ - t('common.size.default') - }} - {{ - t('common.size.middle') - }} - {{ - t('common.size.small') - }} + + {{ t('common.size.default') }} + + + {{ t('common.size.middle') }} + + + {{ t('common.size.small') }} + @@ -995,27 +938,6 @@ onMounted(() => { -
- - - - -
- { onChange: onSelectChange, }" :pagination="tablePagination" - :scroll="{ x: 2000, y: 400 }" + :scroll="{ x: 2500, y: 400 }" >