From a0bcba512de0cd57db518b87981243caca242baf Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 23 May 2023 11:13:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A3=B0=E5=85=89=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/realTimeMonitor/index.vue | 45 ++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 9e04007..bad0d73 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -152,9 +152,20 @@ 关闭GPS --> - 声光报警 + + 声光报警 + + + 开启 + 关闭 + + + @@ -432,17 +443,35 @@ export default { this.$refs.setschedule_ref.getSingleAccess(this.channelId, this.cmdid); this.$refs.setschedule_ref.deviceList(); }, - handleWarn() { + handleCommandWarn(command) { + switch (command) { + case "open": //开启 + this.handleWarn(1); + break; + case "close": //关闭 + this.handleWarn(0); + break; + } + }, + //声光报警 + handleWarn(val) { console.log("声光报警"); console.log(this.cmdid); - alarmMarkJoggle({ cmdId: this.cmdid, ctrl: 1 }) + alarmMarkJoggle({ cmdId: this.cmdid, ctrl: val }) .then((res) => { console.log(res); if (res.code == 200) { - this.$message({ - message: "声光报警操作成功", - type: "success", - }); + if (val == 1) { + this.$message({ + message: "声光报警开启成功", + type: "success", + }); + } else { + this.$message({ + message: "声光报警关闭成功", + type: "success", + }); + } } }) .catch((err) => {