feat : creation du composant datatable (WIP)

This commit is contained in:
2026-02-18 14:54:18 +01:00
parent c229d0ab62
commit 32fe51caaa
20 changed files with 287 additions and 64 deletions

View File

@@ -18,7 +18,7 @@
</template>
<script setup lang="ts">
import type {ColumnConfig, Row} from "~/services/datatable";
import type {ColumnConfig, Row} from "~/services/dto/datatable-data";
const router = useRouter()

View File

@@ -48,7 +48,7 @@
import {computed, reactive, ref, watch} from "vue"
import {createCustomer, getCustomer, updateCustomer} from "~/services/customer"
import type {CustomerData, CustomerFormData, CustomerPayload} from "~/services/dto/customer-data"
import type {ColumnConfig, Row} from "~/services/datatable"
import type {ColumnConfig, Row} from "~/services/dto/datatable-data"
import {useAuthStore} from "~/stores/auth"
definePageMeta({layout: "default"})

View File

@@ -24,7 +24,7 @@
</template>
<script setup lang="ts">
import type { ColumnConfig, Row } from "~/services/datatable"
import type { ColumnConfig, Row } from "~/services/dto/datatable-data"
import { formatAddresses } from "~/utils/datatable-formatters"
import { useAuthStore } from "~/stores/auth"
@@ -34,7 +34,7 @@ const router = useRouter()
const auth = useAuthStore()
const columns: ColumnConfig[] = [
{ key: "name", label: "Nom" },
{ key: "name", label: "Nom", isSearchable:true},
{ key: "phone", label: "Téléphone" },
{ key: "email", label: "Email" },
{ key: "addresses", label: "Adresses", format: formatAddresses },

View File

@@ -48,7 +48,7 @@
import {computed, reactive, ref, watch} from "vue"
import {createSupplier, getSupplier, updateSupplier} from "~/services/supplier"
import type {SupplierData, SupplierFormData, SupplierPayload} from "~/services/dto/supplier-data"
import type {ColumnConfig, Row} from "~/services/datatable"
import type {ColumnConfig, Row} from "~/services/dto/datatable-data"
import {useAuthStore} from "~/stores/auth"
definePageMeta({layout: "default"})

View File

@@ -24,7 +24,7 @@
</template>
<script setup lang="ts">
import type { ColumnConfig, Row } from "~/services/datatable"
import type { ColumnConfig, Row } from "~/services/dto/datatable-data"
import {formatAddresses} from "~/utils/datatable-formatters"
import { useAuthStore } from "~/stores/auth"
@@ -34,7 +34,7 @@ const router = useRouter()
const auth = useAuthStore()
const columns: ColumnConfig[] = [
{ key: "name", label: "Nom" },
{ key: "name", label: "Nom", isSearchable:true },
{ key: "email", label: "Mail" },
{ key: "addresses", label: "Adresses", format: formatAddresses },
]

View File

@@ -25,7 +25,7 @@ definePageMeta({
})
import {ROLE} from "~/utils/constants";
import type {ColumnConfig, Row} from "~/services/datatable";
import type {ColumnConfig, Row} from "~/services/dto/datatable-data";
import {formatRoleLabels} from "~/utils/datatable-formatters";
const router = useRouter()