|
|
@ -22,7 +22,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="报警级别" prop="alarmLevelId">
|
|
|
|
<el-form-item label="报警级别" prop="alarmLevelId" v-if="false">
|
|
|
|
<el-select v-model="queryParams.alarmLevelId" placeholder="请选择报警级别" clearable>
|
|
|
|
<el-select v-model="queryParams.alarmLevelId" placeholder="请选择报警级别" clearable>
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="(alarmLevel, index) in alarmLevels"
|
|
|
|
v-for="(alarmLevel, index) in alarmLevels"
|
|
|
@ -184,11 +184,32 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改报警规则对话框 -->
|
|
|
|
<!-- 添加或修改报警规则对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="660px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="660px" append-to-body :before-close="cancel">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="130px" >
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
|
|
|
|
<el-form-item label="规则名称" prop="alarmRuleName">
|
|
|
|
<el-form-item label="规则名称" prop="alarmRuleName">
|
|
|
|
<el-input v-model="form.alarmRuleName" placeholder="请输入规则名称" style="width: 240px"/>
|
|
|
|
<el-input v-model="form.alarmRuleName" placeholder="请输入规则名称" style="width: 240px"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="报警级别" prop="alarmLevelId" v-if="false">
|
|
|
|
|
|
|
|
<el-select v-model="form.alarmLevelId" placeholder="请选择报警级别" style="width: 240px">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="(alarmLevel, index) in editedAlarmLevels"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:label="alarmLevel.alarmLevelName"
|
|
|
|
|
|
|
|
:value="alarmLevel.alarmLevelId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="报警类型" prop="alarmTypeId">
|
|
|
|
|
|
|
|
<el-select v-model="form.alarmTypeId" placeholder="请选择报警类型" style="width: 240px">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="(alarmType, index) in editedAlarmTypes"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:label="alarmType.alarmTypeName"
|
|
|
|
|
|
|
|
:value="alarmType.alarmTypeId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="所属场景" prop="sceneId">
|
|
|
|
<el-form-item label="所属场景" prop="sceneId">
|
|
|
|
<el-select v-model="form.sceneId" placeholder="请选择所属场景" @input="editedSceneChange"
|
|
|
|
<el-select v-model="form.sceneId" placeholder="请选择所属场景" @input="editedSceneChange"
|
|
|
@ -204,75 +225,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="设备模型" prop="deviceModeId">
|
|
|
|
<el-form-item label="报警级别" prop="alarmLevelId">
|
|
|
|
<el-select v-model="form.deviceModeId" placeholder="请选择设备模型" style="width: 240px" @change="modelChange">
|
|
|
|
<el-select v-model="form.alarmLevelId" placeholder="请选择报警级别" style="width: 240px">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="(alarmLevel, index) in editedAlarmLevels"
|
|
|
|
v-for="(i, index) in models"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
:label="alarmLevel.alarmLevelName"
|
|
|
|
:label="i.deviceModeName "
|
|
|
|
:value="alarmLevel.alarmLevelId"
|
|
|
|
:value="i.deviceModeId"
|
|
|
|
></el-option>
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="报警类型" prop="alarmTypeId">
|
|
|
|
|
|
|
|
<el-select v-model="form.alarmTypeId" placeholder="请选择报警类型" style="width: 240px">
|
|
|
|
<el-form-item label="设备" prop="ruleDeviceIds">
|
|
|
|
|
|
|
|
<el-select v-model="form.ruleDeviceIds" multiple placeholder="请选择设备" :disabled="editedDisabled"
|
|
|
|
|
|
|
|
@input="editedDeviceChange" style="width: 240px">
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="(alarmType, index) in editedAlarmTypes"
|
|
|
|
v-for="(device, index) in devicesOptions"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
:label="alarmType.alarmTypeName"
|
|
|
|
:label="device.deviceName"
|
|
|
|
:value="alarmType.alarmTypeId"
|
|
|
|
:value="device.deviceId"
|
|
|
|
></el-option>
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="触发时间间隔" prop="triggerTimeFrame">
|
|
|
|
<el-form-item label="设备属性" prop="ruleModeFunctionIdentifier">
|
|
|
|
<el-input v-model="form.triggerTimeFrame" placeholder="请输入时间(分)" style="width: 240px"/>
|
|
|
|
<el-select v-model="form.ruleModeFunctionIdentifier" placeholder="请选择设备属性"
|
|
|
|
</el-form-item>
|
|
|
|
:disabled="editedDisabled" style="width: 240px">
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="告警联系人" prop="phoneNumbers">
|
|
|
|
|
|
|
|
<el-select v-model="form.phoneNumbers" placeholder="请选择告警联系人" style="width: 240px">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="(i, index) in phoneList"
|
|
|
|
v-for="(deviceModeFunction, index) in editedDeviceModeAttributes"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
:label="i.nickName +'('+ i.phonenumber+')'"
|
|
|
|
:label="deviceModeFunction.functionName"
|
|
|
|
:value="i.phonenumber"
|
|
|
|
:value="deviceModeFunction.functionIdentifier"
|
|
|
|
></el-option>
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="触发时间间隔" prop="triggerTimeFrame">
|
|
|
|
<el-row>
|
|
|
|
<el-input v-model="form.triggerTimeFrame" placeholder="请输入时间(分)" style="width: 240px"/>
|
|
|
|
<el-col :span="12">
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="设备" prop="ruleDeviceId">
|
|
|
|
|
|
|
|
<el-select v-model="form.ruleDeviceId" placeholder="请选择设备" :disabled="editedDisabled"
|
|
|
|
|
|
|
|
@input="editedDeviceChange" style="width: 180px">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="(device, index) in editedDevices"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:label="device.deviceName"
|
|
|
|
|
|
|
|
:value="device.deviceId"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-form-item label="设备属性" prop="ruleModeFunctionIdentifier">
|
|
|
|
|
|
|
|
<el-select v-model="form.ruleModeFunctionIdentifier" placeholder="请选择设备属性"
|
|
|
|
|
|
|
|
:disabled="editedDisabled" style="width: 180px">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="(deviceModeFunction, index) in editedDeviceModeAttributes"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:label="deviceModeFunction.functionName"
|
|
|
|
|
|
|
|
:value="deviceModeFunction.functionIdentifier"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="触发条件" prop="triggerCondition">
|
|
|
|
<el-form-item label="触发条件" prop="triggerCondition">
|
|
|
|
<el-select v-model="form.triggerCondition" placeholder="请选择触发条件" @input="triggerConditionChange"
|
|
|
|
<el-select v-model="form.triggerCondition" placeholder="请选择触发条件" @input="triggerConditionChange"
|
|
|
|
:disabled="editedDisabled" style="width: 240px">
|
|
|
|
:disabled="editedDisabled" style="width: 240px">
|
|
|
@ -285,20 +274,15 @@
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-form-item label="A值" prop="triggerDataA">
|
|
|
|
|
|
|
|
<el-input v-model="form.triggerDataA" placeholder="请输入A值" :disabled="editedDisabled" style="width: 180px"/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-form-item label="B值" prop="triggerDataB" v-if="triggerDataBVisible">
|
|
|
|
|
|
|
|
<el-input v-model="form.triggerDataB" placeholder="请输入B值" :disabled="editedDisabled" style="width: 180px"/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="A值" prop="triggerDataA">
|
|
|
|
|
|
|
|
<el-input v-model="form.triggerDataA" placeholder="请输入A值" :disabled="editedDisabled"
|
|
|
|
|
|
|
|
style="width: 240px"/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="B值" prop="triggerDataB" v-if="triggerDataBVisible">
|
|
|
|
|
|
|
|
<el-input v-model="form.triggerDataB" placeholder="请输入B值" :disabled="editedDisabled"
|
|
|
|
|
|
|
|
style="width: 240px"/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="状态" prop="alarmRuleStatus">
|
|
|
|
<el-form-item label="状态" prop="alarmRuleStatus">
|
|
|
|
<el-radio-group v-model="form.alarmRuleStatus">"
|
|
|
|
<el-radio-group v-model="form.alarmRuleStatus">"
|
|
|
|
<el-radio
|
|
|
|
<el-radio
|
|
|
@ -377,6 +361,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="告警联系人" prop="phoneNumbers">
|
|
|
|
|
|
|
|
<el-input v-model="form.phoneNumbers" type="text" placeholder="请输入内容" style="width: 240px"/>
|
|
|
|
|
|
|
|
<!-- <el-select v-model="form.phoneNumbers" placeholder="请选择告警联系人" style="width: 240px">-->
|
|
|
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
|
|
|
|
<!-- v-for="(i, index) in phoneList"-->
|
|
|
|
|
|
|
|
<!-- :key="index"-->
|
|
|
|
|
|
|
|
<!-- :label="i.nickName +'('+ i.phonenumber+')'"-->
|
|
|
|
|
|
|
|
<!-- :value="i.phonenumber"-->
|
|
|
|
|
|
|
|
<!-- ></el-option>-->
|
|
|
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="描述" prop="remark">
|
|
|
|
<el-form-item label="描述" prop="remark">
|
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
@ -461,8 +457,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
listAlarmRule, getAlarmRule, delAlarmRule, addAlarmRule, updateAlarmRule,
|
|
|
|
listAlarmRule,
|
|
|
|
getScenes, getEditedScenes, getSelectListBySceneId, getDeviceModeByDeviceId, getModeFunctionParametersByModeFunctionId
|
|
|
|
getAlarmRule,
|
|
|
|
|
|
|
|
delAlarmRule,
|
|
|
|
|
|
|
|
addAlarmRule,
|
|
|
|
|
|
|
|
updateAlarmRule,
|
|
|
|
|
|
|
|
getScenes,
|
|
|
|
|
|
|
|
getEditedScenes,
|
|
|
|
|
|
|
|
getSelectListBySceneId,
|
|
|
|
|
|
|
|
getDeviceModeByDeviceId,
|
|
|
|
|
|
|
|
getModeFunctionParametersByModeFunctionId,
|
|
|
|
|
|
|
|
getDeviceByModel
|
|
|
|
} from "@/api/business/alarmRule";
|
|
|
|
} from "@/api/business/alarmRule";
|
|
|
|
import {addDeviceModeFunction} from "@/api/business/deviceModeFunction";
|
|
|
|
import {addDeviceModeFunction} from "@/api/business/deviceModeFunction";
|
|
|
|
import {listUser} from "../../../api/system/user";
|
|
|
|
import {listUser} from "../../../api/system/user";
|
|
|
@ -478,6 +483,8 @@ export default {
|
|
|
|
DATA_MORE_THAN_A_AND_LESS_THAN_B: 3,//大于A且小于B
|
|
|
|
DATA_MORE_THAN_A_AND_LESS_THAN_B: 3,//大于A且小于B
|
|
|
|
DATA_LESS_THAN_A_OR_MORE_THAN_B: 4,//小于A或大于B
|
|
|
|
DATA_LESS_THAN_A_OR_MORE_THAN_B: 4,//小于A或大于B
|
|
|
|
LINK_FLAG_YES: "1",
|
|
|
|
LINK_FLAG_YES: "1",
|
|
|
|
|
|
|
|
models: [],
|
|
|
|
|
|
|
|
devicesOptions: [],
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
|
loading: true,
|
|
|
|
loading: true,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
@ -532,13 +539,13 @@ export default {
|
|
|
|
sceneId: [
|
|
|
|
sceneId: [
|
|
|
|
{required: true, message: "所属场景不能为空", trigger: "change"}
|
|
|
|
{required: true, message: "所属场景不能为空", trigger: "change"}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
alarmLevelId: [
|
|
|
|
// alarmLevelId: [
|
|
|
|
{required: true, message: "报警级别不能为空", trigger: "change"}
|
|
|
|
// {required: true, message: "报警级别不能为空", trigger: "change"}
|
|
|
|
],
|
|
|
|
// ],
|
|
|
|
alarmTypeId: [
|
|
|
|
alarmTypeId: [
|
|
|
|
{required: true, message: "报警类型不能为空", trigger: "change"}
|
|
|
|
{required: true, message: "报警类型不能为空", trigger: "change"}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
ruleDeviceId: [
|
|
|
|
ruleDeviceIds: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
required: true,
|
|
|
|
message: "设备不能为空",
|
|
|
|
message: "设备不能为空",
|
|
|
@ -599,11 +606,12 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
alarmRuleFlag: "1",
|
|
|
|
alarmRuleFlag: "1",
|
|
|
|
editedScenes: [],
|
|
|
|
editedScenes: [],
|
|
|
|
editedDisabled: true,
|
|
|
|
editedDisabled: false,
|
|
|
|
sceneDisabled: true,
|
|
|
|
sceneDisabled: false,
|
|
|
|
editedAlarmLevels: [],
|
|
|
|
editedAlarmLevels: [],
|
|
|
|
editedAlarmTypes: [],
|
|
|
|
editedAlarmTypes: [],
|
|
|
|
editedDevices: [],
|
|
|
|
editedDevices: [],
|
|
|
|
|
|
|
|
editedModels: [],
|
|
|
|
editedDeviceModeAttributes: [],
|
|
|
|
editedDeviceModeAttributes: [],
|
|
|
|
editedDeviceModeServices: [],
|
|
|
|
editedDeviceModeServices: [],
|
|
|
|
|
|
|
|
|
|
|
@ -633,6 +641,11 @@ export default {
|
|
|
|
this.getPhoneList()
|
|
|
|
this.getPhoneList()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
modelChange(modelId) {
|
|
|
|
|
|
|
|
getDeviceByModel({modelId: modelId}).then(e => {
|
|
|
|
|
|
|
|
this.devicesOptions = e.data
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
getPhoneList() {
|
|
|
|
getPhoneList() {
|
|
|
|
listUser({
|
|
|
|
listUser({
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
@ -659,6 +672,7 @@ export default {
|
|
|
|
// 表单重置
|
|
|
|
// 表单重置
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
|
this.editedDeviceModeAttributes = [];
|
|
|
|
this.editedDeviceModeAttributes = [];
|
|
|
|
|
|
|
|
this.models = []
|
|
|
|
this.editedDevices = [];
|
|
|
|
this.editedDevices = [];
|
|
|
|
this.editedAlarmTypes = [];
|
|
|
|
this.editedAlarmTypes = [];
|
|
|
|
this.editedAlarmLevels = [];
|
|
|
|
this.editedAlarmLevels = [];
|
|
|
@ -672,10 +686,11 @@ export default {
|
|
|
|
alarmLevelId: null,
|
|
|
|
alarmLevelId: null,
|
|
|
|
alarmTypeId: null,
|
|
|
|
alarmTypeId: null,
|
|
|
|
ruleType: '2',
|
|
|
|
ruleType: '2',
|
|
|
|
ruleDeviceId: null,
|
|
|
|
|
|
|
|
ruleFunctionTotal: null,
|
|
|
|
ruleFunctionTotal: null,
|
|
|
|
linkFlag: "0",
|
|
|
|
linkFlag: "0",
|
|
|
|
alarmRuleStatus: "1",
|
|
|
|
alarmRuleStatus: "1",
|
|
|
|
|
|
|
|
ruleDeviceId: null,
|
|
|
|
|
|
|
|
ruleDeviceIds: [],
|
|
|
|
alarmPushFlag: "0",
|
|
|
|
alarmPushFlag: "0",
|
|
|
|
alarmPushContent: null,
|
|
|
|
alarmPushContent: null,
|
|
|
|
alarmRecoverContent: null,
|
|
|
|
alarmRecoverContent: null,
|
|
|
@ -691,7 +706,7 @@ export default {
|
|
|
|
triggerDataB: null,
|
|
|
|
triggerDataB: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.hwAlarmRuleDetailList = [];
|
|
|
|
this.hwAlarmRuleDetailList = [];
|
|
|
|
this.resetForm("form");
|
|
|
|
// this.resetForm("form");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
/** 搜索按钮操作 */
|
|
|
@ -722,20 +737,29 @@ export default {
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
handleUpdate(row) {
|
|
|
|
handleUpdate(row) {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
this.sceneDisabled = true;
|
|
|
|
this.sceneDisabled = false;
|
|
|
|
this.getEditedScenes();
|
|
|
|
this.getEditedScenes();
|
|
|
|
const alarmRuleId = row.alarmRuleId || this.ids
|
|
|
|
const alarmRuleId = row.alarmRuleId || this.ids
|
|
|
|
|
|
|
|
|
|
|
|
getAlarmRule(alarmRuleId).then(response => {
|
|
|
|
getAlarmRule(alarmRuleId).then(response => {
|
|
|
|
|
|
|
|
console.log(response.data.ruleDeviceId)
|
|
|
|
this.form = response.data;
|
|
|
|
this.form = response.data;
|
|
|
|
this.editedDisabled = response.data.alarmInfoFlag === "1";
|
|
|
|
this.editedDisabled = response.data.alarmInfoFlag === "1";
|
|
|
|
this.getEditedSelectListBySceneId(this.form.sceneId);
|
|
|
|
this.getEditedSelectListBySceneId(this.form.sceneId);
|
|
|
|
this.getDeviceModeByDeviceId(this.form.ruleDeviceId);
|
|
|
|
this.getDeviceModeByDeviceId(response.data.ruleDeviceId);
|
|
|
|
this.triggerDataBVisibleJudge(this.form.triggerCondition);
|
|
|
|
this.triggerDataBVisibleJudge(this.form.triggerCondition);
|
|
|
|
this.alarmRuleLinkData = response.data.hwAlarmRuleLinkList;
|
|
|
|
this.alarmRuleLinkData = response.data.hwAlarmRuleLinkList;
|
|
|
|
this.alarmRuleLinkVisible = response.data.linkFlag === this.LINK_FLAG_YES;
|
|
|
|
this.alarmRuleLinkVisible = response.data.linkFlag === this.LINK_FLAG_YES;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改报警规则";
|
|
|
|
this.title = "修改报警规则";
|
|
|
|
|
|
|
|
getSelectListBySceneId(response.data.sceneId).then(e => {
|
|
|
|
|
|
|
|
this.models = e.data["models"];
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getDeviceByModel({modelId: response.data.deviceModeId}).then(e => {
|
|
|
|
|
|
|
|
console.log(e.data)
|
|
|
|
|
|
|
|
this.devicesOptions = e.data
|
|
|
|
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 提交按钮 */
|
|
|
@ -851,6 +875,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
getEditedSelectListBySceneId(sceneId) {
|
|
|
|
getEditedSelectListBySceneId(sceneId) {
|
|
|
|
getSelectListBySceneId(sceneId).then(response => {
|
|
|
|
getSelectListBySceneId(sceneId).then(response => {
|
|
|
|
|
|
|
|
this.models = response.data["models"];
|
|
|
|
this.editedDevices = response.data["devices"];
|
|
|
|
this.editedDevices = response.data["devices"];
|
|
|
|
this.editedAlarmTypes = response.data["alarmTypes"];
|
|
|
|
this.editedAlarmTypes = response.data["alarmTypes"];
|
|
|
|
this.editedAlarmLevels = response.data["alarmLevels"];
|
|
|
|
this.editedAlarmLevels = response.data["alarmLevels"];
|
|
|
@ -858,12 +883,14 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
editedSceneChange(sceneId) {
|
|
|
|
editedSceneChange(sceneId) {
|
|
|
|
|
|
|
|
this.models = []
|
|
|
|
this.editedDevices = [];
|
|
|
|
this.editedDevices = [];
|
|
|
|
this.editedAlarmTypes = [];
|
|
|
|
this.editedAlarmTypes = [];
|
|
|
|
this.editedAlarmLevels = [];
|
|
|
|
this.editedAlarmLevels = [];
|
|
|
|
this.editedDeviceModeAttributes = [];
|
|
|
|
this.editedDeviceModeAttributes = [];
|
|
|
|
this.form.alarmTypeId = null;
|
|
|
|
this.form.alarmTypeId = null;
|
|
|
|
this.form.alarmLevelId = null;
|
|
|
|
this.form.alarmLevelId = null;
|
|
|
|
|
|
|
|
this.form.ruleDeviceIds = []
|
|
|
|
this.form.ruleDeviceId = null;
|
|
|
|
this.form.ruleDeviceId = null;
|
|
|
|
this.form.ruleModeFunctionIdentifier = null;
|
|
|
|
this.form.ruleModeFunctionIdentifier = null;
|
|
|
|
this.alarmRuleLinkData = [];
|
|
|
|
this.alarmRuleLinkData = [];
|
|
|
@ -881,8 +908,10 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
editedDeviceChange(deviceId) {
|
|
|
|
editedDeviceChange(deviceId) {
|
|
|
|
|
|
|
|
if (Array.isArray(deviceId) ? deviceId?.[0] : deviceId) {
|
|
|
|
|
|
|
|
this.getDeviceModeByDeviceId(Array.isArray(deviceId) ? deviceId?.[0] : deviceId);
|
|
|
|
|
|
|
|
}
|
|
|
|
this.form.ruleModeFunctionIdentifier = null;
|
|
|
|
this.form.ruleModeFunctionIdentifier = null;
|
|
|
|
this.getDeviceModeByDeviceId(deviceId);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
triggerDataBVisibleJudge(triggerCondition) {
|
|
|
|
triggerDataBVisibleJudge(triggerCondition) {
|
|
|
@ -911,7 +940,7 @@ export default {
|
|
|
|
this.alarmRuleLinkForm.linkDeviceFunctionId = null;
|
|
|
|
this.alarmRuleLinkForm.linkDeviceFunctionId = null;
|
|
|
|
const selectedOption = this.editedDevices.find(option => option.deviceId === deviceId);
|
|
|
|
const selectedOption = this.editedDevices.find(option => option.deviceId === deviceId);
|
|
|
|
this.alarmRuleLinkForm.linkDeviceName = selectedOption.deviceName;
|
|
|
|
this.alarmRuleLinkForm.linkDeviceName = selectedOption.deviceName;
|
|
|
|
this.getDeviceModeServicesByDeviceId(deviceId);
|
|
|
|
this.getDeviceModeServicesByDeviceId(deviceId?.[0]);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
editedLinkDeviceModeServiceChange(modeFunctionId) {
|
|
|
|
editedLinkDeviceModeServiceChange(modeFunctionId) {
|
|
|
|