From ccc428f7b5a15bf3c924a07e81e1ba44e46e8883 Mon Sep 17 00:00:00 2001 From: gabrielb Date: Wed, 20 May 2026 00:47:30 -0300 Subject: [PATCH] feat(portal): adicionar mocks de dados para resumo e atividades no painel --- src/pages/portal/painel.vue | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/pages/portal/painel.vue b/src/pages/portal/painel.vue index ba4d0b2..07929f0 100644 --- a/src/pages/portal/painel.vue +++ b/src/pages/portal/painel.vue @@ -13,11 +13,32 @@ const { nomeUsuario } = useAuth() const prefeitura = usePrefeituraStore() const router = useRouter() +// ─── MOCKS APRESENTAÇÃO — remover antes do deploy ───────────────────────── +const MOCK_ATIVO = true +const RESUMO_MOCK = { + totalDebitos: 1250.90, + certidoesAtivas: 2, + alvarasAndamento: 2, + ultimoPagamento: 430.00, + debitosVencidos: 1, +} +const ATIVIDADES_MOCK = [ + { tipo: 'PAGAMENTO', descricao: 'IPTU 2025 — Parcela 3/10 paga', data: '15/05/2025' }, + { tipo: 'CERTIDAO', descricao: 'Certidão Negativa emitida', data: '10/05/2025' }, + { tipo: 'DEBITO', descricao: 'Guia IPTU 2025 — Cota 4 emitida', data: '02/05/2025' }, + { tipo: 'ALVARA', descricao: 'Alvará de funcionamento em análise', data: '28/04/2025' }, + { tipo: 'CADASTRO', descricao: 'E-mail cadastral atualizado', data: '20/04/2025' }, +] +// ────────────────────────────────────────────────────────────────────────── + const resumo = ref(null) const atividades = ref([]) const carregando = ref(true) -onMounted(async () => { +onMounted(carregar) + +async function carregar() { + carregando.value = true try { const [resResumo, resAtividades] = await Promise.all([ portalService.getPainelResumo(), @@ -25,12 +46,19 @@ onMounted(async () => { ]) resumo.value = resResumo.data atividades.value = resAtividades.data?.content ?? [] + if (MOCK_ATIVO) { + if (!resumo.value) resumo.value = RESUMO_MOCK + if (atividades.value.length === 0) atividades.value = ATIVIDADES_MOCK + } } catch { - // silencioso — exibe zeros + if (MOCK_ATIVO) { + resumo.value = RESUMO_MOCK + atividades.value = ATIVIDADES_MOCK + } } finally { carregando.value = false } -}) +} const acesRapidos = [ { icon: 'pi-receipt', label: 'Emitir Guia', to: '/portal/debitos', cor: 'text-primary' },