---活动告警,历史告警,故障通用设置

This commit is contained in:
lai
2023-10-08 11:52:24 +08:00
parent fd37866dd4
commit 7e723d0440
6 changed files with 2011 additions and 15 deletions

View File

@@ -16,9 +16,12 @@ import {
clearAlarm,
showPass,
getPass,
exportAll
} from '@/api/faultManage/actAlarm';
import useNeInfoStore from '@/store/modules/neinfo';
import useI18n from '@/hooks/useI18n';
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 { t } = useI18n();
@@ -145,7 +148,7 @@ let tableColumns: ColumnsType = [
{
title: t('views.faultManage.activeAlarm.origLevel'),
align: 'center',
key:'origSeverity',
key: 'origSeverity',
},
{
title: t('views.faultManage.activeAlarm.alarmCode'),
@@ -161,6 +164,7 @@ let tableColumns: ColumnsType = [
title: t('views.faultManage.activeAlarm.eventTime'),
dataIndex: 'eventTime',
align: 'center',
sorter: true,
},
{
title: t('views.faultManage.activeAlarm.alarmType'),
@@ -194,11 +198,32 @@ let tableColumns: ColumnsType = [
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;
},
},
{
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;
},
},
{
title: t('views.faultManage.activeAlarm.ackUser'),
@@ -212,6 +237,9 @@ let tableColumns: ColumnsType = [
},
];
// //监听点击的是升序还是降序,还是取消排序
// const change= (pagination, filters, sorter) => {console.log(sorter)}
/**帮助文档表格字段列 */
let alarmTableColumns: ColumnsType = [
{
@@ -368,12 +396,16 @@ type ModalStateType = {
visibleByEdit: boolean;
/**显示过滤设置是否显示 */
visibleByShowSet: boolean;
/**个性化设置置是否显示 */
visibleByMyselfSet: boolean;
/**标题 */
title: string;
/**表单数据 */
from: Record<string, any>;
/**表单数据 */
showSetFrom: Record<string, any>;
// /**表单数据 */
// myselfSetFrom: Record<string, any>;
/**确定按钮 loading */
confirmLoading: boolean;
};
@@ -383,6 +415,7 @@ let modalState: ModalStateType = reactive({
visibleByView: false,
visibleByEdit: false,
visibleByShowSet: false,
visibleByMyselfSet: false,
title: '全部信息',
from: {
alarmId: '',
@@ -417,6 +450,9 @@ let modalState: ModalStateType = reactive({
alarm_code: '',
pv_flag: '',
},
// myselfSetFrom:{
// }
confirmLoading: false,
});
@@ -541,7 +577,7 @@ const onSelectChange = (
};
/**
* 选中行后的取消确认
* 选中行后的取消确认告警
*/
function fnCancelConfirm() {
Modal.confirm({
@@ -642,6 +678,34 @@ function fnShowSet() {
}
});
}
/**
* 导出全部
*/
function fnExportAll(){
const key = 'exportAlarm';
message.loading({ content: '请稍等...', key });
exportAll(queryParams)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `已完成导出`,
key,
duration: 3,
});
writeSheet(res.data, 'alarm').then(fileBlob =>
saveAs(fileBlob, `alarm_${Date.now()}.xlsx`)
);
} else {
message.error({
content: `${res.msg}`,
key,
duration: 3,
});
}
})
}
/**
* 对话框弹出关闭执行函数
* 进行表达规则校验
@@ -874,6 +938,11 @@ onMounted(() => {
<template #icon> <SettingOutlined /> </template>
{{ t('views.faultManage.activeAlarm.disPlayFilfter') }}
</a-button>
<a-button type="primary" @click.prevent="fnExportAll()">
<template #icon> <export-outlined /> </template>
{{ t('views.faultManage.activeAlarm.exportAll') }}
</a-button>
</a-space>
</template>
@@ -960,7 +1029,9 @@ onMounted(() => {
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'origSeverity'">
<a-tag :color="profile.color[record.origSeverity]">{{record.origSeverity}}</a-tag>
<a-tag :color="profile.color[record.origSeverity]">{{
record.origSeverity
}}</a-tag>
</template>
<template v-if="column.key === 'alarm_id'">
<a-space :size="8" align="center">
@@ -1328,7 +1399,7 @@ onMounted(() => {
</a-form>
</a-modal>
<!-- 显示过滤 -->
<!-- 显示过滤 -->
<a-modal
width="800px"
:keyboard="false"
@@ -1422,6 +1493,101 @@ onMounted(() => {
</a-row>
</a-form>
</a-modal>
<!-- 个性化设置框 -->
<a-modal
width="800px"
:keyboard="false"
:mask-closable="false"
:visible="modalState.visibleByMyselfSet"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
@ok="fnShowModalOk"
ok-text="设置"
@cancel="fnModalCancel"
>
<a-form name="modalStateShowFrom" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.neType')"
name="neType"
>
<a-input
v-model:value="modalState.showSetFrom.ne_type"
allow-clear
>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.neId')"
name="ackState"
>
<a-input v-model:value="modalState.showSetFrom.ne_id" allow-clear>
</a-input>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.pvFlag')"
name="neType"
>
<a-select
v-model:value="modalState.showSetFrom.pv_flag"
style="width: 100%"
allow-clear
:options="actAlarmOption.pvFlag"
/>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.alarmType')"
name="ackState"
>
<a-select
v-model:value="modalState.showSetFrom.alarm_type"
style="width: 100%"
allow-clear
:options="actAlarmOption.alarmType"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.origLevel')"
name="neType"
>
<a-select
v-model:value="modalState.showSetFrom.orig_severity"
style="width: 100%"
allow-clear
:options="actAlarmOption.origSeverity"
/>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.alarmCode')"
name="alarmCode"
>
<a-input
v-model:value="modalState.showSetFrom.alarm_code"
allow-clear
>
</a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</PageContainer>
</template>