refactor: refs #8606 modified table width and order
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-02-17 12:57:37 +01:00
parent 7c6112c896
commit 8b6c0c05d6
1 changed files with 88 additions and 64 deletions

View File

@ -65,7 +65,6 @@ const tableFilter = {
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left',
name: 'id', name: 'id',
label: t('list.id'), label: t('list.id'),
chip: { chip: {
@ -75,6 +74,8 @@ const columns = computed(() => [
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
columnClass: 'shrink-column',
component: 'number',
}, },
{ {
align: 'left', align: 'left',
@ -106,7 +107,6 @@ const columns = computed(() => [
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name), format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
}, },
{ {
align: 'left',
name: 'price', name: 'price',
label: t('list.price'), label: t('list.price'),
cardVisible: true, cardVisible: true,
@ -114,6 +114,8 @@ const columns = computed(() => [
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
columnClass: 'shrink-column',
component: 'number',
}, },
{ {
align: 'center', align: 'center',
@ -177,6 +179,8 @@ function formatRow(row) {
<ZoneFilterPanel data-key="ZonesList" /> <ZoneFilterPanel data-key="ZonesList" />
</template> </template>
</RightMenu> </RightMenu>
<div class="table-container">
<div class="column items-center">
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="ZonesList" data-key="ZonesList"
@ -192,6 +196,7 @@ function formatRow(row) {
redirect="zone" redirect="zone"
:right-search="false" :right-search="false"
table-height="85vh" table-height="85vh"
order="id ASC"
> >
<template #column-addressFk="{ row }"> <template #column-addressFk="{ row }">
{{ dashIfEmpty(formatRow(row)) }} {{ dashIfEmpty(formatRow(row)) }}
@ -239,6 +244,8 @@ function formatRow(row) {
/> />
</template> </template>
</VnTable> </VnTable>
</div>
</div>
</template> </template>
<i18n> <i18n>
@ -246,3 +253,20 @@ es:
Search zone: Buscar zona Search zone: Buscar zona
You can search zones by id or name: Puedes buscar zonas por id o nombre You can search zones by id or name: Puedes buscar zonas por id o nombre
</i18n> </i18n>
<style lang="scss" scoped>
.table-container {
display: flex;
justify-content: center;
}
.column {
display: flex;
flex-direction: column;
align-items: center;
min-width: 70%;
}
:deep(.shrink-column) {
width: 8%;
}
</style>