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>
42 lines
1.5 KiB
Vue
42 lines
1.5 KiB
Vue
<!-- front-end/app/components/EditaisTable.vue -->
|
|
<script setup lang="ts">
|
|
import type { Edital } from '~/types'
|
|
|
|
defineProps<{ editais: Edital[] }>()
|
|
|
|
const modalidadeLabel: Record<string, string> = {
|
|
pregao_eletronico: 'Pregão Eletrônico',
|
|
pregao_presencial: 'Pregão Presencial',
|
|
concorrencia: 'Concorrência',
|
|
dispensa: 'Dispensa',
|
|
inexigibilidade: 'Inexigibilidade',
|
|
}
|
|
|
|
const columns = [
|
|
{ id: 'numero', accessorKey: 'numero', header: 'Nº Edital' },
|
|
{ id: 'objeto', accessorKey: 'objeto', header: 'Objeto' },
|
|
{ id: 'orgao', accessorKey: 'orgao', header: 'Órgão' },
|
|
{ id: 'modalidade', accessorKey: 'modalidade', header: 'Modalidade' },
|
|
{ id: 'valorEstimado', accessorKey: 'valorEstimado', header: 'Valor Est.' },
|
|
{ id: 'status', accessorKey: 'status', header: 'Status' },
|
|
{ id: 'dataAbertura', accessorKey: 'dataAbertura', header: 'Abertura' },
|
|
]
|
|
</script>
|
|
|
|
<template>
|
|
<UTable :data="editais" :columns="columns">
|
|
<template #modalidade-cell="{ row }">
|
|
{{ modalidadeLabel[row.original.modalidade] }}
|
|
</template>
|
|
<template #valorEstimado-cell="{ row }">
|
|
{{ new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL', maximumFractionDigits: 0 }).format(row.original.valorEstimado) }}
|
|
</template>
|
|
<template #status-cell="{ row }">
|
|
<StatusChip :status="row.original.status" />
|
|
</template>
|
|
<template #dataAbertura-cell="{ row }">
|
|
{{ row.original.dataAbertura.toLocaleDateString('pt-BR') }}
|
|
</template>
|
|
</UTable>
|
|
</template>
|