Substitui o formato de colunas { key, label } (Nuxt UI v2) pelo formato
correto { id, accessorKey, header } exigido pelo TanStack Table no Nuxt UI v3.
Afetou 7 arquivos: EditaisTable, index, orgaos, concorrentes, contratos,
inteligencia/index e sistema/usuarios.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.6 KiB
Vue
44 lines
1.6 KiB
Vue
<!-- front-end/app/pages/gestao/orgaos.vue -->
|
|
<script setup lang="ts">
|
|
import { orgaos } from '~/data/mock/orgaos'
|
|
|
|
const esferaLabel = { federal: 'Federal', estadual: 'Estadual', municipal: 'Municipal' }
|
|
const columns = [
|
|
{ id: 'nome', accessorKey: 'nome', header: 'Órgão' },
|
|
{ id: 'esfera', accessorKey: 'esfera', header: 'Esfera' },
|
|
{ id: 'estado', accessorKey: 'estado', header: 'UF' },
|
|
{ id: 'totalParticipacoes', accessorKey: 'totalParticipacoes', header: 'Participações' },
|
|
{ id: 'totalVitorias', accessorKey: 'totalVitorias', header: 'Vitórias' },
|
|
{ id: 'taxaVitoria', accessorKey: 'taxaVitoria', header: 'Taxa' },
|
|
]
|
|
|
|
const dados = computed(() => orgaos.map(o => ({
|
|
...o,
|
|
taxaVitoria: o.totalParticipacoes > 0 ? `${Math.round((o.totalVitorias / o.totalParticipacoes) * 100)}%` : '0%',
|
|
})))
|
|
</script>
|
|
|
|
<template>
|
|
<div class="page">
|
|
<AppTopbar title="Órgãos Públicos" breadcrumb="Gestão · Órgãos">
|
|
<template #actions>
|
|
<UButton size="sm" class="btn-primary">+ Adicionar Órgão</UButton>
|
|
</template>
|
|
</AppTopbar>
|
|
<div class="content">
|
|
<div class="card">
|
|
<UTable :data="dados" :columns="columns">
|
|
<template #esfera-cell="{ row }">{{ esferaLabel[row.original.esfera] }}</template>
|
|
</UTable>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.page { display: flex; flex-direction: column; height: 100vh; }
|
|
.content { padding: 20px 22px; flex: 1; overflow-y: auto; }
|
|
.card { background: white; border-radius: 11px; border: 1px solid #e2e8f0; overflow: hidden; }
|
|
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2) !important; }
|
|
</style>
|