0
0
Fork 0

refactor: refs #7354 fix tableFilters

This commit is contained in:
Jon Elias 2024-07-19 12:11:00 +02:00
parent daa4a41f09
commit e60f846464
4 changed files with 39 additions and 21 deletions

View File

@ -10,13 +10,12 @@ const { t } = useI18n();
<template>
<VnCard
data-key="Zone"
data-key="zone"
base-url="Zones"
search-url="Zones"
search-key="name"
:descriptor="ZoneDescriptor"
:filter-panel="ZoneFilterPanel"
:search-data-key="'ZoneList'"
search-data-key="ZoneList"
search-url="Zones"
:searchbar-label="t('list.searchZone')"
:searchbar-info="t('list.searchInfo')"
/>

View File

@ -44,6 +44,9 @@ const columns = computed(() => [
condition: () => true,
},
isId: true,
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
@ -51,6 +54,9 @@ const columns = computed(() => [
label: t('list.name'),
isTitle: true,
create: true,
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
@ -58,35 +64,42 @@ const columns = computed(() => [
label: t('list.agency'),
cardVisible: true,
create: true,
component: 'select',
attrs: {
url: 'AgencyModes',
columnFilter: {
component: 'select',
inWhere: true,
attrs: {
url: 'AgencyModes',
},
},
columnField: {
component: null,
},
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
},
{
align: 'left',
name: 'hour',
label: t('list.close'),
cardVisible: true,
format: (row) => toTimeFormat(row.hour),
},
{
align: 'left',
name: 'price',
label: t('list.price'),
cardVisible: true,
format: (row) => toCurrency(row.price),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
name: 'hour',
label: t('list.close'),
cardVisible: true,
format: (row) => toTimeFormat(row.hour),
hidden: true,
},
{
align: 'right',
name: 'tableActions',
actions: [
{
title: t('ZoneSummary'),
title: t('list.zoneSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ZoneSummary),
},
@ -116,15 +129,14 @@ const handleClone = (id) => {
<template>
<VnSearchbar
search-key="name"
data-key="ZoneList"
:label="t('Search claim')"
:info="t('You can search by claim id or customer name')"
data-key="Zones"
:label="t('Search zone')"
:info="t('You can search zones by id or name')"
:is-query-filter="true"
/>
<VnTable
ref="tableRef"
data-key="ZoneList"
data-key="Zones"
url="Zones"
:create="{
urlCreate: 'Zones',
@ -136,7 +148,6 @@ const handleClone = (id) => {
:columns="columns"
default-mode="table"
redirect="zone"
:use-model="true"
auto-load
>
<template #more-create-dialog="{ data }">
@ -165,3 +176,9 @@ const handleClone = (id) => {
</template>
</VnTable>
</template>
<i18n>
es:
Search zone: Buscar zona
You can search zones by id or name: Puedes buscar zonas por id o nombre
</i18n>

View File

@ -26,6 +26,7 @@ list:
bonus: Bonus
isVolumetric: Volumetric
createZone: Create zone
zoneSummary: Summary
create:
name: Name
warehouse: Warehouse

View File

@ -26,6 +26,7 @@ list:
bonus: Bonus
isVolumetric: Volumétrico
createZone: Crear zona
zoneSummary: Resumen
create:
name: Nombre
warehouse: Almacén