Files
lic/front-end/app/pages/gestao/concorrentes.vue
Junior 587a0d4f62 fix: corrige formato de colunas UTable para Nuxt UI v3 (TanStack Table)
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>
2026-03-14 11:03:39 -03:00

40 lines
1.4 KiB
Vue

<!-- front-end/app/pages/gestao/concorrentes.vue -->
<script setup lang="ts">
import { concorrentes } from '~/data/mock/concorrentes'
const columns = [
{ id: 'cnpj', accessorKey: 'cnpj', header: 'CNPJ' },
{ id: 'nome', accessorKey: 'nome', header: 'Empresa' },
{ id: 'totalDisputas', accessorKey: 'totalDisputas', header: 'Disputas' },
{ id: 'totalVitorias', accessorKey: 'totalVitorias', header: 'Vitórias' },
{ id: 'taxaVitoria', accessorKey: 'taxaVitoria', header: 'Taxa' },
]
const dados = computed(() => concorrentes.map(c => ({
...c,
taxaVitoria: c.totalDisputas > 0 ? `${Math.round((c.totalVitorias / c.totalDisputas) * 100)}%` : '0%',
})))
</script>
<template>
<div class="page">
<AppTopbar title="Concorrentes" breadcrumb="Gestão · Concorrentes">
<template #actions>
<UButton size="sm" class="btn-primary">+ Adicionar Concorrente</UButton>
</template>
</AppTopbar>
<div class="content">
<div class="card">
<UTable :data="dados" :columns="columns" />
</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>