[前台] 修改即時告警

This commit is contained in:
dev02 2023-05-31 13:24:05 +08:00
parent d541e72dd6
commit fb453a90c9

View File

@ -220,6 +220,8 @@
first = true; first = true;
let dataAlarm = []; let dataAlarm = [];
var historyTable = null; var historyTable = null;
var elemIndex = 0;
var index = 0;
$(function () { $(function () {
initDropzone(); initDropzone();
@ -254,7 +256,7 @@
//}); //});
if (pageAct.SysType == "all") { if (pageAct.SysType == "all") {
if (!$(this).is(':checked')) { if ($(this).is(':checked')) {
$(this).prop('checked', true); $(this).prop('checked', true);
$(this).click(); $(this).click();
} }
@ -639,7 +641,10 @@
} }
else { else {
let elem = $('input[type=checkbox][data-type=sub]:checked'); let elem = $('input[type=checkbox][data-type=sub]:checked');
elemIndex = 0;
index = 0;
if (elem && elem.length > 0) { if (elem && elem.length > 0) {
elemIndex = elem.length;
elem.each(function (i, v) { elem.each(function (i, v) {
if (v?.id === "other") { if (v?.id === "other") {
console.log(v?.id) console.log(v?.id)
@ -663,7 +668,10 @@
res.data.forEach(v => { res.data.forEach(v => {
dataAlarm.push(v); dataAlarm.push(v);
}); });
callBackFromOneDeviceAlert(dataAlarm); index++;
if (elemIndex == index)
callBackFromOneDeviceAlert(dataAlarm);
} }
function callBackFromAllDeviceAlert(res) { function callBackFromAllDeviceAlert(res) {