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 { t } = useI18n();
|
||||||
const warehouses = ref([]);
|
const warehouses = ref([]);
|
||||||
|
const companies = ref([]);
|
||||||
|
const countries = ref([]);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: 'Id',
|
label: t('globals.id'),
|
||||||
columnFilter: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'description',
|
name: 'description',
|
||||||
label: 'Description',
|
label: t('globals.description'),
|
||||||
columnFilter: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'company',
|
name: 'companyFk',
|
||||||
label: 'Company',
|
label: t('globals.company'),
|
||||||
columnFilter: false,
|
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.company?.code),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.company?.code),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
name: 'companyFk',
|
||||||
|
optionLabel: 'code',
|
||||||
|
options: companies.value,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tradeMark',
|
name: 'tradeMark',
|
||||||
label: 'TradeMark',
|
label: t('vehicle.tradeMark'),
|
||||||
columnFilter: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'numberPlate',
|
name: 'numberPlate',
|
||||||
label: 'Number Plate',
|
label: t('vehicle.numberPlate'),
|
||||||
columnFilter: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'warehouseFk',
|
name: 'warehouseFk',
|
||||||
label: 'Warehouse',
|
label: t('globals.warehouse'),
|
||||||
columnFilter: false,
|
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouse?.name),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouse?.name),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
name: 'warehouseFk',
|
||||||
|
options: warehouses.value,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'chassis',
|
name: 'chassis',
|
||||||
label: 'Chassis',
|
label: t('vehicle.chassis'),
|
||||||
columnFilter: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'leasing',
|
name: 'leasing',
|
||||||
label: 'Leasing',
|
label: t('vehicle.leasing'),
|
||||||
columnFilter: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'countryCodeFk',
|
name: 'countryCodeFk',
|
||||||
label: 'Country Code',
|
label: t('globals.country'),
|
||||||
columnFilter: false,
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
name: 'countryCodeFk',
|
||||||
|
optionValue: 'code',
|
||||||
|
optionLabel: 'code',
|
||||||
|
options: countries.value,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'isKmTruckRate',
|
||||||
|
label: t('vehicle.isKmTruckRate'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'state',
|
name: 'state',
|
||||||
label: 'State',
|
label: t('globals.state'),
|
||||||
columnFilter: false,
|
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.event?.state?.state),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.event?.state?.state),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
<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-container">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<VnTable
|
<VnTable
|
||||||
|
@ -71,7 +88,6 @@ const columns = computed(() => [
|
||||||
url="Vehicles/filter"
|
url="Vehicles/filter"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="vehicle"
|
redirect="vehicle"
|
||||||
auto-load
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</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