Browse Source

fix:修改字段 对接设备告警

temp
zhaohy 4 months ago
parent
commit
b8b6a46e7e
  1. 2
      hx-ai-intelligent/src/components/ns-steps.vue
  2. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue
  3. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue
  4. 3
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  5. 9
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  6. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  7. 3
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  8. 7
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  9. 5
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts
  10. 6
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  11. 5
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts
  12. 4
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue
  13. 27
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue
  14. 5
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts
  15. 7
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue
  16. 12
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts
  17. 10
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue
  18. 6
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts

2
hx-ai-intelligent/src/components/ns-steps.vue

@ -9,7 +9,7 @@
<div class="card"> <div class="card">
<div class="card-title"> <div class="card-title">
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag> <a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag>
<div class="name">{{ item.createName }}</div> <div class="name">{{ item.realName }}</div>
<div class="time">{{ item.createTime }}</div> <div class="time">{{ item.createTime }}</div>
</div> </div>
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto"> <div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">

2
hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue

@ -20,7 +20,7 @@
</div> </div>
</div> </div>
<div class="item-box-right"> <div class="item-box-right">
<img width="54px" height="54px" src="../../../../src/icon/gaojingtonglan.svg" /> <img width="48px" height="48px" src="../../../../src/icon/gaojingtonglan.svg" />
</div> </div>
</div> </div>
</div> </div>

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

@ -288,7 +288,7 @@
}, },
], ],
}, },
params: { energyConsumptionAlarmId: value.id }, params: { energyConsumptionAlarmId: value.id, orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

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

@ -394,6 +394,9 @@
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
// //
let data = { ...infoObject.value }; let data = { ...infoObject.value };
if (!data.orgId) {
data.orgId = orgId.value;
}
//id //id
data.energyConsumptionAlarmId = energyAlarm.value.id; data.energyConsumptionAlarmId = energyAlarm.value.id;
data.errorCode = energyAlarm.value.errorCode; data.errorCode = energyAlarm.value.errorCode;

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

@ -87,6 +87,11 @@
infoObject.value.intervalDurationUnit = 1; infoObject.value.intervalDurationUnit = 1;
} }
}; };
//id
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
// //
const infoObject = ref({ const infoObject = ref({
alarmTitle: null, alarmTitle: null,
@ -94,6 +99,7 @@
priority: null, priority: null,
monitorFrequency: null, monitorFrequency: null,
createWorkOrder: null, createWorkOrder: null,
orgId: null,
enableRules: 0, enableRules: 0,
}); });
const formRef = ref(); const formRef = ref();
@ -245,6 +251,9 @@
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
let data = { ...infoObject.value }; let data = { ...infoObject.value };
if (!data.orgId) {
data.orgId = orgId.value;
}
data.createWorkOrder = Number(data.createWorkOrder); data.createWorkOrder = Number(data.createWorkOrder);
if (data.alarmFrequency !== 2) { if (data.alarmFrequency !== 2) {
data.repetitions = null; data.repetitions = null;

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

@ -279,7 +279,7 @@
}, },
], ],
}, },
params: { equipmentAlarmId: value.id }, params: { equipmentAlarmId: value.id, orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

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

@ -412,6 +412,9 @@
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
let data = { ...infoObject.value }; let data = { ...infoObject.value };
if (!data.orgId) {
data.orgId = orgId.value;
}
// id // id
data.equipmentAlarmId = equipmentAlarm.value.id; data.equipmentAlarmId = equipmentAlarm.value.id;
// //

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

@ -87,6 +87,10 @@
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
const visible = ref(false); const visible = ref(false);
//id
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
// //
const infoObject = ref({ const infoObject = ref({
id: null, id: null,
@ -316,6 +320,9 @@
data.intervalDuration = null; data.intervalDuration = null;
data.intervalDurationUnit = null; data.intervalDurationUnit = null;
} }
if (!data.orgId) {
data.orgId = orgId.value;
}
http.post(deviceAlarms.addOrUpNewData, data).then(() => { http.post(deviceAlarms.addOrUpNewData, data).then(() => {
if (infoObject.value.id) { if (infoObject.value.id) {
NsMessage.success('告警编辑成功'); NsMessage.success('告警编辑成功');

5
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts

@ -1,7 +1,11 @@
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm'; import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -214,6 +218,7 @@ export const energyAlarmConfigs = (
}, },
], ],
}, },
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

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

@ -1,6 +1,11 @@
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -212,6 +217,7 @@ export const equipmentAlarmTableConfig = (
}, },
], ],
}, },
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

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

