From e62e914e487a4b334287d7e9a1320519fff19dd3 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Jun 2024 14:55:44 +0200 Subject: [PATCH] refs #6897 change image, fit component --- src/components/VnTable/VnFilter.vue | 6 +- src/components/common/VnComponent.vue | 1 - src/i18n/locale/en.yml | 2 + src/i18n/locale/es.yml | 2 + src/pages/Entry/EntryLatestBuys.vue | 27 ++++++--- src/pages/Entry/EntryList.vue | 87 ++++++++++++++++++++++++--- 6 files changed, 105 insertions(+), 20 deletions(-) diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index 3d489cf73..9db688a5f 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -39,7 +39,7 @@ const enterEvent = { const defaultAttrs = { filled: !$props.showTitle, - class: 'q-px-sm q-pb-xs q-pt-none', + class: 'q-px-sm q-pb-xs q-pt-none fit', dense: true, }; @@ -80,7 +80,7 @@ const components = { event: updateEvent, attrs: { dense: true, - class: $props.showTitle ? 'q-py-sm q-mt-md' : 'q-px-md q-py-xs', + class: $props.showTitle ? 'q-py-sm q-mt-md' : 'q-px-md q-py-xs fit', 'toggle-indeterminate': true, }, forceAttrs, @@ -89,7 +89,7 @@ const components = { component: markRaw(VnSelect), event: updateEvent, attrs: { - class: 'q-px-md q-pb-xs q-pt-none', + class: 'q-px-md q-pb-xs q-pt-none fit', dense: true, filled: !$props.showTitle, }, diff --git a/src/components/common/VnComponent.vue b/src/components/common/VnComponent.vue index 318b5ee5f..2e2095f23 100644 --- a/src/components/common/VnComponent.vue +++ b/src/components/common/VnComponent.vue @@ -54,7 +54,6 @@ function toValueAttrs(attrs) { v-bind="mix(toComponent).attrs" v-on="mix(toComponent).event ?? {}" v-model="model" - class="fit" /> diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 23ffddead..89e5b24df 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -442,6 +442,8 @@ entry: packagingFk: Package packingOut: Package out landing: Landing + isExcludedFromAvailable: Es inventory + isRaid: Raid ticket: pageTitles: tickets: Tickets diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index c3aca500f..5be1c5773 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -441,6 +441,8 @@ entry: packagingFk: Embalaje packingOut: Embalaje envĂ­os landing: Llegada + isExcludedFromAvailable: Es inventario + isRaid: Redada ticket: pageTitles: tickets: Tickets diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue index b591b107a..555155a4e 100644 --- a/src/pages/Entry/EntryLatestBuys.vue +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -12,6 +12,8 @@ const router = useRouter(); const stateStore = useStateStore(); const { t } = useI18n(); import { toDate } from 'src/filters'; +import VnImg from 'src/components/ui/VnImg.vue'; +import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; const rowsFetchDataRef = ref(null); const editTableCellDialogRef = ref(null); const allColumnNames = ref([]); @@ -73,10 +75,20 @@ const getInputEvents = (col) => { }; }; -const columns = computed(() => [ +const columns = [ { - label: t('entry.latestBuys.tableVisibleColumns.picture'), - name: 'picture', + label: t('entry.latestBuys.tableVisibleColumns.image'), + name: 'image', + columnField: { + component: VnImg, + attrs: (id) => { + return { + id, + width: '50px', + } + }, + }, + columnFilter: false }, { align: 'left', @@ -229,7 +241,7 @@ const columns = computed(() => [ }, format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing)) }, -]); +]; const editTableCellFormFieldsOptions = [ { field: 'packing', label: t('entry.latestBuys.packing') }, @@ -267,15 +279,16 @@ const applyColumnFilter = async (col) => { onMounted(async () => { stateStore.rightDrawer = true; - const filteredColumns = columns.value.filter((col) => col.name !== 'picture'); - allColumnNames.value = filteredColumns.map((col) => col.name); - await arrayData.fetch({ append: false }); + // const filteredColumns = columns.value.filter((col) => col.name !== 'picture'); + // allColumnNames.value = filteredColumns.map((col) => col.name); + // await arrayData.fetch({ append: false }); }); onUnmounted(() => (stateStore.rightDrawer = false));