Browse Source

Sincronização dos cronometros e conserto do cronometro do painel

Websocket_painel
AlGouvea 3 years ago
parent
commit
186e909e0a
  1. 16
      frontend/src/__apps/painel/main.js
  2. 2
      sapl/templates/sessao/painel.html

16
frontend/src/__apps/painel/main.js

@ -196,12 +196,7 @@ const v = new Vue({ // eslint-disable-line
this.running = 0
clearInterval(this.started)
this.stopped = setInterval(() => {
this.timeStopped()
}, 100)
},
timeStopped () {
timeEnd.setMilliseconds(timeEnd.getMilliseconds() + 100)
console.log(time)
},
reset: function reset () {
this.running = 0
@ -239,17 +234,20 @@ const v = new Vue({ // eslint-disable-line
crono = temp_crono
if (time === null) {
time = cronometroStart[crono - 1]
console.log(time)
timeEnd = new Date()
timeEnd.setSeconds(timeEnd.getSeconds() + time)
console.log(timeEnd)
} else {
clearInterval(this.stopped)
timeEnd = new Date()
timeEnd.setMinutes(timeEnd.getMinutes() + time.getMinutes())
timeEnd.setSeconds(timeEnd.getSeconds() + time.getSeconds() + 1)
clearInterval(this.timeStopped)
}
this.running = crono
this.started = setInterval(() => {
this.clockRunning(crono)
}, 100)
}, 50)
}
},
created () {

2
sapl/templates/sessao/painel.html

@ -113,7 +113,7 @@ $(function() {
$("#relogio").text(h+":"+m+":"+s)
var t = setTimeout(function(){
startTime()
},500);
},100);
}
startTime();

Loading…
Cancel
Save