Browse Source

add:配置设备告警对接接口 对接告警配置 里面的数据来源 设备节点

temp
zhaohy 5 months ago
parent
commit
de7a0ab88a
  1. 6
      hx-ai-intelligent/src/api/alarmSettings/deviceAlarms.ts
  2. 54
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue
  3. 342
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  4. 50
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  5. 121
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  6. 254
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  7. 20
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  8. 89
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  9. 246
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue
  10. 6
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  11. 4
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts

6
hx-ai-intelligent/src/api/alarmSettings/deviceAlarms.ts

@ -1,5 +1,9 @@
export enum deviceAlarms { export enum deviceAlarms {
getTableList = '/carbon-smart/api/AlarmEquipment/selectAlarmEquipment', //设备告警分页 getTableList = '/carbon-smart/api/AlarmEquipment/selectAlarmEquipment', //设备告警分页
addOrUpNewData = '/carbon-smart/api/AlarmEquipment/creatOrUpdate', //设备告警添加 修 addOrUpNewData = '/carbon-smart/api/AlarmEquipment/creatOrUpdate', //设备告警添加 修
del = '/carbon-smart/api/AlarmEquipment/delete', //设备告警删除 del = '/carbon-smart/api/AlarmEquipment/delete', //设备告警删除
configGetTableList = '/carbon-smart/api/AlarmEquipmentRule/selectAlarmEquipmentRule', //配置设备告警分页
configAddOrUpNewData = '/carbon-smart/api/AlarmEquipmentRule/creatOrUpdate', //配置设备告警添加 修改
configFindById = '/carbon-smart/api/AlarmEquipmentRule/findById', //配置设备告警 查询详情
configDel = '/carbon-smart/api/AlarmEquipmentRule/delete', //配置设备告警删除
} }

54
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue

@ -31,18 +31,23 @@
import editConfigureEnergyAlarm from './editConfigureEnergyAlarm.vue'; import editConfigureEnergyAlarm from './editConfigureEnergyAlarm.vue';
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { device } from '/@/api/deviceManage';
export default { export default {
components: { editConfigureEnergyAlarm }, components: { editConfigureEnergyAlarm },
setup() { setup() {
// //
const configureDeviceAlarmsData = ref({}); const configureEnergyAlarmsData = ref({});
const show = ref(false); const show = ref(false);
const tableConfig = ref({}); const tableConfig = ref({});
const mainRef = ref({}); const mainRef = ref({});
const editConfigureEnergyAlarms = ref({}); const editConfigureEnergyAlarms = ref({});
const mockData = ref(data.listData); const mockData = ref(data.listData);
//
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const clickSwitch = (data: any) => { const clickSwitch = (data: any) => {
NsModal.confirm({ NsModal.confirm({
title: '启用状态', title: '启用状态',
@ -71,7 +76,7 @@
a.click(); a.click();
}; };
const setconfigureDeviceAlarmsData = (value: any) => { const setconfigureDeviceAlarmsData = (value: any) => {
configureDeviceAlarmsData.value = value; configureEnergyAlarmsData.value = value;
show.value = true; show.value = true;
tableConfig.value = { tableConfig.value = {
title: '告警规则', title: '告警规则',
@ -83,7 +88,7 @@
name: 'RoleTypeAdd', name: 'RoleTypeAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
editConfigureEnergyAlarms.value.toggle(); editConfigureEnergyAlarms.value.toggle(null, configureEnergyAlarmsData.value.va);
}, },
}, },
{ {
@ -172,7 +177,7 @@
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
editConfigureEnergyAlarms.value.toggle(data); editConfigureEnergyAlarms.value.toggle(data, configureEnergyAlarmsData.value);
}, },
}, },
{ {
@ -190,29 +195,37 @@
title: value.errorCode, title: value.errorCode,
schemas: [ schemas: [
{ {
field: 'provider', field: 'deviceName',
label: '设备名称', label: '设备名称',
component: 'NsInput', component: 'nsSelectApi',
componentProps: { componentProps: {
placeholder: '请输入设备名称', api: device.queryDevicePage,
params: {
orgId: orgId.value,
pageNum: 1,
pageSize: 99,
},
placeholder: '请选择设备名称',
resultField: 'data.records',
labelField: 'deviceName',
valueField: 'id',
autoAddLink: true, //
}, },
}, },
{ {
field: 'provider', field: 'devicePoint',
label: '设备点位', label: '设备点位',
component: 'nsSelectApi', component: 'nsSelectApi',
dynamicParams: {
id: 'deviceName', //
},
componentProps: { componentProps: {
api: '/api/community/objs/DictItem', api: device.queryDevicePoint,
params: {
pageSize: 100,
code: 'MZ',
},
placeholder: '请选择设备点位',
resultField: 'data', resultField: 'data',
labelField: 'dictName', placeholder: '请选择设备点位',
valueField: 'dictValue', labelField: 'code',
immediate: true, valueField: 'id',
autoSelectFirst: false, dependency: 'deviceName',
}, },
}, },
{ {
@ -249,10 +262,11 @@
}; };
}; };
return { return {
configureDeviceAlarmsData, configureEnergyAlarmsData,
show, show,
clickSwitch, clickSwitch,
doWnload, doWnload,
orgId,
tableConfig, tableConfig,
editConfigureEnergyAlarms, editConfigureEnergyAlarms,
setconfigureDeviceAlarmsData, setconfigureDeviceAlarmsData,

342
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue

@ -6,6 +6,7 @@
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
@close="handleClose"
placement="right"> placement="right">
<div style="padding: 18px; width: 100%; overflow: hidden"> <div style="padding: 18px; width: 100%; overflow: hidden">
<a-form ref="formRef" :model="infoObject" :rules="rules"> <a-form ref="formRef" :model="infoObject" :rules="rules">
@ -18,41 +19,54 @@
placeholder="请选择站点" placeholder="请选择站点"
allow-clear allow-clear
tree-default-expand-all tree-default-expand-all
:tree-data="zdTreeData" :tree-data="siteDataTree"
tree-node-filter-prop="label"> :field-names="{
<!-- 特殊处理情况 --> children: 'linkList',
<!-- <template #title="{ value: val, label }"> label: 'orgName',
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b> value: 'orgId',
<template v-else>{{ label }}</template> }"
</template> --> tree-node-filter-prop="orgName" />
</a-tree-select>
</a-form-item> </a-form-item>
<a-form-item label="数据来源" name="sbtype"> <a-form-item label="数据来源" name="sbtype">
<a-cascader <a-cascader
v-model:value="infoObject.sbtype" v-model:value="infoObject.sbtype"
:options="sbOptions" :options="deviceTypeTreeData"
:show-search="{ filter }" :field-names="{
children: 'children',
label: 'cnValue',
value: 'id',
}"
:show-search="{ filterDeviceType }"
@change="selectDeviceType"
placeholder="请选择数据来源" /> placeholder="请选择数据来源" />
</a-form-item> </a-form-item>
<a-form-item label="设备节点" name="jdDevice"> <a-form-item label="设备/节点" name="jdDevice">
<a-tree-select <a-tree-select
v-model:value="infoObject.jdDevice" v-model:value="infoObject.jdDevice"
style="width: 100%" style="width: 100%"
placeholder="请选择设备节点" placeholder="请选择设备节点"
:disabled="!infoObject.sbtype"
:tree-line="true && { showLeafIcon: false }" :tree-line="true && { showLeafIcon: false }"
:tree-data="jdTreeData" /> :tree-data="jdTreeData"
:field-names="{
children: 'children',
label: infoObject.sbtype && infoObject.sbtype[1] === 1 ? 'deviceName' : 'pointName',
value: 'id',
}"
@select="selectJdDeviceChange" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则" name="delivery"> <a-form-item label="启用规则" name="enableRules">
<a-switch <a-switch
v-model:checked="infoObject.delivery" :checked="infoObject.enableRules === 1 ? true : false"
:class="{ :class="{
'blue-background': infoObject.delivery, 'blue-background': infoObject.enableRules === 1 ? true : false,
'grey-background': !infoObject.delivery, 'grey-background': infoObject.enableRules === 1 ? false : true,
}" /> }"
@click="clickSwitch" />
</a-form-item> </a-form-item>
<a-form-item label="异常描述" name="desc"> <a-form-item label="异常描述" name="abnormalDescription">
<a-textarea <a-textarea
v-model:value="infoObject.desc" v-model:value="infoObject.abnormalDescription"
style="height: 32px" style="height: 32px"
:autoSize="{ minRows: 1, maxRows: 1 }" :autoSize="{ minRows: 1, maxRows: 1 }"
show-count show-count
@ -64,11 +78,12 @@
<a-radio value="2"> (or) </a-radio> <a-radio value="2"> (or) </a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="对比类型1" name="qzType"> <a-form-item label="对比类型" name="qzType">
<a-cascader <a-cascader
v-model:value="infoObject.sbtype" v-model:value="infoObject.sbtype"
:options="sbOptions" :options="deviceTypeTreeData"
placeholder="请选择数据来源" /> :showSearch="false"
placeholder="请选择对比类型" />
</a-form-item> </a-form-item>
<template v-for="index in infoObject.alarmList?.length" :key="index"> <template v-for="index in infoObject.alarmList?.length" :key="index">
<div style="width: 100%; display: flex; margin-left: 42px; padding: 12px"> <div style="width: 100%; display: flex; margin-left: 42px; padding: 12px">
@ -93,8 +108,8 @@
</div> </div>
<div <div
v-if=" v-if="
infoObject.alarmList[index - 1].num === null || infoObject.alarmList[index - 1]?.num === null ||
infoObject.alarmList[index - 1].logic === null infoObject.alarmList[index - 1]?.logic === null
" "
style="width: 100%; color: #ff4d4f; text-align: center; margin-bottom: 5px"> style="width: 100%; color: #ff4d4f; text-align: center; margin-bottom: 5px">
请选择正确的逻辑{{ index }} 输入正确的数值{{ index }} 请选择正确的逻辑{{ index }} 输入正确的数值{{ index }}
@ -114,121 +129,88 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { ref, toRaw } from 'vue'; import { ref } from 'vue';
import type { CascaderProps, TreeSelectProps, SelectProps } from 'ant-design-vue'; import type { SelectProps } from 'ant-design-vue';
import type { ShowSearchType } from 'ant-design-vue/es/cascader'; import type { ShowSearchType } from 'ant-design-vue/es/cascader';
import { device } from '/@/api/deviceManage'; import { device, group } from '/@/api/deviceManage';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { dict } from '/@/api';
import { async } from '@antv/x6/lib/registry/marker/async';
import type { Rule } from 'ant-design-vue/es/form'; // import type { Rule } from 'ant-design-vue/es/form';
const visible = ref(false); const visible = ref(false);
//
const energyAlarm = ref({});
//
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
// //
const infoObject = ref({ const infoObject = ref({
id: null, id: null,
site: null, site: null,
jdDevice: null, jdDevice: null,
resource: null, resource: null,
desc: null, abnormalDescription: null,
sbtype: null, sbtype: null,
delivery: null, enableRules: 0,
alarmList: [{ logic: null, num: null }], alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
}); });
// //
const delAlarmList = ref([]); const delAlarmList = ref([]);
const formRef = ref(); const formRef = ref();
// //
const zdTreeData = ref<TreeSelectProps['treeData']>([ const siteDataTree = ref([]);
{ //
label: '铁路总局(T01)', let deviceTypeTreeData = ref([]);
value: 'T01',
children: [
{
label: '济阳站(T0101)',
value: 'T0101',
},
],
},
]);
//
const sbOptions: CascaderProps['options'] = [
{
value: '3',
label: '3.电梯',
children: [
{
value: '301',
label: '301.扶梯',
},
{
value: '302',
label: '301.直梯',
},
],
},
{
value: '4',
label: '4.冷热源',
children: [
{
value: '401',
label: '402.冷水机组',
},
{
value: '402',
label: '403.热泵机组',
},
{
value: '403',
label: '403.锅炉',
},
{
value: '404',
label: '404.水处理机组',
},
{
value: '405',
label: '405.板式热交换机组',
},
],
},
];
// //
const jdTreeData = ref([ const jdTreeData = ref([]);
{ //
title: 'parent 1', //
value: 'parent 1', const selectDeviceType = async (value: any, selectedOptions: any) => {
children: [ if (value[value.length - 1] === 1) {
{ //
title: 'parent 1-0', await http
value: 'parent 1-0', .post(device.queryDevicePage, {
children: [ pageNum: 1,
{ pageSize: 999,
title: 'my leaf', energyType: selectedOptions[0].cnValue,
value: 'leaf1', orgId: orgId.value,
}, })
{ .then((res) => {
title: 'your leaf', jdTreeData.value = res.data.records;
value: 'leaf2', });
}, } else {
], //
}, await http
{ .post(group.queryDeviceGroupTree, {
title: 'parent 1-1', pageNum: 1,
value: 'parent 1-1', pageSize: 999,
}, energyType: selectedOptions[0].cnValue,
], orgId: orgId.value,
}, })
]); .then((res) => {
jdTreeData.value = res.data;
});
}
};
//
const selectJdDeviceChange = (value: any, node: any) => {
console.log(value, 'value');
console.log(node, 'node');
};
// //
const dwOptions = ref<SelectProps['options']>([ const dwOptions = ref<SelectProps['options']>([
{ value: '电压 (U)', label: '电压 (U)', code: '1' }, { value: '电压 (U)', label: '电压 (U)', code: '1' },
{ value: '电流 (I)', label: '电流 (I)', code: '2' }, { value: '电流 (I)', label: '电流 (I)', code: '2' },
{ value: '电流 (I)', label: 'a相电流 (Ia)', code: '3' }, { value: '电流 (I)', label: 'a相电流 (Ia)', code: '3' },
]); ]);
const filter: ShowSearchType['filter'] = (inputValue: any, path: any) => { //
const filterDeviceType: ShowSearchType['filter'] = (inputValue: any, path: any) => {
return path.some( return path.some(
(option: any) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1, (option: any) => option.cnValue.toLowerCase().indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
// //
@ -238,30 +220,17 @@
]); ]);
// //
const ljOptions = ref<SelectProps['options']>([ const ljOptions = ref<SelectProps['options']>([
{ value: '1', label: '≥' }, { value: 0, label: '≥' },
{ value: '2', label: '>' }, { value: 1, label: '>' },
{ value: '3', label: '≤' }, { value: 2, label: '≤' },
{ value: '4', label: '<' }, { value: 3, label: '<' },
{ value: '5', label: '=' }, { value: 4, label: '=' },
]); ]);
// //
const filterOption = (input: string, option: any) => { const filterOption = (input: string, option: any) => {
console.log('搜索', option.value); console.log('搜索', option.value);
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0; return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
}; };
const handleFocus = () => {
console.log('点击');
};
const handleChange = (value: string) => {
console.log(`selected ${value}`);
console.log('选择', infoObject.value.sbAdress);
//code
dwOptions.value.forEach((item) => {
if (item.value === value) {
console.log('符合', item.code);
}
});
};
const handleQzChange = (value: string) => { const handleQzChange = (value: string) => {
//code //code
qzOptions.value.forEach((item) => { qzOptions.value.forEach((item) => {
@ -270,13 +239,39 @@
} }
}); });
}; };
//
const clickSwitch = () => {
if (infoObject.value.enableRules === 1) {
infoObject.value.enableRules = 0;
} else {
infoObject.value.enableRules = 1;
}
};
const emit = defineEmits(['editObject']); const emit = defineEmits(['editObject']);
// //
const toggle = (value: any) => { const toggle = async (value: any, info: any) => {
// //
http.post(device.queryDeviceTree, null).then((res) => { let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
console.log(res, '请求出来的数据'); energyType.data.data.forEach((item: any) => {
NsMessage.success('操作成功'); item.children = [
{
id: 1,
cnValue: '设备',
},
{
id: 2,
cnValue: '节点',
},
];
});
deviceTypeTreeData.value = energyType.data.data;
//
energyAlarm.value = info;
//
http.post('/carbon-smart/user/login/logInInfo', {}).then((res) => {
if (res.msg === 'success') {
siteDataTree.value = res.data.linkList;
}
}); });
// //
if (value) { if (value) {
@ -287,31 +282,40 @@
site: null, site: null,
jdDevice: null, jdDevice: null,
resource: null, resource: null,
desc: null, abnormalDescription: null,
sbtype: null, sbtype: null,
delivery: null, enableRules: 0,
alarmList: [{ logic: null, num: null }], alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
}; };
} }
visible.value = !visible.value; visible.value = !visible.value;
}; };
// //
const rules: Record<string, Rule[]> = { const rules = {
site: [{ required: true, message: '请选择站点', trigger: 'change' }], site: [{ required: true, message: '请选择站点', trigger: 'change' }],
sbtype: [{ required: true, message: '请选择设备类型', trigger: 'change' }], sbtype: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
delivery: [{ required: true, message: '请选择启用规则', trigger: 'change' }], enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }],
jdDevice: [{ required: true, message: '请选择设备名称', trigger: 'change' }], jdDevice: [{ required: true, message: '请选择设备名称', trigger: 'change' }],
sbAdress: [{ required: true, message: '请选择设备点位', trigger: 'change' }], sbAdress: [{ required: true, message: '请选择设备点位', trigger: 'change' }],
qzType: [{ required: true, message: '请选择取值类型', trigger: 'change' }], qzType: [{ required: true, message: '请选择取值类型', trigger: 'change' }],
resource: [{ required: true, message: '请选择规则类型', trigger: 'change' }], resource: [{ required: true, message: '请选择规则类型', trigger: 'change' }],
desc: [{ required: true, message: '请输入异常描述', trigger: 'blur' }], abnormalDescription: [
alarm: [{ required: true, message: '请选择逻辑', trigger: 'blur' }], {
number: [{ required: true, message: '请输入数值', trigger: 'blur' }], required: true,
}; message: '请输入异常描述',
// trigger: 'blur',
const changeSwitch = () => { validator: (rules: any, abnormalDescription: any, cbfn: any) => {
console.log(infoObject.value.selectSwitch, '开关'); if (abnormalDescription.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
logic: [{ required: true, message: '请选择逻辑', trigger: 'blur' }],
num: [{ required: true, message: '请输入数值', trigger: 'blur' }],
}; };
// //
const btnClick = () => { const btnClick = () => {
@ -319,18 +323,26 @@
infoObject.value.alarmList.forEach((item) => { infoObject.value.alarmList.forEach((item) => {
if (item.logic === null || item.num === null) { if (item.logic === null || item.num === null) {
// NsMessage.error('');
return; return;
} }
}); });
if (infoObject.value.alarmList.length < 2) { if (infoObject.value.alarmList.length < 2) {
NsMessage.error('请选择逻辑和数值');
return; return;
} }
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
console.log('values', infoObject, toRaw(infoObject)); let data = { ...infoObject.value };
delAlarmList.value = []; data.hxAlarmRuleLogicList = [...infoObject.value.alarmList, ...delAlarmList.value];
data.hxAlarmRuleLogicList.forEach((item) => {
const num = Number(item.num);
if (!isNaN(num)) {
item.num = Number(num.toFixed(2));
} else {
item.num = 0; // 0
}
});
data.ruleType = Number(data.ruleType);
delete data.alarmList;
}); });
// //
// http // http
@ -354,10 +366,11 @@
id: null, id: null,
site: null, site: null,
resource: null, resource: null,
desc: null, jdDevice: null,
abnormalDescription: null,
sbtype: null, sbtype: null,
delivery: null, enableRules: 0,
alarmList: [{ alarm: null, number: null }], alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
}; };
visible.value = false; visible.value = false;
delAlarmList.value = []; delAlarmList.value = [];
@ -365,17 +378,22 @@
// //
const addAlarmList = () => { const addAlarmList = () => {
if (infoObject.value.alarmList) { if (infoObject.value.alarmList) {
infoObject.value.alarmList.push({ logic: null, num: null }); infoObject.value.alarmList.push({ id: null, logic: null, num: null, isDelete: 0 });
} else { } else {
infoObject.value.alarmList = [{ logic: null, num: null }]; infoObject.value.alarmList = [{ id: null, logic: null, num: null, isDelete: 0 }];
} }
}; };
// //
const deleteAlarmList = (index: number) => { const deleteAlarmList = (index: num) => {
if (infoObject.value.alarmList[index]?.id) { if (index < infoObject.value.alarmList.length && index >= 0) {
delAlarmList.value.push(infoObject.value.alarmList[index]); const alarmItemToDelete = infoObject.value.alarmList[index];
if (alarmItemToDelete?.id) {
// delAlarmList
delAlarmList.value.push({ ...alarmItemToDelete, isDelete: 1 });
}
// infoObject
infoObject.value.alarmList.splice(index, 1);
} }
infoObject.value.alarmList.splice(index, 1);
}; };
defineExpose({ defineExpose({
toggle, toggle,

50
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue

@ -2,11 +2,12 @@
<ns-drawer <ns-drawer
v-model:visible="visible" v-model:visible="visible"
width="520" width="520"
:title="infoObject?.id ? '修改能源告警' : '新增能源告警'" :title="' '"
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
placement="right"> placement="right"
@close="handleClose">
<ns-form ref="formRef" :schemas="schemas" :model="infoObject" formLayout="vertical" /> <ns-form ref="formRef" :schemas="schemas" :model="infoObject" formLayout="vertical" />
<div style="margin-left: 52px"> <div style="margin-left: 52px">
应用规则: 应用规则:
@ -26,6 +27,7 @@
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
// import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; // import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
import { dict } from '/@/api';
const visible = ref(false); const visible = ref(false);
// //
@ -67,6 +69,13 @@
required: true, required: true,
message: '告警标题不能为空', message: '告警标题不能为空',
trigger: 'change', trigger: 'change',
validator: (rules: any, alarmTitle: any, cbfn: any) => {
if (alarmTitle && alarmTitle.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
}, },
], ],
componentProps: { componentProps: {
@ -138,7 +147,7 @@
{ {
field: 'priority', field: 'priority',
label: '监测频率', label: '监测频率',
component: 'NsSelect', component: 'nsSelectApi',
rules: [ rules: [
{ {
required: true, required: true,
@ -147,21 +156,14 @@
}, },
], ],
componentProps: { componentProps: {
allowClear: true, api: () => dict({ params: { dicKey: 'ENERGY_TYPE' } }),
placeholder: '请选择监测频率', // params: { dicKey: 'ENERGY_TYPE' },
componentProps: { immediate: true,
api: '/api/community/objs/DictItem', // resultField: 'data.ENERGY_TYPE',
params: { labelField: 'cnValue',
pageSize: 100, valueField: 'cnValue',
code: 'MZ', placeholder: '请选择能耗种类',
}, autoSelectFirst: true,
placeholder: '请选择设备点位',
resultField: 'data',
labelField: 'dictName',
valueField: 'dictValue',
immediate: true,
autoSelectFirst: false,
},
}, },
}, },
], ],
@ -188,14 +190,22 @@
// visible.value = false; // visible.value = false;
// emit('editObject', null); // emit('editObject', null);
// }); // });
// if (infoObject.value.id) {
// NsMessage.success('');
// } else {
// NsMessage.success('');
// }
}); });
}; };
const handleClose = () => { const handleClose = () => {
// //
formRef.value.formElRef.clearValidate(); formRef.value.formElRef.clearValidate();
console.log(infoObject.value); infoObject.value = {
id: null,
accountNo: null,
enableRules: 0,
};
visible.value = false; visible.value = false;
NsMessage.success('操作成功');
}; };
defineExpose({ defineExpose({
toggle, toggle,

121
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue

@ -11,26 +11,22 @@
}" }"
@click="clickSwitch({ enableRules: record.enableRules, record: record })" /> @click="clickSwitch({ enableRules: record.enableRules, record: record })" />
</template> </template>
<template v-if="column.dataIndex === 'equipmentInfo'"> <!-- <template v-if="column.dataIndex === 'equipmentInfo'">
{{ {{ record.site + '>' + record.deviceType + '>' + record.deviceName }}
record?.enableRules </template> -->
? record.enableRules + '>' + record.deviceType + '>' + record.deviceName
: '-'
}}
</template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<!-- 新增or编辑界面 --> <!-- 新增or编辑界面 -->
<editConfigureDeviceAlarm ref="editConfigureDeviceAlarms" /> <editConfigureDeviceAlarm ref="editConfigureDeviceAlarms" @editObject="editObject" />
</template> </template>
<script lang="ts"> <script lang="ts">
import { ref, createVNode } from 'vue'; import { ref, createVNode } from 'vue';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import data from '../notificationManagementMock.json';
import { NsMessage, NsModal } from '/nerv-lib/component'; import { NsMessage, NsModal } from '/nerv-lib/component';
import editConfigureDeviceAlarm from '../equipmentAlarm/editConfigureDeviceAlarm.vue'; import editConfigureDeviceAlarm from '../equipmentAlarm/editConfigureDeviceAlarm.vue';
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { device } from '/@/api/deviceManage';
export default { export default {
components: { editConfigureDeviceAlarm }, components: { editConfigureDeviceAlarm },
@ -42,7 +38,10 @@
const tableConfig = ref({}); const tableConfig = ref({});
const mainRef = ref({}); const mainRef = ref({});
const editConfigureDeviceAlarms = ref({}); const editConfigureDeviceAlarms = ref({});
const mockData = ref(data.listData); //
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const clickSwitch = (data: any) => { const clickSwitch = (data: any) => {
NsModal.confirm({ NsModal.confirm({
title: '启用状态', title: '启用状态',
@ -50,7 +49,7 @@
content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '吗?', content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '吗?',
onOk: () => { onOk: () => {
http http
.post(deviceAlarms.addOrUpNewData, { .post(deviceAlarms.configAddOrUpNewData, {
id: data.record.id, id: data.record.id,
enableRules: data.record.enableRules === 1 ? 0 : 1, enableRules: data.record.enableRules === 1 ? 0 : 1,
}) })
@ -61,6 +60,10 @@
}, },
}); });
}; };
//
const editObject = () => {
mainRef.value?.nsTableRef.reload();
};
const doWnload = (url: any) => { const doWnload = (url: any) => {
const a = document.createElement('a'); const a = document.createElement('a');
document.body.appendChild(a); document.body.appendChild(a);
@ -75,15 +78,14 @@
show.value = true; show.value = true;
tableConfig.value = { tableConfig.value = {
title: '告警规则', title: '告警规则',
api: deviceAlarms.getTableList, api: deviceAlarms.configGetTableList,
value: mockData.value,
headerActions: [ headerActions: [
{ {
label: '新增', label: '新增',
name: 'RoleTypeAdd', name: 'RoleTypeAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
editConfigureDeviceAlarms.value.toggle(); editConfigureDeviceAlarms.value.toggle(null, configureDeviceAlarmsData.value);
}, },
}, },
{ {
@ -113,16 +115,26 @@
}, },
{ {
label: '批量删除', label: '批量删除',
name: 'groupTemDownload',
type: 'primary', type: 'primary',
name: 'userBatchDel', confirm: true,
dynamicDisabled: (data: any) => { dynamicDisabled: (data: any) => {
return data.list.length === 0; return data.list.length === 0;
}, },
confirm: true, handle: (data: any) => {
isReload: true, let ids = [];
isClearCheck: true, data.list.forEach((item) => {
// api: origanizemanage.batchDel, ids.push(item.id);
dynamicParams: { userIds: 'userId[]' }, });
data.list = [];
http.post(deviceAlarms.configDel, { ids: ids.toString() }).then(() => {
NsMessage.success('告警规则删除成功');
//
mainRef.value.nsTableRef.clearCheck();
//
mainRef.value?.nsTableRef.reload();
});
},
}, },
], ],
columns: [ columns: [
@ -139,20 +151,19 @@
}, },
{ {
title: '设备信息', title: '设备信息',
dataIndex: 'equipmentInfo', dataIndex: 'deviceInfo',
}, },
{ {
title: '告警点位', title: '告警点位',
dataIndex: 'devicePoint', dataIndex: 'devicePointName',
}, },
{ {
title: '判断条件', title: '判断条件',
dataIndex: 'ruleType', dataIndex: 'conditionalJudgment',
}, },
{ {
title: '取值类型', title: '取值类型',
dataIndex: 'valueType', dataIndex: 'valueType',
textEllipsis: true,
}, },
{ {
title: '异常描述', title: '异常描述',
@ -172,7 +183,7 @@
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
editConfigureDeviceAlarms.value.toggle(data); editConfigureDeviceAlarms.value.toggle(data, configureDeviceAlarmsData);
}, },
}, },
{ {
@ -181,8 +192,10 @@
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
confirm: true, confirm: true,
handle: () => { handle: () => {
// mockData.value.splice(0, 1); http.post(deviceAlarms.configDel, { ids: data.id }).then(() => {
console.log(data, 'xxxxxxx'); NsMessage.success('操作成功');
mainRef.value?.nsTableRef.reload();
});
}, },
}, },
], ],
@ -191,60 +204,73 @@
title: value.errorCode, title: value.errorCode,
schemas: [ schemas: [
{ {
field: 'provider', field: 'deviceName',
label: '设备名称', label: '设备名称',
component: 'NsInput', component: 'nsSelectApi',
componentProps: { componentProps: {
placeholder: '请输入设备名称', api: device.queryDevicePage,
allowClear: true,
params: {
orgId: orgId.value,
pageNum: 1,
pageSize: 99,
},
placeholder: '请选择设备点位',
resultField: 'data.records',
labelField: 'deviceName',
valueField: 'id',
autoAddLink: true, //
}, },
}, },
{ {
field: 'provider', field: 'devicePoint',
label: '设备点位', label: '设备点位',
component: 'nsSelectApi', component: 'nsSelectApi',
dynamicParams: {
id: 'deviceName', //
},
componentProps: { componentProps: {
api: '/api/community/objs/DictItem', api: device.queryDevicePoint,
params: { allowClear: true,
pageSize: 100,
code: 'MZ',
},
placeholder: '请选择设备点位',
resultField: 'data', resultField: 'data',
labelField: 'dictName', placeholder: '请选择设备点位',
valueField: 'dictValue', labelField: 'code',
immediate: true, valueField: 'id',
autoSelectFirst: false, dependency: 'deviceName',
}, },
}, },
{ {
field: 'payWay', field: 'enableRules',
label: '启用状态', label: '启用状态',
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选择启用状态', placeholder: '请选择启用状态',
allowClear: true,
options: [ options: [
{ {
label: '启用', label: '启用',
value: '1', value: 1,
}, },
{ {
label: '关闭', label: '关闭',
value: '0', value: 0,
}, },
], ],
}, },
}, },
{ {
field: 'provider', field: 'abnormalDescription',
label: '异常描述', label: '异常描述',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请输入异常描述关键字', placeholder: '请输入异常描述关键字',
}, },
}, },
], ],
}, },
params: { id: value.id }, params: { equipmentAlarmId: value.id },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };
@ -255,6 +281,9 @@
clickSwitch, clickSwitch,
doWnload, doWnload,
tableConfig, tableConfig,
orgId,
mainRef,
editObject,
editConfigureDeviceAlarms, editConfigureDeviceAlarms,
setconfigureDeviceAlarmsData, setconfigureDeviceAlarmsData,
}; };

