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: 'enableRules', }, ]; const mockData = ref(data.listData); export const notificationtableConfig = (el) => { 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, '联系方式'); }, }, ], }, formConfig: { schemas: [ { field: 'name', label: '告警类型', component: 'NsSelect', componentProps: { placeholder: '请选告警类型', options: [ { label: '设备告警', value: '1', }, { label: '网关告警', value: '2', }, { label: '能耗告警', value: '3', }, ], }, }, { field: 'provider', label: '告警优先级', component: 'NsSelect', componentProps: { placeholder: '请选择告警优先级', options: [ { label: '紧急', value: '1', }, { label: '重要', value: '1', }, { label: '一般', value: '2', }, ], }, }, { field: 'provider', label: '告警标题', component: 'NsInput', componentProps: { placeholder: '请输入告警标题关键字', }, }, { field: 'provider', label: '错误码', component: 'NsInput', componentProps: { placeholder: '请输入告警错误码', }, }, { field: 'payWay', label: '启用状态', component: 'NsSelect', componentProps: { placeholder: '请选择启用状态', options: [ { label: '启用', value: '1', }, { label: '关闭', value: '0', }, ], }, }, ], }, // pagination: { pageSizeOptions: false }, rowKey: 'id', }; };