0
0
Fork 0

perf: refs #7356 TicketList state column

This commit is contained in:
Jon Elias 2024-07-18 12:05:10 +02:00
parent c36e2cd3c9
commit 108375bb69
1 changed files with 22 additions and 19 deletions

View File

@ -20,6 +20,19 @@ const agenciesOptions = ref([]);
const selectedClient = ref(); const selectedClient = ref();
const columns = computed(() => [ const columns = computed(() => [
{
align: 'left',
name: 'stateFk',
label: t('ticketList.state'),
columnFilter: {
name: 'stateFk',
component: 'select',
attrs: {
url: 'States',
fields: ['id', 'name'],
},
},
},
{ {
align: 'left', align: 'left',
name: 'id', name: 'id',
@ -35,25 +48,7 @@ const columns = computed(() => [
label: t('ticketList.nickname'), label: t('ticketList.nickname'),
isTitle: true, isTitle: true,
}, },
{
align: 'left',
name: 'state',
label: t('ticketList.state'),
chip: {
condition: () => true,
color: (row) => {
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
},
},
columnFilter: {
name: 'stateFk',
component: 'select',
attrs: {
url: 'States',
fields: ['id', 'name'],
},
},
},
{ {
align: 'left', align: 'left',
name: 'shipped', name: 'shipped',
@ -189,6 +184,9 @@ const fetchAddresses = async (formData) => {
return err.response; return err.response;
} }
}; };
const getColor = (row) => {
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
};
</script> </script>
<template> <template>
@ -302,6 +300,11 @@ const fetchAddresses = async (formData) => {
</div> </div>
</VnRow> </VnRow>
</template> </template>
<template #column-stateFk="{ row }">
<QChip :class="getColor(row)" dense square>
{{ row.state }}
</QChip>
</template>
</VnTable> </VnTable>
</template> </template>