Commit c76792b9 authored by 纪泽龙's avatar 纪泽龙

报警提示

parent 7f149901
...@@ -737,6 +737,7 @@ export default { ...@@ -737,6 +737,7 @@ export default {
}); });
// 管道 // 管道
console.log("polyLineArr", polyLineArr); console.log("polyLineArr", polyLineArr);
let errorObj;
if (polyLineArr.length > 0) { if (polyLineArr.length > 0) {
polyLineArr.forEach((item) => { polyLineArr.forEach((item) => {
// 获取循报警设备的id // 获取循报警设备的id
...@@ -758,7 +759,7 @@ export default { ...@@ -758,7 +759,7 @@ export default {
if (polyline) { if (polyline) {
let options = polyline.getExtData(); let options = polyline.getExtData();
errorObj = polyline;
// 增加一个报警状态 // 增加一个报警状态
// 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来 // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
options.lineData.view = this; options.lineData.view = this;
...@@ -832,6 +833,7 @@ export default { ...@@ -832,6 +833,7 @@ export default {
})[0]; })[0];
if (device) { if (device) {
const options = device.getExtData(); const options = device.getExtData();
errorObj = device;
// 增加一个报警状态 // 增加一个报警状态
// 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来 // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
options.view = this; options.view = this;
...@@ -855,6 +857,7 @@ export default { ...@@ -855,6 +857,7 @@ export default {
options.alarmValue = alarmValue; options.alarmValue = alarmValue;
} }
device.setExtData(options); device.setExtData(options);
device.setzIndex(13);
// 找到是列表里的哪个,改变它的状态,让列表里的这个设备变成红色 // 找到是列表里的哪个,改变它的状态,让列表里的这个设备变成红色
const myDevice = this.allList const myDevice = this.allList
...@@ -907,9 +910,24 @@ export default { ...@@ -907,9 +910,24 @@ export default {
} }
}); });
} }
this.openError(errorObj.getExtData());
this.$refs.Bottom.repeatClick();
if (this.ws) return; if (this.ws) return;
this.socket(); this.socket();
}, },
// 右边弹框
openError(options) {
this.$notify({
title: `${options.deviceName}报警`,
dangerouslyUseHTMLString: true,
message: `<div>
<div style="color:#000">设备名称:${options.deviceName}</div>
<div style="color:#000">设备编号:${options.iotNo}</div>
</div>`,
type: "warning",
});
},
socket() { socket() {
console.log("socket执行"); console.log("socket执行");
this.ws = new WebSocket( this.ws = new WebSocket(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment