fix:修改设备告警 能源告警字段 对接 能碳告警
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
export enum energyAlarmApi {
|
export enum energyAlarmApi {
|
||||||
getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表
|
getTableList = '/carbon-smart/api/AlarmEnergyConsumptionLog/selectAlarmEnergyConsumptionLog', //能碳告警 列表
|
||||||
getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表
|
getCodeList = '/carbon-smart/api/AlarmEnergyConsumptionLog/selectErrorCodeList ', //能碳告警 列表
|
||||||
getSelectAlarmEquipmentLogStatusProcess = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess', //设备告警 状态 没有创建工单log接口
|
getSelectAlarmEnergyConsumptionLogStatusProcess = '/carbon-smart/api/AlarmEnergyConsumptionLogStatusProcess/selectAlarmEnergyConsumptionLogStatusProcess', //能碳告警 状态 没有创建工单log接口
|
||||||
noCreatOrUpdateLog = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/creatOrUpdate', //设备告警 状态 没有创建工单 添加 修改状态log
|
noCreatOrUpdateLog = '/carbon-smart/api/AlarmEnergyConsumptionLogStatusProcess/creatOrUpdate', //能碳告警 状态 没有创建工单 添加 修改状态log
|
||||||
}
|
}
|
||||||
|
@@ -194,7 +194,7 @@
|
|||||||
textEllipsis: true,
|
textEllipsis: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '启用通知',
|
title: '启用状态',
|
||||||
dataIndex: 'enableRules',
|
dataIndex: 'enableRules',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -288,7 +288,7 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
params: { equipmentAlarmId: value.id },
|
params: { energyConsumptionAlarmId: value.id },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
label: 'orgName',
|
label: 'orgName',
|
||||||
value: 'orgId',
|
value: 'orgId',
|
||||||
}"
|
}"
|
||||||
|
:disabled="true"
|
||||||
tree-node-filter-prop="orgName" />
|
tree-node-filter-prop="orgName" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="数据来源" name="dataSources">
|
<a-form-item label="数据来源" name="dataSources">
|
||||||
@@ -54,7 +55,8 @@
|
|||||||
infoObject.dataSources && infoObject.dataSources[1] === 1
|
infoObject.dataSources && infoObject.dataSources[1] === 1
|
||||||
? 'deviceName'
|
? 'deviceName'
|
||||||
: 'pointName',
|
: 'pointName',
|
||||||
value: 'id',
|
value:
|
||||||
|
infoObject.dataSources && infoObject.dataSources[1] === 1 ? 'deviceInfoCode' : 'id',
|
||||||
}" />
|
}" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="启用规则">
|
<a-form-item label="启用规则">
|
||||||
@@ -139,8 +141,6 @@
|
|||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { dict } from '/@/api';
|
import { dict } from '/@/api';
|
||||||
|
|
||||||
// import type { Rule } from 'ant-design-vue/es/form';
|
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
//父级数据
|
//父级数据
|
||||||
const energyAlarm = ref({});
|
const energyAlarm = ref({});
|
||||||
@@ -311,6 +311,10 @@
|
|||||||
infoObject.value.dataSourcesType,
|
infoObject.value.dataSourcesType,
|
||||||
infoObject.value.dataSourcesWay,
|
infoObject.value.dataSourcesWay,
|
||||||
];
|
];
|
||||||
|
//设备节点
|
||||||
|
if (infoObject.value.dataSourcesWay === 2) {
|
||||||
|
infoObject.value.deviceNode = Number(infoObject.value.deviceNode);
|
||||||
|
}
|
||||||
delete infoObject.value.dataSourcesType;
|
delete infoObject.value.dataSourcesType;
|
||||||
delete infoObject.value.dataSourcesWay;
|
delete infoObject.value.dataSourcesWay;
|
||||||
infoObject.value.comparisonType = infoObject.value.comparisonType.split(',');
|
infoObject.value.comparisonType = infoObject.value.comparisonType.split(',');
|
||||||
@@ -348,8 +352,8 @@
|
|||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
|
alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
|
||||||
};
|
};
|
||||||
|
infoObject.value.site = orgId.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
visible.value = !visible.value;
|
visible.value = !visible.value;
|
||||||
};
|
};
|
||||||
//表单 判断规格
|
//表单 判断规格
|
||||||
@@ -391,7 +395,7 @@
|
|||||||
//处理数据
|
//处理数据
|
||||||
let data = { ...infoObject.value };
|
let data = { ...infoObject.value };
|
||||||
//关联能耗告警id
|
//关联能耗告警id
|
||||||
data.equipmentAlarmId = energyAlarm.value.id;
|
data.energyConsumptionAlarmId = energyAlarm.value.id;
|
||||||
data.errorCode = energyAlarm.value.errorCode;
|
data.errorCode = energyAlarm.value.errorCode;
|
||||||
data.dataSourcesType = data.dataSources[0];
|
data.dataSourcesType = data.dataSources[0];
|
||||||
data.dataSourcesWay = data.dataSources[1];
|
data.dataSourcesWay = data.dataSources[1];
|
||||||
|
@@ -18,22 +18,26 @@
|
|||||||
placeholder="请选择告警频率"
|
placeholder="请选择告警频率"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="alarmFrequencyData" />
|
:options="alarmFrequencyData"
|
||||||
|
@change="handleChangeAlarmFrequency" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
||||||
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
|
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长">
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长">
|
||||||
<ns-input-number
|
<ns-input-number
|
||||||
style="width: 60%"
|
style="width: 100%"
|
||||||
v-model:value="infoObject.intervalDuration"
|
v-model:value="infoObject.intervalDuration"
|
||||||
placeholder="请输入间隔时长" />
|
placeholder="请输入间隔时长">
|
||||||
<a-select
|
<template #addonAfter>
|
||||||
v-model:value="infoObject.intervalDurationUnit"
|
<a-select
|
||||||
placeholder="请选择间隔时长单位"
|
v-model:value="infoObject.intervalDurationUnit"
|
||||||
style="width: 40%"
|
placeholder="请选择间隔时长单位"
|
||||||
allowClear
|
style="width: 80px"
|
||||||
:options="intervalDurationUnitData" />
|
allowClear
|
||||||
|
:options="intervalDurationUnitData" />
|
||||||
|
</template>
|
||||||
|
</ns-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="优先级" name="priority">
|
<a-form-item label="优先级" name="priority">
|
||||||
<a-select
|
<a-select
|
||||||
@@ -77,6 +81,12 @@
|
|||||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
// 间隔单位 默认值
|
||||||
|
const handleChangeAlarmFrequency = () => {
|
||||||
|
if (infoObject.value.alarmFrequency === 2 && !infoObject.value.intervalDurationUnit) {
|
||||||
|
infoObject.value.intervalDurationUnit = 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
//表单数据
|
//表单数据
|
||||||
const infoObject = ref({
|
const infoObject = ref({
|
||||||
alarmTitle: null,
|
alarmTitle: null,
|
||||||
|
@@ -171,7 +171,7 @@
|
|||||||
dataIndex: 'abnormalDescription',
|
dataIndex: 'abnormalDescription',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '启用通知',
|
title: '启用状态',
|
||||||
dataIndex: 'enableRules',
|
dataIndex: 'enableRules',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
title: value.errorCode,
|
title: value.errorCode,
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
field: 'deviceId',
|
field: 'deviceInfoCode',
|
||||||
label: '设备名称',
|
label: '设备名称',
|
||||||
component: 'nsSelectApi',
|
component: 'nsSelectApi',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
placeholder: '请选择设备名称',
|
placeholder: '请选择设备名称',
|
||||||
resultField: 'data.records',
|
resultField: 'data.records',
|
||||||
labelField: 'deviceName',
|
labelField: 'deviceName',
|
||||||
valueField: 'id',
|
valueField: 'deviceInfoCode',
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: (input: string, option: any) => {
|
filterOption: (input: string, option: any) => {
|
||||||
return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
label: '设备点位',
|
label: '设备点位',
|
||||||
component: 'nsSelectApi',
|
component: 'nsSelectApi',
|
||||||
dynamicParams: {
|
dynamicParams: {
|
||||||
id: 'deviceId', //帮定上级联动数据
|
deviceCode: 'deviceInfoCode', //帮定上级联动数据
|
||||||
},
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: device.queryDevicePoint,
|
api: device.queryDevicePoint,
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
placeholder: '请选择设备点位',
|
placeholder: '请选择设备点位',
|
||||||
labelField: 'code',
|
labelField: 'code',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
dependency: 'deviceId',
|
dependency: 'deviceInfoCode',
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: (input: string, option: any) => {
|
filterOption: (input: string, option: any) => {
|
||||||
return option.code.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
return option.code.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
value: 'orgId',
|
value: 'orgId',
|
||||||
}"
|
}"
|
||||||
:tree-data="siteDataTree"
|
:tree-data="siteDataTree"
|
||||||
|
:disabled="true"
|
||||||
tree-node-filter-prop="orgName" />
|
tree-node-filter-prop="orgName" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="设备类型" name="deviceType">
|
<a-form-item label="设备类型" name="deviceType">
|
||||||
@@ -40,9 +41,9 @@
|
|||||||
@change="selectDeviceType"
|
@change="selectDeviceType"
|
||||||
placeholder="请选择设备类型" />
|
placeholder="请选择设备类型" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="设备名称" name="deviceId">
|
<a-form-item label="设备名称" name="deviceInfoCode">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.deviceId"
|
v-model:value="infoObject.deviceInfoCode"
|
||||||
:disabled="!(infoObject && infoObject.deviceType && infoObject.deviceType.length > 0)"
|
:disabled="!(infoObject && infoObject.deviceType && infoObject.deviceType.length > 0)"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:autoClearSearchValue="true"
|
:autoClearSearchValue="true"
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
@change="selectDevice"
|
@change="selectDevice"
|
||||||
placeholder="请选择设备名称">
|
placeholder="请选择设备名称">
|
||||||
<template v-for="(item, index) in deviceNameTreeData" :key="index">
|
<template v-for="(item, index) in deviceNameTreeData" :key="index">
|
||||||
<a-select-option :value="item.id">
|
<a-select-option :value="item.deviceInfoCode">
|
||||||
{{ item.deviceName }}
|
{{ item.deviceName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</template>
|
</template>
|
||||||
@@ -64,7 +65,7 @@
|
|||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请选择设备点位"
|
placeholder="请选择设备点位"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="!infoObject?.deviceId"
|
:disabled="!infoObject?.deviceInfoCode"
|
||||||
:options="devicePointData"
|
:options="devicePointData"
|
||||||
:filter-option="filterDevicePoint" />
|
:filter-option="filterDevicePoint" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -118,6 +119,7 @@
|
|||||||
<a-input
|
<a-input
|
||||||
style="width: 65px; margin-left: 6px"
|
style="width: 65px; margin-left: 6px"
|
||||||
type="number"
|
type="number"
|
||||||
|
status="error"
|
||||||
v-model:value="infoObject.alarmList[index - 1].num" />
|
v-model:value="infoObject.alarmList[index - 1].num" />
|
||||||
<div
|
<div
|
||||||
style="width: 70px; align-items: center; cursor: pointer"
|
style="width: 70px; align-items: center; cursor: pointer"
|
||||||
@@ -168,7 +170,7 @@
|
|||||||
deviceType: [],
|
deviceType: [],
|
||||||
devicePoint: null,
|
devicePoint: null,
|
||||||
valueType: null,
|
valueType: null,
|
||||||
deviceId: null,
|
deviceInfoCode: null,
|
||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
alarmList: [{ logic: null, num: null, isDelete: 0 }],
|
alarmList: [{ logic: null, num: null, isDelete: 0 }],
|
||||||
});
|
});
|
||||||
@@ -188,7 +190,7 @@
|
|||||||
let deviceNameTreeData = ref([]);
|
let deviceNameTreeData = ref([]);
|
||||||
//选择设备类型方法
|
//选择设备类型方法
|
||||||
const selectDeviceType = (value: any, selectedOptions: any) => {
|
const selectDeviceType = (value: any, selectedOptions: any) => {
|
||||||
infoObject.value.deviceId = null;
|
infoObject.value.deviceInfoCode = null;
|
||||||
if (selectedOptions && selectedOptions.length > 0) {
|
if (selectedOptions && selectedOptions.length > 0) {
|
||||||
//获取该类型设备
|
//获取该类型设备
|
||||||
getDevicePage({
|
getDevicePage({
|
||||||
@@ -201,7 +203,7 @@
|
|||||||
};
|
};
|
||||||
//选择设备方法
|
//选择设备方法
|
||||||
const selectDevice = () => {
|
const selectDevice = () => {
|
||||||
getDevicePoint({ id: infoObject.value.deviceId });
|
getDevicePoint({ deviceCode: infoObject.value.deviceInfoCode });
|
||||||
};
|
};
|
||||||
//获取设备列表
|
//获取设备列表
|
||||||
const getDevicePage = (value: any) => {
|
const getDevicePage = (value: any) => {
|
||||||
@@ -325,7 +327,7 @@
|
|||||||
let selectDevice = ref([Number(infoObject.value.deviceType)]);
|
let selectDevice = ref([Number(infoObject.value.deviceType)]);
|
||||||
findNodeById(deviceTypeTreeData.value, Number(infoObject.value.deviceType));
|
findNodeById(deviceTypeTreeData.value, Number(infoObject.value.deviceType));
|
||||||
//获取设备点位
|
//获取设备点位
|
||||||
getDevicePoint({ id: infoObject.value.deviceId });
|
getDevicePoint({ deviceCode: infoObject.value.deviceInfoCode });
|
||||||
// 回显 选择设备类型
|
// 回显 选择设备类型
|
||||||
findParentIds(
|
findParentIds(
|
||||||
deviceTypeTreeData.value,
|
deviceTypeTreeData.value,
|
||||||
@@ -360,10 +362,11 @@
|
|||||||
deviceType: [],
|
deviceType: [],
|
||||||
devicePoint: null,
|
devicePoint: null,
|
||||||
valueType: null,
|
valueType: null,
|
||||||
deviceId: null,
|
deviceInfoCode: null,
|
||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
alarmList: [{ logic: null, num: null, isDelete: 0 }],
|
alarmList: [{ logic: null, num: null, isDelete: 0 }],
|
||||||
};
|
};
|
||||||
|
infoObject.value.site = orgId.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
visible.value = !visible.value;
|
visible.value = !visible.value;
|
||||||
@@ -373,7 +376,7 @@
|
|||||||
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' }],
|
||||||
deviceId: [{ required: true, message: '请选择设备名称', trigger: 'change' }],
|
deviceInfoCode: [{ required: true, message: '请选择设备名称', trigger: 'change' }],
|
||||||
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' }],
|
||||||
@@ -396,6 +399,7 @@
|
|||||||
};
|
};
|
||||||
// 确认按钮
|
// 确认按钮
|
||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
|
infoObject.value.devicePoint = 1;
|
||||||
infoObject.value.alarmList.forEach((item) => {
|
infoObject.value.alarmList.forEach((item) => {
|
||||||
if (item.logic === null || item.num === null) {
|
if (item.logic === null || item.num === null) {
|
||||||
return;
|
return;
|
||||||
@@ -459,7 +463,7 @@
|
|||||||
deviceType: [],
|
deviceType: [],
|
||||||
devicePoint: null,
|
devicePoint: null,
|
||||||
valueType: null,
|
valueType: null,
|
||||||
deviceId: null,
|
deviceInfoCode: null,
|
||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
alarmList: [{ logic: null, num: null, isDelete: 0 }],
|
alarmList: [{ logic: null, num: null, isDelete: 0 }],
|
||||||
};
|
};
|
||||||
|
@@ -32,22 +32,26 @@
|
|||||||
placeholder="请选择告警频率"
|
placeholder="请选择告警频率"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="alarmFrequencyData" />
|
:options="alarmFrequencyData"
|
||||||
|
@change="handleChangeAlarmFrequency" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
||||||
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
|
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长">
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长">
|
||||||
<ns-input-number
|
<ns-input-number
|
||||||
style="width: 60%"
|
style="width: 100%"
|
||||||
v-model:value="infoObject.intervalDuration"
|
v-model:value="infoObject.intervalDuration"
|
||||||
placeholder="请输入间隔时长" />
|
placeholder="请输入间隔时长">
|
||||||
<a-select
|
<template #addonAfter>
|
||||||
v-model:value="infoObject.intervalDurationUnit"
|
<a-select
|
||||||
placeholder="请选择间隔时长单位"
|
v-model:value="infoObject.intervalDurationUnit"
|
||||||
style="width: 40%"
|
placeholder="请选择间隔时长单位"
|
||||||
allowClear
|
style="width: 80px"
|
||||||
:options="intervalDurationUnitData" />
|
allowClear
|
||||||
|
:options="intervalDurationUnitData" />
|
||||||
|
</template>
|
||||||
|
</ns-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="优先级" name="priority">
|
<a-form-item label="优先级" name="priority">
|
||||||
<a-select
|
<a-select
|
||||||
@@ -176,6 +180,12 @@
|
|||||||
}
|
}
|
||||||
visible.value = !visible.value;
|
visible.value = !visible.value;
|
||||||
};
|
};
|
||||||
|
// 间隔单位 默认值
|
||||||
|
const handleChangeAlarmFrequency = () => {
|
||||||
|
if (infoObject.value.alarmFrequency === 2 && !infoObject.value.intervalDurationUnit) {
|
||||||
|
infoObject.value.intervalDurationUnit = 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
//表单 判断规格
|
//表单 判断规格
|
||||||
const rules = {
|
const rules = {
|
||||||
alarmTitle: [
|
alarmTitle: [
|
||||||
@@ -211,7 +221,11 @@
|
|||||||
required: true,
|
required: true,
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
validator: (rules: any, intervalDuration: any, cbfn: any) => {
|
validator: (rules: any, intervalDuration: any, cbfn: any) => {
|
||||||
if (Number.isInteger(intervalDuration) && intervalDuration > 0) {
|
if (
|
||||||
|
Number.isInteger(intervalDuration) &&
|
||||||
|
intervalDuration > 0 &&
|
||||||
|
infoObject.value.intervalDurationUnit
|
||||||
|
) {
|
||||||
cbfn();
|
cbfn();
|
||||||
} else {
|
} else {
|
||||||
cbfn('请输入正确的间隔时长');
|
cbfn('请输入正确的间隔时长');
|
||||||
|
@@ -37,7 +37,9 @@
|
|||||||
<div style="color: #2778ff">{{ infoObject.alarmTitle }}</div>
|
<div style="color: #2778ff">{{ infoObject.alarmTitle }}</div>
|
||||||
{{ infoObject.abnormalDescription }}</a-descriptions-item
|
{{ infoObject.abnormalDescription }}</a-descriptions-item
|
||||||
>
|
>
|
||||||
<a-descriptions-item label="设备信息"> {{ infoObject.deviceInfo }} </a-descriptions-item>
|
<a-descriptions-item label="监测点位">
|
||||||
|
{{ infoObject.monitoringPoints }}
|
||||||
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="重复次数">
|
<a-descriptions-item label="重复次数">
|
||||||
{{ infoObject.alarmRepetitions }}
|
{{ infoObject.alarmRepetitions }}
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
|
@@ -64,7 +64,7 @@
|
|||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const showEdit = ref(true);
|
const showEdit = ref(true);
|
||||||
const infoObject = ref({});
|
const infoObject = ref({});
|
||||||
const equipmentAlarm = ref({});
|
const energyAlarm = ref({});
|
||||||
const stateOptions = ref();
|
const stateOptions = ref();
|
||||||
const logList = ref([]);
|
const logList = ref([]);
|
||||||
const config = ref({
|
const config = ref({
|
||||||
@@ -73,19 +73,19 @@
|
|||||||
});
|
});
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
equipmentAlarm.value = {};
|
energyAlarm.value = {};
|
||||||
infoObject.value = {};
|
infoObject.value = {};
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
};
|
};
|
||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
delete infoObject.value.createTime;
|
delete infoObject.value.createTime;
|
||||||
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
|
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
|
||||||
if (equipmentAlarm.value.createWorkOrder === 0) {
|
if (energyAlarm.value.createWorkOrder === 0) {
|
||||||
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
||||||
if (res.msg === 'success') {
|
if (res.msg === 'success') {
|
||||||
NsMessage.success('操作成功');
|
NsMessage.success('操作成功');
|
||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
equipmentAlarm.value = {};
|
energyAlarm.value = {};
|
||||||
infoObject.value = {};
|
infoObject.value = {};
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit('logAdd', null);
|
emit('logAdd', null);
|
||||||
@@ -96,14 +96,14 @@
|
|||||||
//修改状态
|
//修改状态
|
||||||
const changeShowEdit = () => {
|
const changeShowEdit = () => {
|
||||||
// 未生成工单
|
// 未生成工单
|
||||||
if (equipmentAlarm.value.createWorkOrder === 0) {
|
if (energyAlarm.value.createWorkOrder === 0) {
|
||||||
showEdit.value = !showEdit.value;
|
showEdit.value = !showEdit.value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const toggle = async (data) => {
|
const toggle = async (data) => {
|
||||||
equipmentAlarm.value = { ...data };
|
energyAlarm.value = { ...data };
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
if (equipmentAlarm.value.createWorkOrder === 1) {
|
if (energyAlarm.value.createWorkOrder === 1) {
|
||||||
stateOptions.value = [
|
stateOptions.value = [
|
||||||
{ value: 1, label: '待处理' },
|
{ value: 1, label: '待处理' },
|
||||||
{ value: 2, label: '处理中' },
|
{ value: 2, label: '处理中' },
|
||||||
@@ -121,8 +121,8 @@
|
|||||||
}
|
}
|
||||||
console.log(data, 'data');
|
console.log(data, 'data');
|
||||||
await http
|
await http
|
||||||
.post(energyAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
|
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
|
||||||
alarmEquipmentLogId: data.id,
|
alarmEnergyConsumptionLogId: data.id,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.msg === 'success') {
|
if (res.msg === 'success') {
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
infoObject,
|
infoObject,
|
||||||
changeShowEdit,
|
changeShowEdit,
|
||||||
showEdit,
|
showEdit,
|
||||||
equipmentAlarm,
|
energyAlarm,
|
||||||
stateOptions,
|
stateOptions,
|
||||||
btnClick,
|
btnClick,
|
||||||
visible,
|
visible,
|
||||||
|
@@ -36,7 +36,7 @@ const tableKeyMap = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '监测点位',
|
title: '监测点位',
|
||||||
dataIndex: 'deviceInfo',
|
dataIndex: 'monitoringPoints',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '更新时间',
|
title: '更新时间',
|
||||||
|
Reference in New Issue
Block a user