fix:对接通知管理接口 进行联调测试

This commit is contained in:
zhaohy
2024-07-18 13:50:09 +08:00
parent f915dab012
commit 652a94a466
9 changed files with 213 additions and 154 deletions

View File

@@ -1,7 +1,8 @@
import { dateUtil } from '/nerv-lib/util/date-util';
import data from '../notificationManagementMock.json';
import { http } from '/nerv-lib/util';
import { notificationManagementApi } from '/@/api/alarmSettings/notificationManagements';
import { ref } from 'vue';
const tableKeyMap = [
{
title: '序号',
@@ -12,43 +13,41 @@ const tableKeyMap = [
},
{
title: '优先级',
dataIndex: 'id',
dataIndex: 'prioritys',
},
{
title: '告警类型',
dataIndex: 'deviceCode',
dataIndex: 'alarmTypeName',
},
{
title: '告警标题',
dataIndex: 'deviceName',
dataIndex: 'alarmTitle',
},
{
title: '错误码',
dataIndex: 'position',
dataIndex: 'errorCode',
},
{
title: '通知名单',
dataIndex: 'position',
dataIndex: 'notificationList',
width: 150,
textEllipsis: true,
},
{
title: '通知方式',
dataIndex: 'position',
dataIndex: 'notificationMethod',
},
{
title: '启用通知',
dataIndex: 'enableRules',
dataIndex: 'enableNotifications',
},
];
const mockData = ref(data.listData);
export const notificationtableConfig = (notificationManagements: any) => {
return {
title: '告警规则',
// api: '/carbon_emission/device/getDeviceList',
value: mockData.value,
headerActions: [{}],
api: notificationManagementApi.getTableList,
headerActions: [],
columns: tableKeyMap,
// rowSelection: null, 选择按钮
columnActions: {
title: '操作',
actions: [
@@ -66,70 +65,75 @@ export const notificationtableConfig = (notificationManagements: any) => {
formConfig: {
schemas: [
{
field: 'name',
field: 'alarmType',
label: '告警类型',
component: 'NsSelect',
componentProps: {
placeholder: '请选告警类型',
allowClear: true,
options: [
{
label: '设备告警',
value: '1',
value: 1,
},
{
label: '网关告警',
value: '2',
value: 2,
},
{
label: '能耗告警',
value: '3',
value: 3,
},
],
},
},
{
field: 'provider',
field: 'priority',
label: '告警优先级',
component: 'NsSelect',
componentProps: {
placeholder: '请选择告警优先级',
allowClear: true,
options: [
{
label: '紧急',
value: '1',
value: 1,
},
{
label: '重要',
value: '1',
value: 2,
},
{
label: '一般',
value: '2',
value: 3,
},
],
},
},
{
field: 'provider',
field: 'alarmTitle',
label: '告警标题',
component: 'NsInput',
componentProps: {
allowClear: true,
placeholder: '请输入告警标题关键字',
},
},
{
field: 'provider',
field: 'errorCode',
label: '错误码',
component: 'NsInput',
componentProps: {
allowClear: true,
placeholder: '请输入告警错误码',
},
},
{
field: 'payWay',
field: 'enableNotifications',
label: '启用状态',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择启用状态',
options: [
{