@ -1,5 +1,9 @@
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements'; import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -146,6 +150,7 @@ export const notificationtableConfig = (notificationManagements: any) => {
}, },
], ],
}, },
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

4
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue

@ -67,7 +67,7 @@
errorCode: null, errorCode: null,
alarmTitle: null, alarmTitle: null,
abnormalDescription: null, abnormalDescription: null,
deviceInfo: null, monitoringPoints: null,
alarmRepetitions: null, alarmRepetitions: null,
updateTime: null, updateTime: null,
}); });
@ -84,7 +84,7 @@
errorCode: null, errorCode: null,
alarmTitle: null, alarmTitle: null,
abnormalDescription: null, abnormalDescription: null,
deviceInfo: null, monitoringPoints: null,
alarmRepetitions: null, alarmRepetitions: null,
updateTime: null, updateTime: null,
}; };

27
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue

@ -11,7 +11,7 @@
<a-tabs> <a-tabs>
<a-tab-pane key="1" tab="更新状态"> <a-tab-pane key="1" tab="更新状态">
<div style="width: 100%; padding: 24px"> <div style="width: 100%; padding: 24px">
<a-form ref="formRef" :model="infoObject"> <a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="state" label="当前状态" name="state"> <a-form-item ref="state" label="当前状态" name="state">
<a-select <a-select
v-model:value="infoObject.state" v-model:value="infoObject.state"
@ -67,17 +67,38 @@
const energyAlarm = ref({}); const energyAlarm = ref({});
const stateOptions = ref(); const stateOptions = ref();
const logList = ref([]); const logList = ref([]);
const formRef = ref();
const config = ref({ const config = ref({
size: logList.value.length, size: logList.value.length,
dataSource: logList.value, dataSource: logList.value,
}); });
//
const rules = {
remarks: [
{
required: true,
message: '请输入备注',
trigger: 'change',
validator: (rules, remarks, cbfn) => {
if (remarks && remarks.trim() !== '') {
cbfn();
} else {
cbfn('备注不能为空');
}
},
},
],
state: [{ required: true, message: '请选择当前状态', trigger: 'change' }],
};
const handleClose = () => { const handleClose = () => {
showEdit.value = true; showEdit.value = true;
energyAlarm.value = {}; energyAlarm.value = {};
infoObject.value = {}; infoObject.value = {};
visible.value = false; visible.value = false;
config.value.dataSource = [];
}; };
const btnClick = () => { const btnClick = () => {
formRef.value.validate().then(() => {
delete infoObject.value.createTime; delete infoObject.value.createTime;
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id; infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
if (energyAlarm.value.createWorkOrder === 0) { if (energyAlarm.value.createWorkOrder === 0) {
@ -92,6 +113,7 @@
} }
}); });
} }
});
}; };
// //
const changeShowEdit = () => { const changeShowEdit = () => {
@ -119,7 +141,6 @@
{ value: 5, label: '已关闭' }, { value: 5, label: '已关闭' },
]; ];
} }
console.log(data, 'data');
await http await http
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, { .post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
alarmEnergyConsumptionLogId: data.id, alarmEnergyConsumptionLogId: data.id,
@ -149,6 +170,8 @@
infoObject, infoObject,
changeShowEdit, changeShowEdit,
showEdit, showEdit,
rules,
formRef,
energyAlarm, energyAlarm,
stateOptions, stateOptions,
btnClick, btnClick,

5
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts

@ -1,6 +1,10 @@
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm'; import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
import { dict } from '/@/api'; import { dict } from '/@/api';
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -181,6 +185,7 @@ export const notificationtableConfig = (look: any, status: any) => {
}, },
], ],
}, },
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

7
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

