Agenda google, avisos globais, feriados + avisos globais, templates de email, configuracoes empresa, preview empresa.

This commit is contained in:
Leonardo
2026-03-18 15:47:37 -03:00
parent d6d2fe29d1
commit 29ed349cf2
21 changed files with 5366 additions and 41 deletions
@@ -1089,6 +1089,24 @@
v-tooltip.bottom="'Remover'"
@click="onDelete"
/>
<!-- Google Calendar link -->
<a
v-if="isEdit && googleCalendarUrl"
:href="googleCalendarUrl"
target="_blank"
rel="noopener noreferrer"
class="gcal-btn"
v-tooltip.top="'Abre o Google Agenda com o compromisso pré-preenchido. Em breve: sincronização automática e bidirecional com sua conta Google.'"
>
<svg class="gcal-btn__icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<rect x="3" y="4" width="18" height="18" rx="2" stroke="currentColor" stroke-width="1.7"/>
<path d="M3 9h18" stroke="currentColor" stroke-width="1.7"/>
<path d="M8 2v4M16 2v4" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/>
<path d="M8 13h.01M12 13h.01M16 13h.01M8 17h.01M12 17h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
<span>Google Agenda</span>
</a>
</div>
<Button
label="Salvar"
@@ -1120,6 +1138,7 @@
<script setup>
import { computed, ref, watch, nextTick } from 'vue'
import { generateGoogleCalendarLink, formatGCalDate, addMinutesToHHMM } from '@/utils/googleCalendarLink'
import { useRouter, useRoute } from 'vue-router'
import Select from 'primevue/select'
import Textarea from 'primevue/textarea'
@@ -2717,6 +2736,29 @@ function resetForm () {
}
}
// ── Google Calendar link ────────────────────────────────────────
const googleCalendarUrl = computed(() => {
const dia = form.value.dia
const hora = form.value.startTime
if (!dia || !hora) return null
const start = formatGCalDate(dia, hora)
const endHHMM = addMinutesToHHMM(hora, form.value.duracaoMin || 50)
const end = formatGCalDate(dia, endHHMM)
const paciente = form.value.paciente_nome ? `${form.value.paciente_nome}` : ''
const title = (form.value.titulo_custom?.trim() || 'Sessão') + paciente
const location = form.value.modalidade === 'online' ? 'Atendimento Online' : ''
return generateGoogleCalendarLink({
title,
description: form.value.observacoes?.trim() || '',
location,
start,
end,
})
})
function labelStatusSessao (v) {
const map = { agendado: 'Agendado', realizado: 'Realizado', faltou: 'Faltou', cancelado: 'Cancelado' }
return map[v] || '—'
@@ -3419,4 +3461,31 @@ function statusSeverity (v) {
margin-top: .25rem;
border-top: 1px solid var(--surface-border);
}
/* ── Google Calendar button ─────────────────────── */
.gcal-btn {
display: inline-flex;
align-items: center;
gap: .45rem;
padding: .45rem .9rem;
border-radius: 6px;
border: 1px solid #4285F4;
background: transparent;
color: #4285F4;
font-size: .85rem;
font-weight: 500;
text-decoration: none;
transition: background .15s ease, color .15s ease;
cursor: pointer;
white-space: nowrap;
}
.gcal-btn:hover {
background: #4285F4;
color: #fff;
}
.gcal-btn__icon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
</style>