add:设备告警网关告警对接 接口

This commit is contained in:
zhaohy
2024-07-23 14:28:49 +08:00
parent 223ceed5eb
commit 7b77c3cc88
16 changed files with 940 additions and 74 deletions

View File

@@ -1,5 +1,14 @@
<template>
<ns-view-list-table v-bind="config" ref="mainRef" />
<ns-view-list-table v-bind="config" ref="mainRef">
<template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'priority'">
{{ record.priority ? record.priority.label : '' }}
</template>
<template v-if="column.dataIndex === 'alarmLogState'">
{{ record.alarmLogState ? record.alarmLogState.label : '' }}
</template>
</template>
</ns-view-list-table>
<!-- 详情页面 -->
<Look ref="look" />
<!-- 状态页面 -->

View File

@@ -13,10 +13,10 @@
<div class="box">
<div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
告警编号20230310001
告警编号{{ infoObject.alarmCode }}
</div>
<div style="right: 20px; position: absolute; height: 35px; line-height: 35px">
2024-03-10 15:08:10
{{ infoObject.updateTime }}
</div>
</div>
<!-- center -->
@@ -26,12 +26,20 @@
<!-- bottom -->
<div style="width: 100%; margin-top: 10px">
<a-descriptions :column="1" bordered>
<a-descriptions-item label="优先级">紧急</a-descriptions-item>
<a-descriptions-item label="状态">新告警</a-descriptions-item>
<a-descriptions-item label="错误码">C003</a-descriptions-item>
<a-descriptions-item label="告警描述">网关心跳包丢失</a-descriptions-item>
<a-descriptions-item label="设备信息">1号网关_Di23j596_0001 </a-descriptions-item>
<a-descriptions-item label="重复次数"> 0 </a-descriptions-item>
<a-descriptions-item label="优先级">{{
infoObject.priority ? infoObject.priority.label : ''
}}</a-descriptions-item>
<a-descriptions-item label="状态">{{
infoObject.alarmLogState ? infoObject.alarmLogState.label : ''
}}</a-descriptions-item>
<a-descriptions-item label="错误码">{{ infoObject.errorCode }}</a-descriptions-item>
<a-descriptions-item label="告警描述">{{
infoObject.alarmDescription
}}</a-descriptions-item>
<a-descriptions-item label="设备信息">{{ infoObject.deviceInfo }} </a-descriptions-item>
<a-descriptions-item label="断往时长">
{{ infoObject.durationOfNetworkDisconnection }}</a-descriptions-item
>
</a-descriptions>
</div>
</div>
@@ -49,16 +57,35 @@
let chartInstance: echarts.ECharts | null = null;
const graphChart = ref(null);
const infoObject = ref({
alarmCode: null,
updateTime: null,
priority: null,
alarmLogState: null,
errorCode: null,
alarmDescription: null,
deviceInfo: null,
durationOfNetworkDisconnection: null,
});
const visible = ref(false);
const handleClose = () => {
visible.value = false;
infoObject.value = {
alarmCode: null,
updateTime: null,
priority: null,
alarmLogState: null,
errorCode: null,
alarmDescription: null,
deviceInfo: null,
durationOfNetworkDisconnection: null,
};
};
const btnClick = () => {
console.log('btnClick');
handleClose();
};
const toggle = (data: any) => {
console.log(data, 'data');
infoObject.value = { ...data };
visible.value = true;
setTimeout(() => {
getChatr();

View File

@@ -1,7 +1,4 @@
import { dateUtil } from '/nerv-lib/util/date-util';
import data from '../notificationManagementMock.json';
import { http } from '/nerv-lib/util';
import { ref } from 'vue';
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
const tableKeyMap = [
{
title: '序号',
@@ -12,44 +9,41 @@ const tableKeyMap = [
},
{
title: '告警编号',
dataIndex: 'id',
dataIndex: 'alarmCode',
},
{
title: '告警描述',
dataIndex: 'deviceCode',
dataIndex: 'alarmDescription',
},
{
title: '优先级',
dataIndex: 'deviceName',
dataIndex: 'priority',
},
{
title: '状态',
dataIndex: 'position',
dataIndex: 'alarmLogState',
},
{
title: '错误码',
dataIndex: 'position',
textEllipsis: true,
dataIndex: 'errorCode',
},
{
title: '设备信息',
dataIndex: 'position',
dataIndex: 'deviceInfo',
},
{
title: '更新时间',
dataIndex: 'enableRules',
dataIndex: 'updateTime',
},
{
title: '断网时长',
dataIndex: 'enableRules',
dataIndex: 'durationOfNetworkDisconnection',
},
];
const mockData = ref(data.listData);
export const notificationtableConfig = (look: any, status: any) => {
return {
title: '告警记录',
// api: '/carbon_emission/device/getDeviceList',
value: mockData.value,
api: gatewayAlarmApi.getTableList,
headerActions: [{}],
columns: tableKeyMap,
// rowSelection: null, 选择按钮
@@ -78,56 +72,57 @@ export const notificationtableConfig = (look: any, status: any) => {
formConfig: {
schemas: [
// {
// field: 'name',
// label: '告警类型',
// component: 'NsSelect',
// defaultValue: '2',
// componentProps: {
// placeholder: '请选择告警优先级',
// disabled: true, // 不可选择
// options: [
// {
// label: '紧急',
// value: '1',
// },
// {
// label: '重要',
// value: '2',
// },
// {
// label: '一般',
// value: '3',
// },
// ],
// },
// },
{
field: 'name',
label: '告警类型',
component: 'NsSelect',
defaultValue: '2',
componentProps: {
placeholder: '请选择告警优先级',
disabled: true,
options: [
{
label: '紧急',
value: '1',
},
{
label: '重要',
value: '2',
},
{
label: '一般',
value: '3',
},
],
},
},
{
field: 'provider',
field: 'alarmLogState',
label: '状态',
component: 'NsSelect',
componentProps: {
placeholder: '请选择状态',
allowClear: true,
options: [
{
label: '待处理',
value: '1',
value: 1,
},
{
label: '处理中',
value: '2',
value: 2,
},
{
label: '已完成',
value: '3',
value: 3,
},
{
label: '超时',
value: '4',
value: 4,
},
{
label: '关闭',
value: '5',
value: 5,
},
],
},
@@ -136,7 +131,7 @@ export const notificationtableConfig = (look: any, status: any) => {
field: 'createTime',
label: '数据日期',
component: 'NsRangePicker',
fieldMap: ['manufactureBeginDate', 'manufactureEndDate'],
fieldMap: ['startTime', 'endTime'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
placeholder: ['开始日期', '结束日期'],