melissa/cronometro: pre-selecionar paciente + sessionPlan + confirm fechar
MelissaCronometro.abrir() agora aceita opts { pacienteId, autostart,
sessionPlan }. Retorna { opened, alreadyRunning, samePaciente, ... }
pra caller decidir o feedback. Estado sessionPlan { startH, endH }
exibe "Programado: HH:MM – HH:MM" sob o select + badge laranja
"atrasada Xmin" quando hNow > startH. Cronometro NAO auto-ajusta —
analista decide quando comecar/parar. Tick a 30s atualiza atraso.
sessionPlan persiste no localStorage junto com o snapshot.
X agora dispara confirmarFechar(): pede ConfirmDialog quando ha
sessao em andamento OU tempo decorrido nao salvo; fecha direto se
clean. Tooltip mudou pra "Encerrar sem salvar".
Chip minimizado: nome do paciente fica display:none em <md (mobile)
pra nao estourar largura do dock — icone + timer cobrem o essencial.
MelissaTimelineHoje: botao ⏱ overlay no canto sup. direito das pills
(horizontal + vertical) quando ev esta em curso E tem patient_id.
Pulso emerald sutil pra chamar atencao; @click.stop pra nao abrir
o evento. Novo emit iniciar-cronometro(ev).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,13 @@ const props = defineProps({
|
||||
filtroTipo: { type: String, default: null }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['evento', 'clear-filter']);
|
||||
const emit = defineEmits(['evento', 'clear-filter', 'iniciar-cronometro']);
|
||||
|
||||
// Helper exposto no template: mostra o botao ⏱ so quando o evento esta
|
||||
// em curso E tem patient_id (atividade livre/bloqueio nao tem paciente).
|
||||
function podeIniciarCrono(ev) {
|
||||
return isEvEmCurso(ev) && !!ev?.patient_id;
|
||||
}
|
||||
|
||||
// ───────────────────────────────────────────────────────────────
|
||||
// Range de horas (HORA_INICIO/HORA_FIM) — derivado de:
|
||||
@@ -382,6 +388,19 @@ onMounted(() => {
|
||||
:class="['tl-event-pill__status', statusIcon(ev)]"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<!-- Botao ⏱ overlay — so em sessoes em curso com
|
||||
paciente. stopPropagation pra nao disparar
|
||||
o click do pill que abre o evento. -->
|
||||
<button
|
||||
v-if="podeIniciarCrono(ev)"
|
||||
type="button"
|
||||
class="tl-event-pill__crono"
|
||||
title="Iniciar cronômetro"
|
||||
aria-label="Iniciar cronômetro"
|
||||
@click.stop="emit('iniciar-cronometro', ev)"
|
||||
>
|
||||
<i class="pi pi-stopwatch" />
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="absolute top-0 h-full flex flex-col items-center pointer-events-none z-20"
|
||||
@@ -459,6 +478,18 @@ onMounted(() => {
|
||||
{{ fmtHora(ev.startH) }} – {{ fmtHora(ev.endH) }}
|
||||
</div>
|
||||
<div class="vt-event-label">{{ ev.label }}</div>
|
||||
<!-- Botao ⏱ overlay — so em sessoes em curso com paciente.
|
||||
stopPropagation pra nao disparar o click do pill. -->
|
||||
<button
|
||||
v-if="podeIniciarCrono(ev)"
|
||||
type="button"
|
||||
class="vt-event__crono"
|
||||
title="Iniciar cronômetro"
|
||||
aria-label="Iniciar cronômetro"
|
||||
@click.stop="emit('iniciar-cronometro', ev)"
|
||||
>
|
||||
<i class="pi pi-stopwatch" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="vt-now" :style="{ top: nowCursorTop }">
|
||||
@@ -640,6 +671,46 @@ html:not(.app-dark) .tl-day-badge--feriado {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* Botao ⏱ "Iniciar cronometro" — overlay no canto sup. direito do
|
||||
pill em sessoes em curso. Cor solida pra destacar contra o bg
|
||||
colorido do evento; pulso sutil pra chamar atencao sem irritar. */
|
||||
.tl-event-pill__crono,
|
||||
.vt-event__crono {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
||||
border-radius: 9999px;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
padding: 0;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
|
||||
transition: background-color 160ms ease, transform 160ms ease, border-color 160ms ease;
|
||||
animation: tl-crono-pulse 2s ease-in-out infinite;
|
||||
z-index: 2;
|
||||
}
|
||||
.tl-event-pill__crono:hover,
|
||||
.vt-event__crono:hover {
|
||||
background: rgba(16, 185, 129, 0.85); /* emerald-500 — convida ao "play" */
|
||||
border-color: rgba(255, 255, 255, 0.6);
|
||||
transform: scale(1.08);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.tl-event-pill__crono > i,
|
||||
.vt-event__crono > i {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
@keyframes tl-crono-pulse {
|
||||
0%, 100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(16, 185, 129, 0.45); }
|
||||
50% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(16, 185, 129, 0); }
|
||||
}
|
||||
|
||||
/* Realizado: glow verde sutil (cor do bg ja eh verde) — celebra o feito */
|
||||
.tl-pill--realizado {
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.28), 0 4px 12px rgba(16, 185, 129, 0.18);
|
||||
|
||||
Reference in New Issue
Block a user