feat(portal): adicionar mocks de dados para resumo e atividades no painel
All checks were successful
Dev Build & Deploy Portal / build-deploy (push) Successful in 2m28s

This commit is contained in:
Gabriel Bezerra 2026-05-20 00:47:30 -03:00
parent c650f5a28f
commit ccc428f7b5

View File

@ -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' },