update Mo 15. Jun 01:01:02 CEST 2020

This commit is contained in:
Robert Richter 2020-06-15 01:01:02 +02:00
parent 4106796cdc
commit a32d6adf5a
2 changed files with 21 additions and 26 deletions

View File

@ -16,7 +16,7 @@ $(window).on('resize', function () {
var waipAudio = document.getElementById('audio'); var waipAudio = document.getElementById('audio');
waipAudio.addEventListener('ended', function(){ waipAudio.addEventListener('ended', function () {
$('.ion-md-pause').toggleClass('ion-md-play-circle'); $('.ion-md-pause').toggleClass('ion-md-play-circle');
}); });
@ -292,6 +292,7 @@ socket.on('io.standby', function (data) {
$('#em_alarmiert').empty(); $('#em_alarmiert').empty();
$('#em_weitere').html(''); $('#em_weitere').html('');
reset_rmld(); reset_rmld();
recount_rmld();
map.setView(new L.LatLng(0, 0), 14); map.setView(new L.LatLng(0, 0), 14);
// Tareset_responsebleau ausblenden // Tareset_responsebleau ausblenden
$('#waiptableau').addClass('d-none'); $('#waiptableau').addClass('d-none');
@ -443,14 +444,14 @@ socket.on('io.new_rmld', function (data) {
var pg_waip_uuid = arrayItem.waip_uuid; var pg_waip_uuid = arrayItem.waip_uuid;
console.log(arrayItem.waip_uuid); console.log(arrayItem.waip_uuid);
console.log(pg_waip_uuid); console.log(pg_waip_uuid);
var pg_rmld_uuid = arrayItem.rmld_uuid; var pg_rmld_uuid = arrayItem.rmld_uuid;
var pg_start = new Date(arrayItem.set_time); var pg_start = new Date(arrayItem.set_time);
var pg_end = new Date(arrayItem.arrival_time); var pg_end = new Date(arrayItem.arrival_time);
// Progressbar hinterlegen // Progressbar hinterlegen
add_resp_progressbar(pg_waip_uuid, pg_rmld_uuid, item_type, item_agt, pg_start, pg_end); add_resp_progressbar(pg_waip_uuid, pg_rmld_uuid, item_type, item_agt, pg_start, pg_end);
// Anzahl der Rückmeldung zählen // Anzahl der Rückmeldung zählen
recount_rmld(pg_waip_uuid); recount_rmld(pg_waip_uuid);
}); });
// Text anpassen // Text anpassen
resize_text(); resize_text();
}); });
@ -463,24 +464,19 @@ var counter_rmld = [];
function reset_rmld(p_uuid) { function reset_rmld(p_uuid) {
var bar_uuid = 'bar-' + p_uuid; var bar_uuid = 'bar-' + p_uuid;
$('#pg-ek').children().each(function(i) { $('#pg-ek').children().each(function (i) {
console.log('ein gefunden'); if (!$(this).hasClass(bar_uuid)) {
console.log(this); $(this).remove();
if ($(this).hasClass(bar_uuid)) {
console.log('hier');
$(this).remove;
}; };
}); });
$('#pg-ma').children().each(function(i) { $('#pg-ma').children().each(function (i) {
if (!$(this).hasClass(bar_uuid)) { if (!$(this).hasClass(bar_uuid)) {
$(this).remove; $(this).remove();
}; };
}); });
$('#pg-fk').children().each(function(i) { $('#pg-fk').children().each(function (i) {
if (!$(this).hasClass(bar_uuid)) { if (!$(this).hasClass(bar_uuid)) {
$(this).remove; $(this).remove();
}; };
}); });
/*$('#pg-ek').empty(); /*$('#pg-ek').empty();
@ -570,39 +566,39 @@ function recount_rmld(p_uuid) {
$('#fk-counter').text(0); $('#fk-counter').text(0);
$('#agt-counter').text(0); $('#agt-counter').text(0);
// EK zählen // EK zählen
$('#pg-ek').children().each(function(i) { $('#pg-ek').children().each(function (i) {
if ($(this).hasClass(bar_uuid)) { if ($(this).hasClass(bar_uuid)) {
var tmp_count = parseInt($('#ek-counter').text()); var tmp_count = parseInt($('#ek-counter').text());
$('#ek-counter').text(tmp_count + 1); $('#ek-counter').text(tmp_count + 1);
if ($(this).hasClass('border-warning')) { if ($(this).hasClass('border-warning')) {
agt_count++; agt_count++;
}; };
}; };
}); });
// MA zählen // MA zählen
$('#pg-ma').children().each(function(i) { $('#pg-ma').children().each(function (i) {
if ($(this).hasClass(bar_uuid)) { if ($(this).hasClass(bar_uuid)) {
var tmp_count = parseInt($('#ma-counter').text()); var tmp_count = parseInt($('#ma-counter').text());
$('#ma-counter').text(tmp_count + 1); $('#ma-counter').text(tmp_count + 1);
if ($(this).hasClass('border-warning')) { if ($(this).hasClass('border-warning')) {
agt_count++; agt_count++;
}; };
}; };
}); });
// FK zählen // FK zählen
$('#pg-fk').children().each(function(i) { $('#pg-fk').children().each(function (i) {
if ($(this).hasClass(bar_uuid)) { if ($(this).hasClass(bar_uuid)) {
var tmp_count = parseInt($('#fk-counter').text()); var tmp_count = parseInt($('#fk-counter').text());
$('#fk-counter').text(tmp_count + 1); $('#fk-counter').text(tmp_count + 1);
if ($(this).hasClass('border-warning')) { if ($(this).hasClass('border-warning')) {
agt_count++; agt_count++;
}; };
}; };
}); });
// AGT setzen // AGT setzen
$('#agt-counter').text(agt_count); $('#agt-counter').text(agt_count);
// Rückmeldecontainer anzeigen/ausblenden // Rückmeldecontainer anzeigen/ausblenden
if ($('#ek-counter').text() == '0' && $('#ma-counter').text() == '0' && $('#fk-counter').text() == '0' && $('#agt-counter').text() == '0') { if ($('#ek-counter').text() == '0' && $('#ma-counter').text() == '0' && $('#fk-counter').text() == '0' && $('#agt-counter').text() == '0') {
$('#rmld_container').addClass('d-none'); $('#rmld_container').addClass('d-none');
} else { } else {
$('#rmld_container').removeClass('d-none'); $('#rmld_container').removeClass('d-none');
@ -649,7 +645,7 @@ function set_clock() {
// Easter-Egg :-) // Easter-Egg :-)
if (element_time == '13:37') { if (element_time == '13:37') {
element_time = '1337' element_time = '1337'
}; };
// nur erneuern wenn sich Zeit geändert hat // nur erneuern wenn sich Zeit geändert hat
if ($('#time').text() !== element_time) { if ($('#time').text() !== element_time) {
// Uhrzeit anzeigen // Uhrzeit anzeigen

View File

@ -839,7 +839,7 @@ module.exports = function (db, uuidv4, app_cfg) {
function db_rmld_loeschen(waip_uuid) { function db_rmld_loeschen(waip_uuid) {
// Rueckmeldungen löschen // Rueckmeldungen löschen
db.run(`DELETE FROM waip_response WHERE waip_uuid = `, [waip_uuid]); db.run(`DELETE FROM waip_response WHERE waip_uuid = ?`, [waip_uuid]);
}; };
function db_vmtl_get_list(waip_id, callback) { function db_vmtl_get_list(waip_id, callback) {
@ -885,7 +885,6 @@ module.exports = function (db, uuidv4, app_cfg) {
// DEBUG // DEBUG
if (app_cfg.global.development) { if (app_cfg.global.development) {
console.log('Export-Liste RMLD: ' + JSON.stringify(arry_wachen)); console.log('Export-Liste RMLD: ' + JSON.stringify(arry_wachen));
console.log(arry_wachen.join(', '));
}; };
// nur weiter machen wenn arry_wachen nicht leer, weil z.b. keine Rueckmeldungen vorhanden sind // nur weiter machen wenn arry_wachen nicht leer, weil z.b. keine Rueckmeldungen vorhanden sind
if (arry_wachen.length > 0) { if (arry_wachen.length > 0) {