feat: refs #7119 add localization for vehicle fields and enhance VehicleList component
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
742fa231f1
commit
f2ac15829d
|
@ -6,64 +6,81 @@ import FetchData from 'src/components/FetchData.vue';
|
|||
|
||||
const { t } = useI18n();
|
||||
const warehouses = ref([]);
|
||||
const companies = ref([]);
|
||||
const countries = ref([]);
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
name: 'id',
|
||||
label: 'Id',
|
||||
columnFilter: false,
|
||||
label: t('globals.id'),
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
label: 'Description',
|
||||
columnFilter: false,
|
||||
label: t('globals.description'),
|
||||
},
|
||||
{
|
||||
name: 'company',
|
||||
label: 'Company',
|
||||
columnFilter: false,
|
||||
name: 'companyFk',
|
||||
label: t('globals.company'),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.company?.code),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'companyFk',
|
||||
optionLabel: 'code',
|
||||
options: companies.value,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'tradeMark',
|
||||
label: 'TradeMark',
|
||||
columnFilter: false,
|
||||
label: t('vehicle.tradeMark'),
|
||||
},
|
||||
{
|
||||
name: 'numberPlate',
|
||||
label: 'Number Plate',
|
||||
columnFilter: false,
|
||||
label: t('vehicle.numberPlate'),
|
||||
},
|
||||
{
|
||||
name: 'warehouseFk',
|
||||
label: 'Warehouse',
|
||||
columnFilter: false,
|
||||
label: t('globals.warehouse'),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouse?.name),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'warehouseFk',
|
||||
options: warehouses.value,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'chassis',
|
||||
label: 'Chassis',
|
||||
columnFilter: false,
|
||||
label: t('vehicle.chassis'),
|
||||
},
|
||||
{
|
||||
name: 'leasing',
|
||||
label: 'Leasing',
|
||||
columnFilter: false,
|
||||
label: t('vehicle.leasing'),
|
||||
},
|
||||
{
|
||||
name: 'countryCodeFk',
|
||||
label: 'Country Code',
|
||||
columnFilter: false,
|
||||
label: t('globals.country'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'countryCodeFk',
|
||||
optionValue: 'code',
|
||||
optionLabel: 'code',
|
||||
options: countries.value,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'isKmTruckRate',
|
||||
label: t('vehicle.isKmTruckRate'),
|
||||
},
|
||||
{
|
||||
name: 'state',
|
||||
label: 'State',
|
||||
columnFilter: false,
|
||||
label: t('globals.state'),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.event?.state?.state),
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
|
||||
<FetchData url="Countries" @on-fetch="(data) => (countries = data)" auto-load />
|
||||
<div class="list-container">
|
||||
<div class="list">
|
||||
<VnTable
|
||||
|
@ -71,7 +88,6 @@ const columns = computed(() => [
|
|||
url="Vehicles/filter"
|
||||
:columns="columns"
|
||||
redirect="vehicle"
|
||||
auto-load
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
vehicle:
|
||||
tradeMark: Trade Mark
|
||||
numberPlate: Number Plate
|
||||
chassis: Chassis
|
||||
leasing: Leasing
|
||||
isKmTruckRate: Trailer
|
|
@ -0,0 +1,6 @@
|
|||
vehicle:
|
||||
tradeMark: Marca
|
||||
numberPlate: Matrícula
|
||||
chassis: Número de bastidor
|
||||
leasing: Número de leasing
|
||||
isKmTruckRate: Trailer
|
Loading…
Reference in New Issue