feat : creation du composant datatable (WIP)
This commit is contained in:
@@ -14,6 +14,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import {formatWeights} from "~/utils/datatable-formatters";
|
||||
|
||||
type ReceptionRow = {
|
||||
id?: number | string
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const columns = [
|
||||
{key: 'identificationNumber', label: 'Numero'},
|
||||
@@ -23,16 +29,9 @@ const columns = [
|
||||
{key: 'receptionType', label: 'Type'},
|
||||
{key: 'weights', label: 'Poids', format: formatWeights}
|
||||
]
|
||||
type ReceptionRow = {
|
||||
id?: number | string
|
||||
}
|
||||
const goToReception = (row: ReceptionRow) => {
|
||||
const id = Number(row?.id)
|
||||
if (!Number.isFinite(id)) return
|
||||
router.push(`/reception/update/${id}`)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
receptionList.value = await getReceptionList(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user