254
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -6,7 +6,8 @@
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
placement="right"> placement="right"
@close="handleClose">
<div style="padding: 18px; width: 100%; overflow: hidden"> <div style="padding: 18px; width: 100%; overflow: hidden">
<a-form ref="formRef" :model="infoObject" :rules="rules"> <a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="site" label="站点" name="site"> <a-form-item ref="site" label="站点" name="site">
@ -18,8 +19,13 @@
placeholder="请选择站点" placeholder="请选择站点"
allow-clear allow-clear
tree-default-expand-all tree-default-expand-all
:tree-data="zdTreeData" :field-names="{
tree-node-filter-prop="label" /> children: 'linkList',
label: 'orgName',
value: 'orgId',
}"
:tree-data="siteDataTree"
tree-node-filter-prop="orgName" />
</a-form-item> </a-form-item>
<a-form-item label="设备类型" name="deviceType"> <a-form-item label="设备类型" name="deviceType">
<a-cascader <a-cascader
@ -30,7 +36,7 @@
label: 'deviceType', label: 'deviceType',
value: 'id', value: 'id',
}" }"
:show-search="{ filter }" :show-search="{ filterDeviceType }"
@change="selectDeviceType" @change="selectDeviceType"
placeholder="请选择设备类型" /> placeholder="请选择设备类型" />
</a-form-item> </a-form-item>
@ -54,14 +60,12 @@
v-model:value="infoObject.devicePoint" v-model:value="infoObject.devicePoint"
show-search show-search
placeholder="请选择设备点位" placeholder="请选择设备点位"
:disabled="!infoObject?.deviceName"
style="width: 100%" style="width: 100%"
:options="dwOptions" :disabled="!infoObject?.deviceName"
:filter-option="filterOption" :options="devicePointData"
@focus="handleFocus" :filter-option="filterDevicePoint" />
@change="handleChange" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则" name="enableRules"> <a-form-item label="启用规则">
<a-switch <a-switch
:checked="infoObject.enableRules === 1 ? true : false" :checked="infoObject.enableRules === 1 ? true : false"
:class="{ :class="{
@ -73,11 +77,9 @@
<a-form-item label="取值类型" name="valueType"> <a-form-item label="取值类型" name="valueType">
<a-select <a-select
v-model:value="infoObject.valueType" v-model:value="infoObject.valueType"
show-search
placeholder="请选择取值类型" placeholder="请选择取值类型"
style="width: 100%" style="width: 100%"
:options="qzOptions" :options="qzOptions"
:filter-option="filterOption"
@change="handleQzChange" /> @change="handleQzChange" />
</a-form-item> </a-form-item>
<a-form-item label="异常描述" name="abnormalDescription"> <a-form-item label="异常描述" name="abnormalDescription">
@ -107,8 +109,7 @@
<a-select <a-select
v-model:value="infoObject.alarmList[index - 1].logic" v-model:value="infoObject.alarmList[index - 1].logic"
style="width: 70px; margin-left: 12px" style="width: 70px; margin-left: 12px"
:options="ljOptions" :options="ljOptions" />
@change="handleQzChange" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span> <span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input <a-input
style="width: 65px; margin-left: 6px" style="width: 65px; margin-left: 6px"
@ -124,8 +125,8 @@
</div> </div>
<div <div
v-if=" v-if="
infoObject.alarmList[index - 1].num === null || infoObject.alarmList[index - 1]?.num === null ||
infoObject.alarmList[index - 1].logic === null infoObject.alarmList[index - 1]?.logic === null
" "
style="width: 100%; color: #ff4d4f; text-align: center; margin-bottom: 5px"> style="width: 100%; color: #ff4d4f; text-align: center; margin-bottom: 5px">
请选择正确的逻辑{{ index }} 输入正确的数值{{ index }} 请选择正确的逻辑{{ index }} 输入正确的数值{{ index }}
@ -145,19 +146,22 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { ref, toRaw, watch } from 'vue'; import { ref, toRaw } from 'vue';
import type { CascaderProps, TreeSelectProps, SelectProps } from 'ant-design-vue'; import type { SelectProps } from 'ant-design-vue';
import type { ShowSearchType } from 'ant-design-vue/es/cascader'; import type { ShowSearchType } from 'ant-design-vue/es/cascader';
import { device } from '/@/api/deviceManage'; import { device } from '/@/api/deviceManage';
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import type { Rule } from 'ant-design-vue/es/form'; import type { Rule } from 'ant-design-vue/es/form';
import { async } from '@antv/x6/lib/registry/marker/async'; import { async } from '@antv/x6/lib/registry/marker/async';
const visible = ref(false); const visible = ref(false);
//
const equipmentAlarm = ref({});
// //
const infoObject = ref({ const infoObject = ref({
id: null,
site: null, site: null,
ruleType: null, ruleType: null,
abnormalDescription: null, abnormalDescription: null,
@ -166,7 +170,7 @@
valueType: null, valueType: null,
deviceName: null, deviceName: null,
enableRules: 0, enableRules: 0,
alarmList: [{ id: null, alarm: null, number: null, isDelete: '0' }], alarmList: [{ logic: null, num: null, isDelete: 0 }],
}); });
// //
const delAlarmList = ref([]); const delAlarmList = ref([]);
@ -176,18 +180,8 @@
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
// //
const zdTreeData = ref<TreeSelectProps['treeData']>([ const siteDataTree = ref([]);
{
label: '铁路总局(T01)',
value: 'T01',
children: [
{
label: '济阳站(T0101)',
value: 'T0101',
},
],
},
]);
// //
let deviceTypeTreeData = ref([]); let deviceTypeTreeData = ref([]);
// //
@ -216,62 +210,44 @@
}; };
// //
const getDevicePoint = (value: any) => { const getDevicePoint = (value: any) => {
devicePointData.value = [];
http.post(device.queryDevicePoint, value).then((res) => { http.post(device.queryDevicePoint, value).then((res) => {
if (res.msg === 'success') { if (res.msg === 'success') {
console.log(res, '数据'); res.data.forEach((item: any) => {
devicePointData.value.push({
value: item.id,
label: item.code + ' ( ' + item.unit + ' ) ',
});
});
} }
}); });
}; };
// //
const dwOptions = ref<SelectProps['options']>([ const devicePointData = ref([]);
{ value: '电压 (U)', label: '电压 (U)', code: '1' }, //
{ value: '电流 (I)', label: '电流 (I)', code: '2' }, const filterDevicePoint = (input: string, option: any) => {
{ value: '电流 (I)', label: 'a相电流 (Ia)', code: '3' }, return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
]); };
const filter: ShowSearchType['filter'] = (inputValue: any, path: any) => { //
const filterDeviceType: ShowSearchType['filter'] = (inputValue: any, path: any) => {
return path.some( return path.some(
(option: any) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1, (option: any) => option.deviceType.toLowerCase().indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
// //
const qzOptions = ref<SelectProps['options']>([ const qzOptions = ref<SelectProps['options']>([
{ value: '实时值', label: '实时值', code: '1' }, { value: 1, label: '实时值', code: '1' },
{ value: '平均值', label: '平均值', code: '2' }, { value: 2, label: '平均值', code: '2' },
]); ]);
// //
const ljOptions = ref<SelectProps['options']>([ const ljOptions = ref<SelectProps['options']>([
{ value: '1', label: '≥' }, { value: 0, label: '≥' },
{ value: '2', label: '>' }, { value: 1, label: '>' },
{ value: '3', label: '≤' }, { value: 2, label: '≤' },
{ value: '4', label: '<' }, { value: 3, label: '<' },
{ value: '5', label: '=' }, { value: 4, label: '=' },
]); ]);
//
const filterOption = (input: string, option: any) => {
console.log('搜索', option.value);
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
const handleFocus = () => {
console.log('点击');
};
const handleChange = (value: string) => {
console.log(`selected ${value}`);
console.log('选择', infoObject.value.devicePoint);
//code
dwOptions.value.forEach((item) => {
if (item.value === value) {
console.log('符合', item.code);
}
});
};
const handleQzChange = (value: string) => {
//code
qzOptions.value.forEach((item) => {
if (item.value === value) {
console.log('符合', item.code);
}
});
};
// //
const clickSwitch = () => { const clickSwitch = () => {
if (infoObject.value.enableRules === 1) { if (infoObject.value.enableRules === 1) {
@ -313,7 +289,9 @@
return null; // null return null; // null
}; };
// //
const toggle = async (value: any) => { const toggle = async (value: any, info: any) => {
equipmentAlarm.value = info;
// //
await http await http
.post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 }) .post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 })
@ -322,21 +300,36 @@
deviceTypeTreeData.value = res.data; deviceTypeTreeData.value = res.data;
} }
}); });
//
http.post('/carbon-smart/user/login/logInInfo', {}).then((res) => {
if (res.msg === 'success') {
siteDataTree.value = res.data.linkList;
}
});
// //
if (value) { if (value) {
infoObject.value = value; //
// await http.post(deviceAlarms.configFindById, { id: value.id }).then((res) => {
let selectDevice = ref([value.deviceType]); if (res.msg === 'success') {
findNodeById(deviceTypeTreeData.value, value.deviceType); infoObject.value = res.data;
// //
getDevicePoint({ id: 1 }); let selectDevice = ref([Number(infoObject.value.deviceType)]);
// findNodeById(deviceTypeTreeData.value, Number(infoObject.value.deviceType));
findParentIds(deviceTypeTreeData.value, value.deviceType, selectDevice.value); //
infoObject.value.deviceType = selectDevice.value; getDevicePoint({ id: infoObject.value.deviceName });
//
findParentIds(deviceTypeTreeData.value, infoObject.value.deviceType, selectDevice.value);
infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || [];
delete infoObject.value.hxAlarmRuleLogicList;
infoObject.value.deviceType = selectDevice;
infoObject.value.ruleType = infoObject.value.ruleType + '';
console.log(infoObject.value, '数据');
}
});
} else { } else {
// //
infoObject.value = { infoObject.value = {
id: null,
site: null, site: null,
ruleType: null, ruleType: null,
abnormalDescription: null, abnormalDescription: null,
@ -345,14 +338,14 @@
valueType: null, valueType: null,
deviceName: null, deviceName: null,
enableRules: 0, enableRules: 0,
alarmList: [{ id: null, alarm: null, number: null, isDelete: '0' }], alarmList: [{ logic: null, num: null, isDelete: 0 }],
}; };
} }
visible.value = !visible.value; visible.value = !visible.value;
}; };
// //
const rules: infoObject<string, Rule[]> = { const rules = {
site: [{ required: true, message: '请选择站点', trigger: 'change' }], site: [{ required: true, message: '请选择站点', trigger: 'change' }],
deviceType: [{ required: true, message: '请选择设备类型', trigger: 'change' }], deviceType: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }], enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }],
@ -360,20 +353,27 @@
devicePoint: [{ required: true, message: '请选择设备点位', trigger: 'change' }], devicePoint: [{ required: true, message: '请选择设备点位', trigger: 'change' }],
valueType: [{ required: true, message: '请选择取值类型', trigger: 'change' }], valueType: [{ required: true, message: '请选择取值类型', trigger: 'change' }],
ruleType: [{ required: true, message: '请选择规则类型', trigger: 'change' }], ruleType: [{ required: true, message: '请选择规则类型', trigger: 'change' }],
abnormalDescription: [{ required: true, message: '请输入异常描述', trigger: 'blur' }], abnormalDescription: [
{
required: true,
message: '请输入异常描述',
trigger: 'blur',
validator: (rules: any, abnormalDescription: any, cbfn: any) => {
if (abnormalDescription.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
alarm: [{ required: true, message: '请选择逻辑', trigger: 'blur' }], alarm: [{ required: true, message: '请选择逻辑', trigger: 'blur' }],
number: [{ required: true, message: '请输入数值', trigger: 'blur' }], number: [{ required: true, message: '请输入数值', trigger: 'blur' }],
}; };
//
const changeSwitch = () => {
console.log(infoObject.value.selectSwitch, '开关');
};
// //
const btnClick = () => { const btnClick = () => {
console.log(infoObject.value, '数据');
infoObject.value.alarmList.forEach((item) => { infoObject.value.alarmList.forEach((item) => {
if (item.logic === null || item.num === null) { if (item.logic === null || item.num === null) {
// NsMessage.error('');
return; return;
} }
}); });
@ -383,51 +383,70 @@
} }
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
console.log('values', infoObject.value); let data = { ...infoObject.value };
let data = toRaw(infoObject); // id
// data.equipmentAlarmId = equipmentAlarm.value.id;
data.alarmList = [...infoObject.value.alarmList, ...delAlarmList.value]; //
// id data.hxAlarmRuleLogicList = [...infoObject.value.alarmList, ...delAlarmList.value];
data.hxAlarmRuleLogicList.forEach((item) => {
const num = Number(item.num);
if (!isNaN(num)) {
item.num = Number(num.toFixed(2));
} else {
item.num = 0; // 0
}
});
// id
data.deviceType = infoObject.value.deviceType[infoObject.value.deviceType.length - 1]; data.deviceType = infoObject.value.deviceType[infoObject.value.deviceType.length - 1];
delAlarmList.value = []; data.ruleType = Number(data.ruleType);
data.errorCode = equipmentAlarm.value.errorCode;
delete data.alarmList;
// HTTP POST
http
.post(deviceAlarms.configAddOrUpNewData, data)
.then((res) => {
if (res.msg === 'success') {
//
if (data.id) {
NsMessage.success('告警规则编辑成功');
} else {
NsMessage.success('告警规则新增成功');
}
emit('editObject', null);
handleClose();
}
})
.catch((error) => {
//
console.error('请求失败:', error);
});
}); });
//
// http
// .post(props.api, data)
// .then(() => {
// isLoading.value = false;
// NsMessage.success('', 1, () => {
// navigateBack();
// });
// })
// .catch(() => {
// isLoading.value = false;
// });
}; };
// //
const handleClose = () => { const handleClose = () => {
// //
formRef.value.resetFields(); formRef.value.resetFields();
siteDataTree.value = [];
// //
infoObject.value = { infoObject.value = {
id: null,
site: null, site: null,
ruleType: null, ruleType: null,
abnormalDescription: null, abnormalDescription: null,
deviceType: [], deviceType: [],
devicePoint: null, devicePoint: null,
enableRules: 0, enableRules: 0,
alarmList: [{ id: null, alarm: null, number: null, isDelete: '0' }], alarmList: [{ logic: null, num: null, isDelete: 0 }],
}; };
visible.value = false; visible.value = false;
//
delAlarmList.value = []; delAlarmList.value = [];
}; };
// //
const addAlarmList = () => { const addAlarmList = () => {
if (infoObject.value.alarmList) { if (infoObject.value.alarmList) {
infoObject.value.alarmList.push({ logic: null, num: null }); infoObject.value.alarmList.push({ logic: null, num: null, isDelete: 0 });
} else { } else {
infoObject.value.alarmList = [{ logic: null, num: null }]; infoObject.value.alarmList = [{ logic: null, num: null, isDelete: 0 }];
} }
}; };
// //
@ -437,18 +456,15 @@
const alarmItemToDelete = infoObject.value.alarmList[index]; const alarmItemToDelete = infoObject.value.alarmList[index];
if (alarmItemToDelete?.id) { if (alarmItemToDelete?.id) {
// delAlarmList // delAlarmList
delAlarmList.value.push({ ...alarmItemToDelete, isDelete: '1' }); delAlarmList.value.push({ ...alarmItemToDelete, isDelete: 1 });
} }
// infoObject // infoObject
infoObject.value.alarmList.splice(index, 1); infoObject.value.alarmList.splice(index, 1);
} else {
console.error('Invalid index: ', index);
} }
}; };
defineExpose({ defineExpose({
toggle, toggle,
handleClose, handleClose,
dwOptions,
formRef, formRef,
}); });
</script> </script>

