102主从机告警
This commit is contained in:
@ -46,11 +46,10 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="warnnig" :class="(formData.sta_Intrusion===1)?'':'displayNone'"
|
<view class="warnnig" :class="{'displayNone':formData.sta_sosadd===''}">
|
||||||
>
|
|
||||||
<view>闯入报警!</view>
|
<view>闯入报警!</view>
|
||||||
<view class="netContent">
|
<view class="netContent">
|
||||||
{{formData.sta_IntrusTime}}s
|
{{getWarDevice(formData.sta_sosadd)}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -66,13 +65,6 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="lamp">
|
<view class="lamp">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<text>警示灯</text>
|
<text>警示灯</text>
|
||||||
@ -267,7 +259,7 @@
|
|||||||
sta_RadarType: '',
|
sta_RadarType: '',
|
||||||
sta_Online: '',
|
sta_Online: '',
|
||||||
warnTime: '',
|
warnTime: '',
|
||||||
sta_Intrusion: 0,
|
sta_sosadd: "",
|
||||||
sta_IntrusTime: ''
|
sta_IntrusTime: ''
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -356,7 +348,7 @@
|
|||||||
detailPageUrl: "/pages/650/HBY650",
|
detailPageUrl: "/pages/650/HBY650",
|
||||||
showConfirm: false
|
showConfirm: false
|
||||||
},
|
},
|
||||||
|
groupDevices: [],
|
||||||
audioData: {
|
audioData: {
|
||||||
packetCtn: 0,
|
packetCtn: 0,
|
||||||
hexs: []
|
hexs: []
|
||||||
@ -422,7 +414,7 @@
|
|||||||
these.formData.bleStatu = true;
|
these.formData.bleStatu = true;
|
||||||
});
|
});
|
||||||
these.formData.sta_IntrusTime = 0;
|
these.formData.sta_IntrusTime = 0;
|
||||||
these.formData.sta_Intrusion=0;
|
these.formData.sta_sosadd = "";
|
||||||
these.setBleFormData();
|
these.setBleFormData();
|
||||||
|
|
||||||
|
|
||||||
@ -744,8 +736,21 @@
|
|||||||
urls: [img]
|
urls: [img]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getWarDevice(macStr){//获取正在报警的设备名
|
||||||
|
let f = this.groupDevices.find(v => {
|
||||||
|
return v.deviceMac === macStr;
|
||||||
|
});
|
||||||
|
if (f) {
|
||||||
|
return f.deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
bleValueNotify: function(receive, device, path, recArr) { //订阅消息
|
if(macStr == this.device.deviceMac) {
|
||||||
|
return this.device.deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
bleValueNotify(receive, device, path, recArr) { //订阅消息
|
||||||
if (receive.deviceId !== this.formData.deviceId) {
|
if (receive.deviceId !== this.formData.deviceId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -770,19 +775,28 @@
|
|||||||
msg.push("设备电量低");
|
msg.push("设备电量低");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.formData.sta_Intrusion === 1) {
|
|
||||||
msg.push("闯入报警中");
|
if (this.formData.sta_sosadd !== "") {
|
||||||
clearInterval(instrusionTime);
|
this.searchDevice(this.formData.sta_sosadd).catch(ex => {}).then(dev => {
|
||||||
instrusionTime = 0;
|
if (dev) {
|
||||||
setInterval(() => {
|
msg.push('"' + dev.deviceName + '"闯入报警中');
|
||||||
instrusionTime++;
|
} else {
|
||||||
if(instrusionTime>60){
|
msg.push('闯入报警中');
|
||||||
this.formData.sta_Intrusion=0;
|
|
||||||
clearInterval(instrusionTime);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.formData.sta_IntrusTime=instrusionTime;
|
this.showMsg(msg.join(','));
|
||||||
}, 1000);
|
});
|
||||||
|
return;
|
||||||
|
// clearInterval(instrusionTime);
|
||||||
|
// instrusionTime = 0;
|
||||||
|
// setInterval(() => {
|
||||||
|
// instrusionTime++;
|
||||||
|
// if(instrusionTime>60){
|
||||||
|
// this.formData.sta_sosadd="";
|
||||||
|
// clearInterval(instrusionTime);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// this.formData.sta_IntrusTime=instrusionTime;
|
||||||
|
// }, 1000);
|
||||||
} else {
|
} else {
|
||||||
clearInterval(instrusionTime);
|
clearInterval(instrusionTime);
|
||||||
instrusionTime = 0;
|
instrusionTime = 0;
|
||||||
@ -793,6 +807,59 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
searchDevice(macStr) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (macStr.includes(':')) {
|
||||||
|
macStr = macStr;
|
||||||
|
} else {
|
||||||
|
macStr = macStr.replace(/(.{2})/g, '$1:').slice(0, -1)
|
||||||
|
}
|
||||||
|
|
||||||
|
let f = this.groupDevices.find(v => {
|
||||||
|
return v.deviceMac === macStr;
|
||||||
|
});
|
||||||
|
if (f) {
|
||||||
|
resolve(f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (macStr == this.device.deviceMac) {
|
||||||
|
resolve(this.device);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
request({
|
||||||
|
url: '/app/device/getDeviceInfoByDeviceMac',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
deviceMac: these.device.macAddress
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
|
||||||
|
console.log("获取设备信息", res);
|
||||||
|
if (res && res.code == 200) {
|
||||||
|
console.log("res=", res);
|
||||||
|
let data = res.data;
|
||||||
|
if (data) {
|
||||||
|
this.groupDevices.push({
|
||||||
|
deviceMac: data.deviceMac,
|
||||||
|
deviceName: data.deviceName
|
||||||
|
})
|
||||||
|
resolve(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(null);
|
||||||
|
|
||||||
|
}).catch(ex => {
|
||||||
|
|
||||||
|
resolve(null);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getDevice: function() {
|
getDevice: function() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user