@ -67,6 +67,7 @@
const equipmentAlarm = ref({}); const equipmentAlarm = ref({});
const stateOptions = ref(); const stateOptions = ref();
const logList = ref([]); const logList = ref([]);
const formRef = ref();
const config = ref({ const config = ref({
size: logList.value.length, size: logList.value.length,
dataSource: logList.value, dataSource: logList.value,
@ -94,8 +95,11 @@
equipmentAlarm.value = {}; equipmentAlarm.value = {};
infoObject.value = {}; infoObject.value = {};
visible.value = false; visible.value = false;
config.value.dataSource = [];
logList.value = [];
}; };
const btnClick = () => { const btnClick = () => {
formRef.value.validate().then(() => {
delete infoObject.value.createTime; delete infoObject.value.createTime;
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id; infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
if (equipmentAlarm.value.createWorkOrder === 0) { if (equipmentAlarm.value.createWorkOrder === 0) {
@ -110,6 +114,7 @@
} }
}); });
} }
});
}; };
// //
const changeShowEdit = () => { const changeShowEdit = () => {
@ -137,7 +142,6 @@
{ value: 5, label: '已关闭' }, { value: 5, label: '已关闭' },
]; ];
} }
console.log(data, 'data');
await http await http
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, { .post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
alarmEquipmentLogId: data.id, alarmEquipmentLogId: data.id,
@ -166,6 +170,7 @@
return { return {
infoObject, infoObject,
rules, rules,
formRef,
changeShowEdit, changeShowEdit,
showEdit, showEdit,
equipmentAlarm, equipmentAlarm,

12
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts

@ -1,4 +1,9 @@
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm'; import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [ const tableKeyMap = [
{ {
@ -20,18 +25,23 @@ const tableKeyMap = [
{ {
title: '优先级', title: '优先级',
dataIndex: 'priority', dataIndex: 'priority',
width: 80,
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'alarmLogState', dataIndex: 'alarmLogState',
width: 100,
}, },
{ {
title: '错误码', title: '错误码',
dataIndex: 'errorCode', dataIndex: 'errorCode',
width: 100,
}, },
{ {
title: '设备信息', title: '设备信息',
dataIndex: 'deviceInfo', dataIndex: 'deviceInfo',
width: 400,
// textEllipsis: true,
}, },
{ {
title: '更新时间', title: '更新时间',
@ -40,6 +50,7 @@ const tableKeyMap = [
{ {
title: '重复次数', title: '重复次数',
dataIndex: 'alarmRepetitions', dataIndex: 'alarmRepetitions',
width: 80,
}, },
]; ];
export const notificationtableConfig = (look: any, status: any) => { export const notificationtableConfig = (look: any, status: any) => {
@ -155,6 +166,7 @@ export const notificationtableConfig = (look: any, status: any) => {
}, },
], ],
}, },
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

10
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue

@ -62,11 +62,11 @@
{ value: 5, label: '已关闭' }, { value: 5, label: '已关闭' },
]); ]);
const logList = ref([ const logList = ref([
{ createName: '李四', state: 3, time: '2024-03-10 10:00:00', desc: '完成' }, { realName: '李四', state: 3, createTime: '2024-03-10 10:00:00', remarks: '完成' },
{ createName: '王五', state: 5, time: '2024-03-10 10:00:00' }, { realName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
{ createName: '王五', state: 4, time: '2024-03-10 10:00:00' }, { realName: '王五', state: 4, createTime: '2024-03-10 10:00:00' },
{ createName: '王五', state: 2, time: '2024-03-10 10:00:00', desc: '创建工单' }, { realName: '王五', state: 2, createTime: '2024-03-10 10:00:00', remarks: '创建工单' },
{ createName: '赵六', state: 1, time: '2024-03-10 10:00:00' }, { realName: '赵六', state: 1, createTime: '2024-03-10 10:00:00' },
]); ]);
const config = ref({ const config = ref({
size: logList.value.length, size: logList.value.length,

6
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts

@ -1,4 +1,9 @@
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm'; import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -139,6 +144,7 @@ export const notificationtableConfig = (look: any, status: any) => {
}, },
], ],
}, },
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

Loading…
Cancel
Save