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
All checks were successful
Dev Build & Deploy Portal / build-deploy (push) Successful in 2m28s
This commit is contained in:
parent
c650f5a28f
commit
ccc428f7b5
@ -13,11 +13,32 @@ const { nomeUsuario } = useAuth()
|
|||||||
const prefeitura = usePrefeituraStore()
|
const prefeitura = usePrefeituraStore()
|
||||||
const router = useRouter()
|
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 resumo = ref(null)
|
||||||
const atividades = ref([])
|
const atividades = ref([])
|
||||||
const carregando = ref(true)
|
const carregando = ref(true)
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(carregar)
|
||||||
|
|
||||||
|
async function carregar() {
|
||||||
|
carregando.value = true
|
||||||
try {
|
try {
|
||||||
const [resResumo, resAtividades] = await Promise.all([
|
const [resResumo, resAtividades] = await Promise.all([
|
||||||
portalService.getPainelResumo(),
|
portalService.getPainelResumo(),
|
||||||
@ -25,12 +46,19 @@ onMounted(async () => {
|
|||||||
])
|
])
|
||||||
resumo.value = resResumo.data
|
resumo.value = resResumo.data
|
||||||
atividades.value = resAtividades.data?.content ?? []
|
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 {
|
} catch {
|
||||||
// silencioso — exibe zeros
|
if (MOCK_ATIVO) {
|
||||||
|
resumo.value = RESUMO_MOCK
|
||||||
|
atividades.value = ATIVIDADES_MOCK
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
carregando.value = false
|
carregando.value = false
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
const acesRapidos = [
|
const acesRapidos = [
|
||||||
{ icon: 'pi-receipt', label: 'Emitir Guia', to: '/portal/debitos', cor: 'text-primary' },
|
{ icon: 'pi-receipt', label: 'Emitir Guia', to: '/portal/debitos', cor: 'text-primary' },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user