86311ef305
Sprints 04-29 + 04-30 acumuladas. - MelissaConfiguracoes: hub 2-col com 6 grupos (Layout/Conta/Agenda/ Financeiro/WhatsApp/Sistema), tudo embedado via MelissaEmbed. - MelissaEmbed: wrapper generico que injeta layout-variant=melissa e remove cromos pra reaproveitar Pages tradicionais. - 9 Melissa Pages novas: CadastrosRecebidos, Compromissos, Configuracoes, Conversas, Embed, Grupos, Medicos, Recorrencias, Tags. - Dialog blueprint atualizado: bg-gray-100 (hardcoded light) -> bg-[var(--surface-ground)] (tema-aware). 22 dialogs migrados em 9 arquivos. Anti-pattern documentado. - PatientsCadastroPage: bug fix dropdown Grupo (optionLabel nome->name), toggle vertical/abas com persist localStorage, sticky margin-top. - Surface picker no popover do MelissaLayout (8 swatches). - useTopbarPlanMenu, useMelissaWhatsapp, useMelissaPacientesAside novos. - Migration: status agenda remarcado/confirmado. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
293 lines
9.6 KiB
Vue
293 lines
9.6 KiB
Vue
<script setup>
|
|
/*
|
|
* MelissaEmbed — Wrapper genérico pra embedar pages tradicionais dentro
|
|
* do MelissaLayout (Onda 1 da migração).
|
|
*
|
|
* Usado pra páginas que ainda não viraram Melissa Pages dedicadas mas
|
|
* que o user precisa acessar sem sair do overlay Melissa: Financeiro,
|
|
* Documents, Agendamentos Recebidos, Online Scheduling, etc.
|
|
*
|
|
* Diferença pra MelissaConfiguracoes:
|
|
* - MelissaConfiguracoes tem aside com sidebar de seções (hub de configs)
|
|
* - MelissaEmbed é 1-coluna full-width (1 page só, sem nav lateral)
|
|
*
|
|
* Padrão: hero glass sticky no topo + Suspense + <component :is>.
|
|
*
|
|
* Reusa o mesmo Teleport target #cfg-page-actions pra que pages que
|
|
* injetam ações no header da ConfiguracoesPage tradicional não quebrem.
|
|
*/
|
|
import { computed, defineAsyncComponent } from 'vue';
|
|
|
|
const props = defineProps({
|
|
// Key da rota /melissa/:secao — determina qual page embedar
|
|
secaoRota: { type: String, required: true }
|
|
});
|
|
const emit = defineEmits(['close']);
|
|
|
|
// ── Catálogo de seções embedáveis ──────────────────────────────
|
|
// Cada entry tem label, descrição, ícone e o componente assíncrono.
|
|
// Mantido neste arquivo (não no MelissaLayout) pra que adicionar uma
|
|
// nova page aqui não exija mexer no parent.
|
|
const EMBED_MAP = {
|
|
'financeiro': {
|
|
label: 'Financeiro',
|
|
desc: 'Visão geral, recebíveis e indicadores do mês.',
|
|
icon: 'pi pi-wallet',
|
|
comp: defineAsyncComponent(() => import('@/features/financeiro/pages/FinanceiroDashboardPage.vue'))
|
|
},
|
|
'financeiro-lancamentos': {
|
|
label: 'Lançamentos financeiros',
|
|
desc: 'Lista detalhada de cobranças, pagamentos e recebimentos.',
|
|
icon: 'pi pi-list',
|
|
comp: defineAsyncComponent(() => import('@/features/financeiro/pages/FinanceiroPage.vue'))
|
|
},
|
|
'documentos': {
|
|
label: 'Documentos',
|
|
desc: 'Documentos clínicos do tenant — geração, edição e histórico.',
|
|
icon: 'pi pi-file',
|
|
comp: defineAsyncComponent(() => import('@/features/documents/DocumentsListPage.vue'))
|
|
},
|
|
'documentos-templates': {
|
|
label: 'Templates de documentos',
|
|
desc: 'Modelos reutilizáveis pra prontuários e relatórios.',
|
|
icon: 'pi pi-file-edit',
|
|
comp: defineAsyncComponent(() => import('@/features/documents/DocumentTemplatesPage.vue'))
|
|
},
|
|
'agendamentos-recebidos': {
|
|
label: 'Agendamentos recebidos',
|
|
desc: 'Solicitações vindas do agendador online à espera de confirmação.',
|
|
icon: 'pi pi-inbox',
|
|
comp: defineAsyncComponent(() => import('@/features/agenda/pages/AgendamentosRecebidosPage.vue'))
|
|
},
|
|
'online-scheduling': {
|
|
label: 'Agendador online',
|
|
desc: 'Configure o link público pra pacientes solicitarem horários.',
|
|
icon: 'pi pi-calendar-clock',
|
|
comp: defineAsyncComponent(() => import('@/views/pages/therapist/OnlineSchedulingPage.vue'))
|
|
},
|
|
'relatorios': {
|
|
label: 'Relatórios',
|
|
desc: 'Indicadores e relatórios do tenant — clínico e financeiro.',
|
|
icon: 'pi pi-chart-bar',
|
|
comp: defineAsyncComponent(() => import('@/views/pages/therapist/RelatoriosPage.vue'))
|
|
},
|
|
'notificacoes': {
|
|
label: 'Notificações',
|
|
desc: 'Histórico de notificações enviadas (WhatsApp, e-mail, SMS).',
|
|
icon: 'pi pi-bell',
|
|
comp: defineAsyncComponent(() => import('@/views/pages/therapist/NotificationsHistoryPage.vue'))
|
|
},
|
|
'link-externo': {
|
|
label: 'Link externo de cadastro',
|
|
desc: 'Link público pra pacientes preencherem o cadastro online.',
|
|
icon: 'pi pi-share-alt',
|
|
comp: defineAsyncComponent(() => import('@/features/patients/cadastro/PatientsExternalLinkPage.vue'))
|
|
}
|
|
};
|
|
|
|
const info = computed(() => EMBED_MAP[props.secaoRota] || null);
|
|
</script>
|
|
|
|
<template>
|
|
<section class="me-page">
|
|
<header class="me-page__head">
|
|
<div class="me-page__title">
|
|
<i :class="info?.icon || 'pi pi-file'" />
|
|
<span>{{ info?.label || 'Página' }}</span>
|
|
</div>
|
|
<div class="me-page__actions">
|
|
<button class="me-close" v-tooltip.bottom="'Voltar (Esc)'" @click="emit('close')">
|
|
<i class="pi pi-times" />
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="me-body">
|
|
<!-- Hero contextual (igual ao mcfg-embed-hero) -->
|
|
<div v-if="info" class="me-hero">
|
|
<div class="me-hero__icon">
|
|
<i :class="info.icon" />
|
|
</div>
|
|
<div class="me-hero__text">
|
|
<div class="me-hero__title">{{ info.label }}</div>
|
|
<div class="me-hero__desc">{{ info.desc }}</div>
|
|
</div>
|
|
<!-- Teleport target compartilhado com ConfiguracoesPage:
|
|
algumas pages que migram fazem <Teleport to="#cfg-page-actions">.
|
|
Mantemos o id pra não quebrar. -->
|
|
<div id="cfg-page-actions" class="me-hero__actions"></div>
|
|
</div>
|
|
|
|
<!-- Embed dinâmico -->
|
|
<div class="me-content">
|
|
<Suspense v-if="info">
|
|
<template #default>
|
|
<component :is="info.comp" :key="secaoRota" />
|
|
</template>
|
|
<template #fallback>
|
|
<div class="me-loading">
|
|
<i class="pi pi-spin pi-spinner" />
|
|
<span>Carregando…</span>
|
|
</div>
|
|
</template>
|
|
</Suspense>
|
|
<div v-else class="me-loading">
|
|
<i class="pi pi-exclamation-triangle" />
|
|
<span>Seção desconhecida: {{ secaoRota }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<style scoped>
|
|
/* ═════ Container glass ═════ */
|
|
.me-page {
|
|
position: absolute;
|
|
inset: 6px 6px calc(var(--m-dock-h, 76px) + 6px) 6px;
|
|
z-index: 40;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--m-bg-medium);
|
|
backdrop-filter: blur(32px) saturate(160%);
|
|
-webkit-backdrop-filter: blur(32px) saturate(160%);
|
|
border: 1px solid var(--m-border);
|
|
border-radius: 18px;
|
|
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
overflow: hidden;
|
|
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
|
|
color: var(--m-text);
|
|
animation: me-page-enter 240ms cubic-bezier(0.2, 0.7, 0.3, 1);
|
|
}
|
|
@keyframes me-page-enter {
|
|
from { opacity: 0; transform: scale(0.985); }
|
|
to { opacity: 1; transform: scale(1); }
|
|
}
|
|
|
|
/* ═════ Header ═════ */
|
|
.me-page__head {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 14px 18px;
|
|
border-bottom: 1px solid var(--m-border);
|
|
flex-shrink: 0;
|
|
gap: 10px;
|
|
}
|
|
.me-page__title {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
font-size: 1rem;
|
|
font-weight: 500;
|
|
}
|
|
.me-page__title > i { color: var(--m-text-muted); font-size: 0.95rem; }
|
|
.me-page__title > span {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.me-page__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
|
|
|
|
.me-close {
|
|
width: 32px; height: 32px;
|
|
display: grid; place-items: center;
|
|
background: var(--m-bg-soft);
|
|
border: 1px solid var(--m-border);
|
|
color: var(--m-text);
|
|
border-radius: 9px;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
transition: background-color 140ms ease;
|
|
}
|
|
.me-close:hover { background: var(--m-bg-soft-hover); }
|
|
.me-close > i { font-size: 0.85rem; }
|
|
|
|
/* ═════ Body ═════ */
|
|
.me-body {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow-y: auto;
|
|
scrollbar-width: thin;
|
|
scrollbar-color: var(--m-border-strong) transparent;
|
|
}
|
|
.me-body::-webkit-scrollbar { width: 6px; }
|
|
.me-body::-webkit-scrollbar-thumb { background: var(--m-border-strong); border-radius: 3px; }
|
|
|
|
/* Hero contextual (mesmo padrão do mcfg-embed-hero) */
|
|
.me-hero {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 11;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 12px 18px;
|
|
background: var(--m-bg-medium);
|
|
backdrop-filter: blur(20px) saturate(160%);
|
|
-webkit-backdrop-filter: blur(20px) saturate(160%);
|
|
border-bottom: 1px solid var(--m-border);
|
|
flex-shrink: 0;
|
|
}
|
|
.me-hero__icon {
|
|
width: 36px;
|
|
height: 36px;
|
|
display: grid;
|
|
place-items: center;
|
|
background: var(--m-accent-soft);
|
|
color: var(--m-accent);
|
|
border-radius: 9px;
|
|
flex-shrink: 0;
|
|
}
|
|
.me-hero__icon > i { font-size: 0.92rem; }
|
|
.me-hero__text {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1px;
|
|
}
|
|
.me-hero__title {
|
|
font-size: 0.94rem;
|
|
font-weight: 600;
|
|
color: var(--m-text);
|
|
line-height: 1.2;
|
|
}
|
|
.me-hero__desc {
|
|
font-size: 0.74rem;
|
|
color: var(--m-text-muted);
|
|
line-height: 1.3;
|
|
}
|
|
.me-hero__actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Wrapper que dá padding ao conteúdo embedado */
|
|
.me-content {
|
|
padding: 16px 18px 28px;
|
|
}
|
|
|
|
/* Loading do Suspense */
|
|
.me-loading {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 10px;
|
|
padding: 60px 20px;
|
|
color: var(--m-text-muted);
|
|
font-size: 0.86rem;
|
|
}
|
|
.me-loading > i { font-size: 1.2rem; color: var(--m-accent); }
|
|
|
|
/* Mobile (<lg) */
|
|
@media (max-width: 1023px) {
|
|
.me-content { padding: 12px; }
|
|
.me-hero { padding: 10px 12px; }
|
|
}
|
|
</style>
|