42 lines
1.3 KiB
Vue
42 lines
1.3 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 = [
|
|
{ key: 'numero', label: 'Nº Edital' },
|
|
{ key: 'objeto', label: 'Objeto' },
|
|
{ key: 'orgao', label: 'Órgão' },
|
|
{ key: 'modalidade', label: 'Modalidade' },
|
|
{ key: 'valorEstimado', label: 'Valor Est.' },
|
|
{ key: 'status', label: 'Status' },
|
|
{ key: 'dataAbertura', label: '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>
|