fix:修改字段 对接设备告警
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
errorCode: null,
|
||||
alarmTitle: null,
|
||||
abnormalDescription: null,
|
||||
deviceInfo: null,
|
||||
monitoringPoints: null,
|
||||
alarmRepetitions: null,
|
||||
updateTime: null,
|
||||
});
|
||||
@@ -84,7 +84,7 @@
|
||||
errorCode: null,
|
||||
alarmTitle: null,
|
||||
abnormalDescription: null,
|
||||
deviceInfo: null,
|
||||
monitoringPoints: null,
|
||||
alarmRepetitions: null,
|
||||
updateTime: null,
|
||||
};
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<a-tabs>
|
||||
<a-tab-pane key="1" tab="更新状态">
|
||||
<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-select
|
||||
v-model:value="infoObject.state"
|
||||
@@ -67,31 +67,53 @@
|
||||
const energyAlarm = ref({});
|
||||
const stateOptions = ref();
|
||||
const logList = ref([]);
|
||||
const formRef = ref();
|
||||
const config = ref({
|
||||
size: logList.value.length,
|
||||
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 = () => {
|
||||
showEdit.value = true;
|
||||
energyAlarm.value = {};
|
||||
infoObject.value = {};
|
||||
visible.value = false;
|
||||
config.value.dataSource = [];
|
||||
};
|
||||
const btnClick = () => {
|
||||
delete infoObject.value.createTime;
|
||||
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
|
||||
if (energyAlarm.value.createWorkOrder === 0) {
|
||||
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
NsMessage.success('操作成功');
|
||||
showEdit.value = true;
|
||||
energyAlarm.value = {};
|
||||
infoObject.value = {};
|
||||
visible.value = false;
|
||||
emit('logAdd', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
formRef.value.validate().then(() => {
|
||||
delete infoObject.value.createTime;
|
||||
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
|
||||
if (energyAlarm.value.createWorkOrder === 0) {
|
||||
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
NsMessage.success('操作成功');
|
||||
showEdit.value = true;
|
||||
energyAlarm.value = {};
|
||||
infoObject.value = {};
|
||||
visible.value = false;
|
||||
emit('logAdd', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
//修改状态
|
||||
const changeShowEdit = () => {
|
||||
@@ -119,7 +141,6 @@
|
||||
{ value: 5, label: '已关闭' },
|
||||
];
|
||||
}
|
||||
console.log(data, 'data');
|
||||
await http
|
||||
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
|
||||
alarmEnergyConsumptionLogId: data.id,
|
||||
@@ -149,6 +170,8 @@
|
||||
infoObject,
|
||||
changeShowEdit,
|
||||
showEdit,
|
||||
rules,
|
||||
formRef,
|
||||
energyAlarm,
|
||||
stateOptions,
|
||||
btnClick,
|
||||
|
@@ -1,6 +1,10 @@
|
||||
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
||||
import { dict } from '/@/api';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
const tableKeyMap = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -181,6 +185,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
},
|
||||
],
|
||||
},
|
||||
params: { orgId: orgId.value },
|
||||
// pagination: { pageSizeOptions: false },
|
||||
rowKey: 'id',
|
||||
};
|
||||
|
Reference in New Issue
Block a user