You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
161 lines
3.6 KiB
161 lines
3.6 KiB
9 months ago
|
import { dateUtil } from '/nerv-lib/util/date-util';
|
||
|
import data from '../notificationManagementMock.json';
|
||
|
import { http } from '/nerv-lib/util';
|
||
|
import { ref } from 'vue';
|
||
|
const tableKeyMap = [
|
||
|
{
|
||
|
title: '序号',
|
||
|
dataIndex: 'address',
|
||
|
customRender: (text: any) => {
|
||
|
return text.index + 1;
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
title: '优先级',
|
||
|
dataIndex: 'id',
|
||
|
},
|
||
|
{
|
||
|
title: '告警类型',
|
||
|
dataIndex: 'deviceCode',
|
||
|
},
|
||
|
{
|
||
|
title: '告警标题',
|
||
|
dataIndex: 'deviceName',
|
||
|
},
|
||
|
{
|
||
|
title: '错误码',
|
||
|
dataIndex: 'position',
|
||
|
},
|
||
|
{
|
||
|
title: '通知名单',
|
||
|
dataIndex: 'position',
|
||
|
textEllipsis: true,
|
||
|
},
|
||
|
{
|
||
|
title: '通知方式',
|
||
|
dataIndex: 'position',
|
||
|
},
|
||
|
{
|
||
|
title: '启用通知',
|
||
|
dataIndex: 'isUse',
|
||
|
},
|
||
|
];
|
||
|
const mockData = ref(data.listData);
|
||
|
export const notificationtableConfig = (el, elGroup, elFormula) => {
|
||
|
return {
|
||
|
title: '告警规则',
|
||
|
// api: '/carbon_emission/device/getDeviceList',
|
||
|
value: mockData.value,
|
||
|
headerActions: [{}],
|
||
|
columns: tableKeyMap,
|
||
|
// rowSelection: null, 选择按钮
|
||
|
columnActions: {
|
||
|
title: '操作',
|
||
|
actions: [
|
||
|
{
|
||
|
label: '联系方式',
|
||
|
name: 'FeedBackDetail',
|
||
|
dynamicParams: ['uuid', 'appealType'],
|
||
|
handle: (data: any) => {
|
||
|
console.log(data, '联系方式');
|
||
|
},
|
||
|
},
|
||
|
// {
|
||
|
// label: '删除',
|
||
|
// name: 'FeedBackDetail',
|
||
|
// dynamicParams: ['uuid', 'appealType'],
|
||
|
// confirm: true,
|
||
|
// handle: () => {
|
||
|
// mockData.value.splice(0, 1);
|
||
|
// },
|
||
|
// },
|
||
|
],
|
||
|
},
|
||
|
|
||
|
formConfig: {
|
||
|
schemas: [
|
||
|
{
|
||
|
field: 'name',
|
||
|
label: '告警类型',
|
||
|
component: 'NsSelect',
|
||
|
componentProps: {
|
||
|
placeholder: '请选告警类型',
|
||
|
options: [
|
||
|
{
|
||
|
label: '启用',
|
||
|
value: '1',
|
||
|
},
|
||
|
{
|
||
|
label: '关闭',
|
||
|
value: '0',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'provider',
|
||
|
label: '告警优先级',
|
||
|
component: 'NsSelect',
|
||
|
componentProps: {
|
||
|
placeholder: '请选择告警优先级',
|
||
|
options: [
|
||
|
{
|
||
|
label: '全部',
|
||
|
value: '',
|
||
|
},
|
||
|
{
|
||
|
label: '启用',
|
||
|
value: '1',
|
||
|
},
|
||
|
{
|
||
|
label: '关闭',
|
||
|
value: '0',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'provider',
|
||
|
label: '告警标题',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
placeholder: '请输入告警标题关键字',
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'provider',
|
||
|
label: '告警标题',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
placeholder: '请输入告警标题关键字',
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'payWay',
|
||
|
label: '启用状态',
|
||
|
component: 'NsSelect',
|
||
|
componentProps: {
|
||
|
placeholder: '请选择启用状态',
|
||
|
options: [
|
||
|
{
|
||
|
label: '全部',
|
||
|
value: '',
|
||
|
},
|
||
|
{
|
||
|
label: '启用',
|
||
|
value: '1',
|
||
|
},
|
||
|
{
|
||
|
label: '关闭',
|
||
|
value: '0',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
// pagination: { pageSizeOptions: false },
|
||
|
rowKey: 'id',
|
||
|
};
|
||
|
};
|