|
|
|
|
@ -22,6 +22,12 @@
|
|
|
|
|
<el-option v-for="dict in dict.type.monitor_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="点位类型" prop="pointType">
|
|
|
|
|
<el-input v-model="queryParams.pointType" placeholder="请输入点位类型" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="安装位置" prop="locationName">
|
|
|
|
|
<el-input v-model="queryParams.locationName" placeholder="请输入安装位置" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="采集设备编号" prop="collectDeviceId">-->
|
|
|
|
|
<!-- <el-input v-model="queryParams.collectDeviceId" placeholder="请输入采集设备编号" clearable-->
|
|
|
|
|
<!-- @keyup.enter="handleQuery" />-->
|
|
|
|
|
@ -72,7 +78,16 @@
|
|
|
|
|
<dict-tag :options="dict.type.monitor_status" :value="scope.row.monitorStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="采集设备编号" align="center" prop="collectDeviceId" v-if="columns[6].visible" />
|
|
|
|
|
<el-table-column label="采集设备名称" align="center" prop="collectDeviceName" v-if="columns[6].visible" />
|
|
|
|
|
<el-table-column label="点位类型" align="center" prop="pointType" v-if="columns[19].visible" />
|
|
|
|
|
<el-table-column label="单位" align="center" prop="unitName" v-if="columns[20].visible" />
|
|
|
|
|
<el-table-column label="安装位置" align="center" prop="locationName" v-if="columns[21].visible" />
|
|
|
|
|
<el-table-column label="传感器类型" align="center" prop="sensorType" v-if="columns[22].visible" />
|
|
|
|
|
<el-table-column label="启用报警" align="center" prop="alarmEnable" v-if="columns[23].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="dict.type.is_flag" :value="scope.row.alarmEnable" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="等级" align="center" prop="grade" v-if="columns[7].visible" />
|
|
|
|
|
<el-table-column label="传感器仪表" align="center" prop="meterTypeId" v-if="columns[8].visible" />
|
|
|
|
|
<el-table-column label="修正值" align="center" prop="correctValue" v-if="columns[9].visible" />
|
|
|
|
|
@ -146,8 +161,61 @@
|
|
|
|
|
<el-radio v-for="dict in dict.type.monitor_status" :key="dict.value" :label="parseInt(dict.value)">{{ dict.label }}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="采集设备编号" prop="collectDeviceId">
|
|
|
|
|
<el-input v-model="form.collectDeviceId" placeholder="请输入采集设备编号" />
|
|
|
|
|
<el-form-item label="采集设备" prop="collectDeviceId">
|
|
|
|
|
<el-select v-model="form.collectDeviceId" placeholder="请选择采集设备">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in collectDeviceList"
|
|
|
|
|
:key="item.collectDeviceId"
|
|
|
|
|
:label="item.collectDeviceName"
|
|
|
|
|
:value="item.collectDeviceId"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="点位类型" prop="pointType">
|
|
|
|
|
<el-input v-model="form.pointType" placeholder="请输入点位类型" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="单位" prop="unitName">
|
|
|
|
|
<el-input v-model="form.unitName" placeholder="请输入单位" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备序列号" prop="deviceSn">
|
|
|
|
|
<el-input v-model="form.deviceSn" placeholder="请输入设备序列号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="安装位置" prop="locationName">
|
|
|
|
|
<el-input v-model="form.locationName" placeholder="请输入安装位置" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="所属柜体" prop="cabinetName">
|
|
|
|
|
<el-input v-model="form.cabinetName" placeholder="请输入所属柜体" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="所属回路" prop="circuitName">
|
|
|
|
|
<el-input v-model="form.circuitName" placeholder="请输入所属回路" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="相别" prop="phaseNo">
|
|
|
|
|
<el-input v-model="form.phaseNo" placeholder="请输入相别" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="传感器类型" prop="sensorType">
|
|
|
|
|
<el-input v-model="form.sensorType" placeholder="请输入传感器类型" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="测量精度" prop="measurePrecision">
|
|
|
|
|
<el-input-number v-model="form.measurePrecision" placeholder="请输入测量精度" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="量程下限" prop="rangeMin">
|
|
|
|
|
<el-input-number v-model="form.rangeMin" placeholder="请输入量程下限" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="量程上限" prop="rangeMax">
|
|
|
|
|
<el-input-number v-model="form.rangeMax" placeholder="请输入量程上限" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="启用报警" prop="alarmEnable">
|
|
|
|
|
<el-radio-group v-model="form.alarmEnable">
|
|
|
|
|
<el-radio v-for="dict in dict.type.is_flag" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="启用曲线" prop="curveEnable">
|
|
|
|
|
<el-radio-group v-model="form.curveEnable">
|
|
|
|
|
<el-radio v-for="dict in dict.type.is_flag" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="展示排序" prop="displaySort">
|
|
|
|
|
<el-input-number v-model="form.displaySort" placeholder="请输入展示排序" :precision="0" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="等级" prop="grade">-->
|
|
|
|
|
<!-- <el-input v-model="form.grade" placeholder="请输入等级" />-->
|
|
|
|
|
@ -240,7 +308,18 @@
|
|
|
|
|
<dict-tag :options="dict.type.monitor_field" :value="scope.row.monitorField" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="触发阈值量" align="center" prop="triggerValue" />
|
|
|
|
|
<el-table-column label="告警上限" align="center" prop="alarmUpper" />
|
|
|
|
|
<el-table-column label="告警下限" align="center" prop="alarmLower" />
|
|
|
|
|
<el-table-column label="恢复上限" align="center" prop="recoverUpper" />
|
|
|
|
|
<el-table-column label="恢复下限" align="center" prop="recoverLower" />
|
|
|
|
|
<el-table-column label="回差" align="center" prop="hysteresis" />
|
|
|
|
|
<el-table-column label="持续秒数" align="center" prop="durationSec" />
|
|
|
|
|
<el-table-column label="告警级别" align="center" prop="alarmLevel" />
|
|
|
|
|
<el-table-column label="启用状态" align="center" prop="isEnable">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="dict.type.is_flag" :value="scope.row.isEnable" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="cause" show-overflow-tooltip />
|
|
|
|
|
<el-table-column label="操作" align="center" width="120">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
@ -275,8 +354,31 @@
|
|
|
|
|
<el-option v-for="dict in dict.type.monitor_field" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="触发阈值量" prop="triggerValue">
|
|
|
|
|
<el-input-number v-model="thresholdForm.triggerValue" placeholder="请输入触发阈值量" :precision="2" />
|
|
|
|
|
<el-form-item label="告警上限" prop="alarmUpper">
|
|
|
|
|
<el-input-number v-model="thresholdForm.alarmUpper" placeholder="请输入告警上限" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="告警下限" prop="alarmLower">
|
|
|
|
|
<el-input-number v-model="thresholdForm.alarmLower" placeholder="请输入告警下限" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="恢复上限" prop="recoverUpper">
|
|
|
|
|
<el-input-number v-model="thresholdForm.recoverUpper" placeholder="请输入恢复上限" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="恢复下限" prop="recoverLower">
|
|
|
|
|
<el-input-number v-model="thresholdForm.recoverLower" placeholder="请输入恢复下限" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="回差" prop="hysteresis">
|
|
|
|
|
<el-input-number v-model="thresholdForm.hysteresis" placeholder="请输入回差" :precision="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="持续秒数" prop="durationSec">
|
|
|
|
|
<el-input-number v-model="thresholdForm.durationSec" placeholder="请输入持续秒数" :precision="0" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="告警级别" prop="alarmLevel">
|
|
|
|
|
<el-input v-model="thresholdForm.alarmLevel" placeholder="请输入告警级别" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="启用状态" prop="isEnable">
|
|
|
|
|
<el-radio-group v-model="thresholdForm.isEnable">
|
|
|
|
|
<el-radio v-for="dict in dict.type.is_flag" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="cause">
|
|
|
|
|
<el-input v-model="thresholdForm.cause" type="textarea" placeholder="请输入备注" />
|
|
|
|
|
@ -310,17 +412,18 @@ import {
|
|
|
|
|
} from '@/api/ems/record/recordAlarmRule';
|
|
|
|
|
import EmsTreeSelect from '@/views/ems/components/EmsTreeSelect.vue';
|
|
|
|
|
import { getBaseEnergyTypeList } from '@/api/ems/base/baseEnergyType';
|
|
|
|
|
import { getCollectDeviceInfo } from '@/api/ems/base/baseCollectDeviceInfo';
|
|
|
|
|
import { handleTree } from '@/utils/ruoyi';
|
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
|
name: 'BaseMonitorInfo',
|
|
|
|
|
dicts: ['is_ammeter', 'monitor_status', 'monitor_type', 'trigger_rule', 'monitor_field']
|
|
|
|
|
dicts: ['is_ammeter', 'monitor_status', 'monitor_type', 'trigger_rule', 'monitor_field', 'is_flag']
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
|
|
|
|
const dict = reactive({
|
|
|
|
|
type: useDict('is_ammeter', 'monitor_status', 'monitor_type', 'trigger_rule', 'monitor_field')
|
|
|
|
|
type: useDict('is_ammeter', 'monitor_status', 'monitor_type', 'trigger_rule', 'monitor_field', 'is_flag')
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const formRef = ref<ElFormInstance>();
|
|
|
|
|
@ -352,7 +455,31 @@ const createFormData = () => ({
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
publicShareType: null,
|
|
|
|
|
monitorHierarchy: null
|
|
|
|
|
monitorHierarchy: null,
|
|
|
|
|
tenantId: null,
|
|
|
|
|
pointType: null,
|
|
|
|
|
metricCode: null,
|
|
|
|
|
unitName: null,
|
|
|
|
|
collectChannel: null,
|
|
|
|
|
registerAddress: null,
|
|
|
|
|
registerType: null,
|
|
|
|
|
dataType: null,
|
|
|
|
|
byteOrder: null,
|
|
|
|
|
bitOffset: null,
|
|
|
|
|
nodeId: null,
|
|
|
|
|
deviceSn: null,
|
|
|
|
|
locationCode: null,
|
|
|
|
|
locationName: null,
|
|
|
|
|
cabinetName: null,
|
|
|
|
|
circuitName: null,
|
|
|
|
|
phaseNo: null,
|
|
|
|
|
sensorType: null,
|
|
|
|
|
measurePrecision: null,
|
|
|
|
|
rangeMin: null,
|
|
|
|
|
rangeMax: null,
|
|
|
|
|
alarmEnable: null,
|
|
|
|
|
curveEnable: null,
|
|
|
|
|
displaySort: null
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 这里保留原页面字段结构,优先保证 EMS 业务行为与接口入参不发生漂移。
|
|
|
|
|
@ -373,7 +500,7 @@ const state = reactive({
|
|
|
|
|
isExpandAll: true,
|
|
|
|
|
// 重新渲染表格状态
|
|
|
|
|
refreshTable: true,
|
|
|
|
|
// 查询参数
|
|
|
|
|
// 查询对象补齐最新字段,页面只展示业务字段,技术字段继续留在内部承载和导出参数中。
|
|
|
|
|
queryParams: {
|
|
|
|
|
parentId: null,
|
|
|
|
|
monitorCode: null,
|
|
|
|
|
@ -397,7 +524,31 @@ const state = reactive({
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
publicShareType: null,
|
|
|
|
|
monitorHierarchy: null
|
|
|
|
|
monitorHierarchy: null,
|
|
|
|
|
tenantId: null,
|
|
|
|
|
pointType: null,
|
|
|
|
|
metricCode: null,
|
|
|
|
|
unitName: null,
|
|
|
|
|
collectChannel: null,
|
|
|
|
|
registerAddress: null,
|
|
|
|
|
registerType: null,
|
|
|
|
|
dataType: null,
|
|
|
|
|
byteOrder: null,
|
|
|
|
|
bitOffset: null,
|
|
|
|
|
nodeId: null,
|
|
|
|
|
deviceSn: null,
|
|
|
|
|
locationCode: null,
|
|
|
|
|
locationName: null,
|
|
|
|
|
cabinetName: null,
|
|
|
|
|
circuitName: null,
|
|
|
|
|
phaseNo: null,
|
|
|
|
|
sensorType: null,
|
|
|
|
|
measurePrecision: null,
|
|
|
|
|
rangeMin: null,
|
|
|
|
|
rangeMax: null,
|
|
|
|
|
alarmEnable: null,
|
|
|
|
|
curveEnable: null,
|
|
|
|
|
displaySort: null
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: createFormData(),
|
|
|
|
|
@ -470,7 +621,7 @@ const state = reactive({
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 6,
|
|
|
|
|
label: `采集设备编号`,
|
|
|
|
|
label: `采集设备名称`,
|
|
|
|
|
visible: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@ -534,10 +685,37 @@ const state = reactive({
|
|
|
|
|
key: 18,
|
|
|
|
|
label: `表具层级`,
|
|
|
|
|
visible: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 19,
|
|
|
|
|
label: `点位类型`,
|
|
|
|
|
visible: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 20,
|
|
|
|
|
label: `单位`,
|
|
|
|
|
visible: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 21,
|
|
|
|
|
label: `安装位置`,
|
|
|
|
|
visible: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 22,
|
|
|
|
|
label: `传感器类型`,
|
|
|
|
|
visible: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 23,
|
|
|
|
|
label: `启用报警`,
|
|
|
|
|
visible: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
//能源类型选项
|
|
|
|
|
energyTypeList: [],
|
|
|
|
|
// 采集设备下拉只展示名称,技术 ID 仍保留在提交参数中。
|
|
|
|
|
collectDeviceList: [],
|
|
|
|
|
// 阈值管理相关数据
|
|
|
|
|
thresholdOpen: false,
|
|
|
|
|
thresholdTitle: '',
|
|
|
|
|
@ -563,10 +741,10 @@ const state = reactive({
|
|
|
|
|
trigger: 'change'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
triggerValue: [
|
|
|
|
|
alarmUpper: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '触发阈值量不能为空',
|
|
|
|
|
message: '告警上限不能为空',
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
@ -579,6 +757,7 @@ const {
|
|
|
|
|
columns,
|
|
|
|
|
currentDevice,
|
|
|
|
|
energyTypeList,
|
|
|
|
|
collectDeviceList,
|
|
|
|
|
form,
|
|
|
|
|
isExpandAll,
|
|
|
|
|
loading,
|
|
|
|
|
@ -609,7 +788,8 @@ const getMonitorTypeLabel = (monitorType) => {
|
|
|
|
|
const getList = () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
listBaseMonitorInfo(queryParams.value).then((response) => {
|
|
|
|
|
baseMonitorInfoList.value = handleTree(response.data, 'objId', 'parentId');
|
|
|
|
|
const source = response.rows ?? response.data ?? [];
|
|
|
|
|
baseMonitorInfoList.value = handleTree(source, 'objId', 'parentId');
|
|
|
|
|
loading.value = false;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@ -633,7 +813,7 @@ const getTreeselect = () => {
|
|
|
|
|
monitorName: '顶级节点',
|
|
|
|
|
children: []
|
|
|
|
|
};
|
|
|
|
|
data.children = handleTree(response.data, 'objId', 'parentId');
|
|
|
|
|
data.children = handleTree(response.rows ?? response.data ?? [], 'objId', 'parentId');
|
|
|
|
|
baseMonitorInfoOptions.value.push(data);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@ -644,32 +824,8 @@ const cancel = () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const reset = () => {
|
|
|
|
|
form.value = {
|
|
|
|
|
objId: null,
|
|
|
|
|
parentId: null,
|
|
|
|
|
monitorCode: null,
|
|
|
|
|
monitorName: null,
|
|
|
|
|
energyType: null,
|
|
|
|
|
monitorAddr: null,
|
|
|
|
|
monitorType: null,
|
|
|
|
|
monitorStatus: null,
|
|
|
|
|
collectDeviceId: null,
|
|
|
|
|
ancestors: null,
|
|
|
|
|
grade: null,
|
|
|
|
|
meterTypeId: null,
|
|
|
|
|
correctValue: null,
|
|
|
|
|
pt: null,
|
|
|
|
|
ct: null,
|
|
|
|
|
isAmmeter: null,
|
|
|
|
|
isKeyMonitor: null,
|
|
|
|
|
isCircuit: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
publicShareType: null,
|
|
|
|
|
monitorHierarchy: null
|
|
|
|
|
};
|
|
|
|
|
// 统一重建默认对象,避免详情回填后隐藏技术字段在再次新增时串到下一条记录。
|
|
|
|
|
form.value = createFormData();
|
|
|
|
|
formRef.value?.resetFields();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -709,7 +865,10 @@ const handleUpdate = (row) => {
|
|
|
|
|
form.value.parentId = row.parentId;
|
|
|
|
|
}
|
|
|
|
|
getBaseMonitorInfo(row.objId).then((response) => {
|
|
|
|
|
form.value = response.data;
|
|
|
|
|
form.value = {
|
|
|
|
|
...createFormData(),
|
|
|
|
|
...(response.data ?? {})
|
|
|
|
|
};
|
|
|
|
|
open.value = true;
|
|
|
|
|
title.value = '修改计量设备信息';
|
|
|
|
|
});
|
|
|
|
|
@ -778,6 +937,8 @@ const getThresholdRuleList = () => {
|
|
|
|
|
const handleAddThreshold = () => {
|
|
|
|
|
resetThresholdForm();
|
|
|
|
|
thresholdForm.value.monitorId = currentDevice.value.monitorCode;
|
|
|
|
|
// 规则新增时同步保留隐藏技术字段,避免页面不展示后被前端对象重置掉。
|
|
|
|
|
thresholdForm.value.tenantId = currentDevice.value.tenantId ?? null;
|
|
|
|
|
thresholdFormTitle.value = '新增阈值规则';
|
|
|
|
|
thresholdFormOpen.value = true;
|
|
|
|
|
};
|
|
|
|
|
@ -811,6 +972,17 @@ const submitThresholdForm = () => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// 确保设备编号正确设置
|
|
|
|
|
thresholdForm.value.monitorId = currentDevice.value.monitorCode;
|
|
|
|
|
// 这些字段属于规则和点位之间的技术透传字段,页面不展示但提交时必须带齐。
|
|
|
|
|
thresholdForm.value.tenantId = currentDevice.value.tenantId ?? thresholdForm.value.tenantId;
|
|
|
|
|
thresholdForm.value.metricCode = currentDevice.value.metricCode ?? thresholdForm.value.metricCode;
|
|
|
|
|
thresholdForm.value.energyType = currentDevice.value.monitorType ?? thresholdForm.value.energyType;
|
|
|
|
|
if (thresholdForm.value.triggerRule === 0 && thresholdForm.value.alarmUpper != null) {
|
|
|
|
|
thresholdForm.value.triggerValue = thresholdForm.value.alarmUpper;
|
|
|
|
|
}
|
|
|
|
|
if (thresholdForm.value.triggerRule === 1 && thresholdForm.value.alarmLower != null) {
|
|
|
|
|
thresholdForm.value.triggerValue = thresholdForm.value.alarmLower;
|
|
|
|
|
}
|
|
|
|
|
thresholdForm.value.isEnable = thresholdForm.value.isEnable ?? '0';
|
|
|
|
|
if (thresholdForm.value.objId != null) {
|
|
|
|
|
updateRecordAlarmRule(thresholdForm.value).then((response) => {
|
|
|
|
|
proxy?.$modal.msgSuccess('修改成功');
|
|
|
|
|
@ -841,7 +1013,18 @@ const resetThresholdForm = () => {
|
|
|
|
|
timeRange: null,
|
|
|
|
|
triggerValue: null,
|
|
|
|
|
notifyUser: null,
|
|
|
|
|
cause: null
|
|
|
|
|
cause: null,
|
|
|
|
|
tenantId: null,
|
|
|
|
|
metricCode: null,
|
|
|
|
|
alarmUpper: null,
|
|
|
|
|
alarmLower: null,
|
|
|
|
|
recoverUpper: null,
|
|
|
|
|
recoverLower: null,
|
|
|
|
|
hysteresis: null,
|
|
|
|
|
durationSec: null,
|
|
|
|
|
alarmLevel: null,
|
|
|
|
|
notifyGroupId: null,
|
|
|
|
|
isEnable: '0'
|
|
|
|
|
};
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
if (thresholdFormRef.value) {
|
|
|
|
|
@ -854,6 +1037,9 @@ onMounted(() => {
|
|
|
|
|
getBaseEnergyTypeList({}).then((response) => {
|
|
|
|
|
energyTypeList.value = response.data;
|
|
|
|
|
});
|
|
|
|
|
getCollectDeviceInfo({}).then((response) => {
|
|
|
|
|
collectDeviceList.value = response.rows || response.data || [];
|
|
|
|
|
});
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|