20
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue

@ -2,11 +2,12 @@
<ns-drawer <ns-drawer
v-model:visible="visible" v-model:visible="visible"
width="520" width="520"
:title="infoObject?.id ? '修改设备告警' : '新增设备告警'" :title="infoObject?.id ? '编辑告警' : '新增告警'"
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
placement="right"> placement="right"
@close="handleClose">
<ns-form ref="formRef" :schemas="schemas" :model="infoObject" formLayout="vertical" /> <ns-form ref="formRef" :schemas="schemas" :model="infoObject" formLayout="vertical" />
<div style="margin-left: 52px"> <div style="margin-left: 52px">
应用规则: 应用规则:
@ -67,6 +68,13 @@
required: true, required: true,
message: '告警标题不能为空', message: '告警标题不能为空',
trigger: 'change', trigger: 'change',
validator: (rules: any, alarmTitle: any, cbfn: any) => {
if (alarmTitle && alarmTitle.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
}, },
], ],
componentProps: { componentProps: {
@ -207,7 +215,11 @@
formRef.value.triggerSubmit().then(() => { formRef.value.triggerSubmit().then(() => {
// //
http.post(deviceAlarms.addOrUpNewData, infoObject.value).then(() => { http.post(deviceAlarms.addOrUpNewData, infoObject.value).then(() => {
NsMessage.success('操作成功'); if (infoObject.value.id) {
NsMessage.success('告警编辑成功');
} else {
NsMessage.success('告警创建成功');
}
visible.value = false; visible.value = false;
emit('editObject', null); emit('editObject', null);
}); });
@ -216,9 +228,7 @@
const handleClose = () => { const handleClose = () => {
// //
formRef.value.formElRef.clearValidate(); formRef.value.formElRef.clearValidate();
console.log(infoObject.value);
visible.value = false; visible.value = false;
NsMessage.success('操作成功');
}; };
defineExpose({ defineExpose({
toggle, toggle,

89
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="box"> <div class="box">
<a-tabs default-active-key="1" @change="callback"> <a-tabs default-active-key="1">
<a-tab-pane key="1" tab="通知管理"> <a-tab-pane key="1" tab="通知管理">
<ns-view-list-table v-bind="notificationConfig" ref="mainRef"> <ns-view-list-table v-bind="notificationConfig" ref="mainRef">
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
@ -11,11 +11,14 @@
'blue-background': record.enableRules === 1 ? true : false, 'blue-background': record.enableRules === 1 ? true : false,
'grey-background': record.enableRules === 1 ? false : true, 'grey-background': record.enableRules === 1 ? false : true,
}" }"
@change="clickSwitch({ enableRules: record.enableRules, record: record })" /> @change="
clickSwitch({ type: 1, enableRules: record.enableRules, record: record })
" />
</template> </template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<!-- 联系方式 --> <!-- 联系方式 -->
<notificationManagement ref="notificationManagements" @editObject="editObject" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="设备告警" force-render> <a-tab-pane key="2" tab="设备告警" force-render>
<ns-view-list-table <ns-view-list-table
@ -31,12 +34,14 @@
'blue-background': record.enableRules === 1 ? true : false, 'blue-background': record.enableRules === 1 ? true : false,
'grey-background': record.enableRules === 1 ? false : true, 'grey-background': record.enableRules === 1 ? false : true,
}" }"
@change="clickSwitch({ enableRules: record.enableRules, record: record })" /> @change="
clickSwitch({ type: 2, enableRules: record.enableRules, record: record })
" />
</template> </template>
<template v-if="column.dataIndex === 'monitor'"> <template v-if="column.dataIndex === 'monitor'">
{{ {{
record?.monitorTime && record?.monitorTimeUnit record?.monitorTime && record?.monitorTimeUnit
? record?.monitorTime + record?.monitorTimeUnit ? record?.monitorTime + '' + record?.monitorTimeUnit
: '-' : '-'
}} }}
</template> </template>
@ -45,7 +50,7 @@
<a-button <a-button
v-if="!equipmentAlarm" v-if="!equipmentAlarm"
type="primary" type="primary"
style="position: absolute; right: 130px; z-index: 99; top: 80px; height: 30px" style="position: absolute; right: 130px; z-index: 3; top: 80px; height: 30px"
@click="backequipmentAlarm" @click="backequipmentAlarm"
>返回</a-button >返回</a-button
> >
@ -68,19 +73,21 @@
'blue-background': record.enableRules === 1 ? true : false, 'blue-background': record.enableRules === 1 ? true : false,
'grey-background': record.enableRules === 1 ? false : true, 'grey-background': record.enableRules === 1 ? false : true,
}" }"
@click="clickSwitch({ enableRules: record.enableRules, record: record })" /> @click="
clickSwitch({ type: 2, enableRules: record.enableRules, record: record })
" />
</template> </template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<a-button <a-button
v-if="!energyAlarm" v-if="!energyAlarm"
type="primary" type="primary"
style="position: absolute; right: 130px; z-index: 99; top: 80px; height: 30px" style="position: absolute; right: 130px; z-index: 3; top: 80px; height: 30px"
@click="backenergyAlarm" @click="backenergyAlarm"
>返回</a-button >返回</a-button
> >
<!-- 新增 编辑 能源告警 --> <!-- 新增 编辑 能源告警 -->
<editeEnergyAlarm ref="editeEnergyAlarm" @editObject="editObject" /> <editeEnergyAlarm ref="editeEnergyAlarm" @editObject="editeEnergyAlarmInfo" />
<!-- 配置能源告警--> <!-- 配置能源告警-->
<configureEnergyAlarms v-show="!energyAlarm" ref="configureEnergyAlarms" /> <configureEnergyAlarms v-show="!energyAlarm" ref="configureEnergyAlarms" />
</a-tab-pane> </a-tab-pane>
@ -96,6 +103,7 @@
import { NsMessage, NsModal } from '/nerv-lib/component'; import { NsMessage, NsModal } from '/nerv-lib/component';
import editeEquipmentAlarm from './equipmentAlarm/editeEquipmentAlarm.vue'; import editeEquipmentAlarm from './equipmentAlarm/editeEquipmentAlarm.vue';
import editeEnergyAlarm from './energyAlarm/editeEnergyAlarm.vue'; import editeEnergyAlarm from './energyAlarm/editeEnergyAlarm.vue';
import notificationManagement from './notificationManagement/index.vue';
import configureEnergyAlarms from './energyAlarm/configureEnergyAlarms.vue'; import configureEnergyAlarms from './energyAlarm/configureEnergyAlarms.vue';
import configureDeviceAlarms from './equipmentAlarm/configureDeviceAlarms.vue'; import configureDeviceAlarms from './equipmentAlarm/configureDeviceAlarms.vue';
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
@ -107,6 +115,7 @@
editeEquipmentAlarm, editeEquipmentAlarm,
configureDeviceAlarms, configureDeviceAlarms,
configureEnergyAlarms, configureEnergyAlarms,
notificationManagement,
editeEnergyAlarm, editeEnergyAlarm,
}, },
setup() { setup() {
@ -114,12 +123,13 @@
const mainRefEquipmentAlarm = ref(); const mainRefEquipmentAlarm = ref();
const mainEnergyAlarmConfig = ref(); const mainEnergyAlarmConfig = ref();
const editEquipmentAlarm = ref(); const editEquipmentAlarm = ref();
const notificationManagements = ref();
const editeEnergyAlarm = ref(); const editeEnergyAlarm = ref();
const configureDeviceAlarms = ref(); const configureDeviceAlarms = ref();
const configureEnergyAlarms = ref(); const configureEnergyAlarms = ref();
const equipmentAlarm = ref(true); const equipmentAlarm = ref(true);
const energyAlarm = ref(true); const energyAlarm = ref(true);
const notificationConfig = notificationtableConfig(null, mainEnergyAlarmConfig, null); const notificationConfig = notificationtableConfig(notificationManagements);
// //
const energyAlarmConfig = energyAlarmConfigs( const energyAlarmConfig = energyAlarmConfigs(
editeEnergyAlarm, editeEnergyAlarm,
@ -134,9 +144,6 @@
equipmentAlarm, equipmentAlarm,
configureDeviceAlarms, configureDeviceAlarms,
); );
const callback = (key: any) => {
console.log(key);
};
// //
const backequipmentAlarm = () => { const backequipmentAlarm = () => {
equipmentAlarm.value = !equipmentAlarm.value; equipmentAlarm.value = !equipmentAlarm.value;
@ -147,38 +154,68 @@
configureEnergyAlarms.value.show = false; configureEnergyAlarms.value.show = false;
}; };
const clickSwitch = (data: any) => { const clickSwitch = (data: any) => {
console.log(data.record.enableRules === 1 ? '关闭' : '启用');
NsModal.confirm({ NsModal.confirm({
title: '启用状态', title: '启用状态',
icon: createVNode(ExclamationCircleOutlined), icon: createVNode(ExclamationCircleOutlined),
content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '吗?', content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '吗?',
onOk: () => { onOk: () => {
http if (data.type === 1) {
.post(deviceAlarms.addOrUpNewData, { //
id: data.record.id, http
enableRules: data.record.enableRules === 1 ? 0 : 1, .post(deviceAlarms.addOrUpNewData, {
}) id: data.record.id,
.then(() => { enableRules: data.record.enableRules === 1 ? 0 : 1,
NsMessage.success('操作成功'); })
mainRefEquipmentAlarm.value?.nsTableRef.reload(); .then(() => {
}); NsMessage.success('操作成功');
mainRef.value?.nsTableRef.reload();
});
}
//
if (data.type === 2) {
http
.post(deviceAlarms.addOrUpNewData, {
id: data.record.id,
enableRules: data.record.enableRules === 1 ? 0 : 1,
})
.then(() => {
NsMessage.success('操作成功');
mainRefEquipmentAlarm.value?.nsTableRef.reload();
});
}
//
if (data.type === 3) {
http
.post(deviceAlarms.addOrUpNewData, {
id: data.record.id,
enableRules: data.record.enableRules === 1 ? 0 : 1,
})
.then(() => {
NsMessage.success('操作成功');
mainEnergyAlarmConfig.value?.nsTableRef.reload();
});
}
}, },
}); });
}; };
// //
const editObject = () => { const editObject = () => {
mainRefEquipmentAlarm.value?.nsTableRef.reload(); mainRefEquipmentAlarm.value?.nsTableRef.reload();
// console.log(newList.value.formFinish, ''); };
//
const editeEnergyAlarmInfo = () => {
mainEnergyAlarmConfig.value?.nsTableRef.reload();
}; };
return { return {
callback,
notificationConfig, notificationConfig,
energyAlarmConfig, energyAlarmConfig,
equipmentAlarmConfig, equipmentAlarmConfig,
editObject, editObject,
editeEnergyAlarm,
clickSwitch, clickSwitch,
editEquipmentAlarm, editEquipmentAlarm,
editeEnergyAlarm, notificationManagements,
editeEnergyAlarmInfo,
configureDeviceAlarms, configureDeviceAlarms,
configureEnergyAlarms, configureEnergyAlarms,
equipmentAlarm, equipmentAlarm,

246
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue

@ -0,0 +1,246 @@
<template>
<ns-drawer
v-model:visible="visible"
width="520"
:title="' '"
:ok="btnClick"
:cancel="handleClose"
placement="right"
:footer-style="{ textAlign: 'right' }"
@close="handleClose">
<div style="padding: 18px; width: 100%; overflow: hidden">
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="notification" label="通知方式" name="notification">
<a-select
ref="select"
v-model:value="infoObject.notification"
style="width: 100%"
mode="multiple"
:options="devicePointData"
show-search
:allowClear="true"
placeholder="请选择通知方式"
:filter-option="filterDevicePoint" />
</a-form-item>
<a-form-item label="启用规则" name="enableRules">
<a-switch
:checked="infoObject.enableRules === 1 ? true : false"
:class="{
'blue-background': infoObject.enableRules === 1 ? true : false,
'grey-background': infoObject.enableRules === 1 ? false : true,
}"
@click="clickSwitch" />
</a-form-item>
<a-form-item label="通知用户" name="user">
<a-cascader
v-model:value="infoObject.user"
style="width: 100%"
multiple
:max-tag-count="1"
:options="options"
:load-data="loadData"
placeholder="请选择通知用户"
:show-checked-strategy="Cascader.SHOW_CHILD" />
</a-form-item>
</a-form>
<a-table :dataSource="dataSource" :columns="columns" :pagination="false" />
</div>
</ns-drawer>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { Cascader } from 'ant-design-vue';
import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util';
// import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
//table
const columns = [
{
title: '序号',
dataIndex: 'address',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '通知名单',
dataIndex: 'name',
key: 'name',
},
];
const dataSource = [
{
name: '运维>运维1部>张三',
},
{
name: '运维>运维1部>李四',
},
];
const visible = ref(false);
//
const infoObject = ref({
enableRules: 0,
});
//
const filterDevicePoint = (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
//
const clickSwitch = () => {
if (infoObject.value.enableRules === 1) {
infoObject.value.enableRules = 0;
} else {
infoObject.value.enableRules = 1;
}
};
//
const devicePointData = ref([
{ label: '站内信息', value: 1 },
{ label: '邮件', value: 2 },
]);
//
const options = ref([
{
value: 1,
label: 'Zhejiang',
isLeaf: false,
},
{
value: 2,
label: 'Jiangsu',
isLeaf: false,
},
]);
//
const loadData = (selectedOptions: any) => {
const targetOption = selectedOptions[selectedOptions.length - 1];
targetOption.loading = true;
// load options lazily
setTimeout(() => {
targetOption.loading = false;
console.log(targetOption, '数据');
targetOption.children = [
{
label: `${targetOption.label} Dynamic 1`,
value: 3,
isLeaf: false,
},
{
label: `${targetOption.label} Dynamic 2`,
value: 4,
isLeaf: false,
},
];
options.value = [...options.value];
}, 1000);
};
const rules = {
notification: [{ required: true, message: '请选择站点', trigger: 'change' }],
enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }],
user: [{ required: true, message: '请选择通知人', trigger: 'change' }],
abnormalDescription: [
{
required: true,
message: '请输入异常描述',
trigger: 'blur',
validator: (rules: any, abnormalDescription: any, cbfn: any) => {
if (abnormalDescription.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
alarm: [{ required: true, message: '请选择逻辑', trigger: 'blur' }],
number: [{ required: true, message: '请输入数值', trigger: 'blur' }],
};
const formRef = ref();
const emit = defineEmits(['editObject']);
const toggle = (value: any) => {
//
if (value) {
// infoObject.value = value;
infoObject.value = {};
} else {
infoObject.value = {
enableRules: 0,
};
}
visible.value = !visible.value;
};
const btnClick = () => {
console.log(infoObject.value);
//
formRef.value.validate().then(() => {
//
// http.post(deviceAlarms.addOrUpNewData, infoObject.value).then(() => {
// NsMessage.success('');
// visible.value = false;
// emit('editObject', null);
// });
});
};
const handleClose = () => {
//
formRef.value.resetFields();
visible.value = false;
options.value = [
{
value: 'zhejiang',
label: 'Zhejiang',
isLeaf: false,
},
{
value: 'jiangsu',
label: 'Jiangsu',
isLeaf: false,
},
];
};
defineExpose({
toggle,
handleClose,
formRef,
});
</script>
<style scoped lang="less">
.drawerContainer {
height: 100%;
display: flex;
justify-content: space-between;
}
.blue-background.ant-switch-checked {
background-color: linear-gradient(
180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%
) !important;
}
.grey-background.ant-switch {
background-color: grey !important;
}
.blue-background.ant-switch-checked .ant-switch-handle {
background-color: linear-gradient(
180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%
) !important;
}
.grey-background.ant-switch .ant-switch-handle {
background-color: grey !important;
}
/deep/ .ant-form-item-label {
z-index: 20;
text-align: right;
width: 23%;
}
</style>

6
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts

@ -123,7 +123,7 @@ export const equipmentAlarmTableConfig = (
confirm: true, confirm: true,
handle: (data: any) => { handle: (data: any) => {
http.post(deviceAlarms.del, { id: data.id }).then(() => { http.post(deviceAlarms.del, { id: data.id }).then(() => {
NsMessage.success('操作成功'); NsMessage.success('告警删除成功');
mainRefEquipmentAlarm.value?.nsTableRef.reload(); mainRefEquipmentAlarm.value?.nsTableRef.reload();
}); });
}, },
@ -139,6 +139,7 @@ export const equipmentAlarmTableConfig = (
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选择告警优先级', placeholder: '请选择告警优先级',
allowClear: true,
options: [ options: [
{ {
label: '紧急', label: '紧急',
@ -160,6 +161,7 @@ export const equipmentAlarmTableConfig = (
label: '告警标题', label: '告警标题',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请输入告警标题关键字', placeholder: '请输入告警标题关键字',
}, },
}, },
@ -168,6 +170,7 @@ export const equipmentAlarmTableConfig = (
label: '错误码', label: '错误码',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请输入错误码关键字', placeholder: '请输入错误码关键字',
}, },
}, },
@ -177,6 +180,7 @@ export const equipmentAlarmTableConfig = (
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选择启用状态', placeholder: '请选择启用状态',
allowClear: true,
options: [ options: [
{ {
label: '启用', label: '启用',

4
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts

@ -41,7 +41,7 @@ const tableKeyMap = [
}, },
]; ];
const mockData = ref(data.listData); const mockData = ref(data.listData);
export const notificationtableConfig = (el) => { export const notificationtableConfig = (notificationManagements: any) => {
return { return {
title: '告警规则', title: '告警规则',
// api: '/carbon_emission/device/getDeviceList', // api: '/carbon_emission/device/getDeviceList',
@ -57,7 +57,7 @@ export const notificationtableConfig = (el) => {
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
console.log(data, '联系方式'); notificationManagements.value.toggle(data);
}, },
}, },
], ],

Loading…
Cancel
Save