From 161922da0934ad2a9e57fb5143a374a8e408453d Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 26 Apr 2024 15:17:03 +0200 Subject: [PATCH 001/170] feat: refs #6825 create vnTable and add in CustomerExtendedList --- src/components/common/VnTable.vue | 243 ++++++++ .../ExtendedList/CustomerExtendedList.vue | 121 ++-- .../CustomerExtendedListBackup.vue | 571 ++++++++++++++++++ 3 files changed, 877 insertions(+), 58 deletions(-) create mode 100644 src/components/common/VnTable.vue create mode 100644 src/pages/Customer/ExtendedList/CustomerExtendedListBackup.vue diff --git a/src/components/common/VnTable.vue b/src/components/common/VnTable.vue new file mode 100644 index 000000000..a537c5215 --- /dev/null +++ b/src/components/common/VnTable.vue @@ -0,0 +1,243 @@ + + + diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue index a24d3211a..789e90834 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue @@ -2,6 +2,8 @@ import { ref, computed, onBeforeMount, onMounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; +import VnInput from 'src/components/common/VnInput.vue'; +import VnTable from 'components/common/VnTable.vue'; import { QBtn, QIcon } from 'quasar'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; @@ -266,28 +268,30 @@ const tableColumnComponents = { const columns = computed(() => [ { align: 'left', - field: '', - label: '', + field: 'customerStatus', + label: 'customerStatus', name: 'customerStatus', - format: () => ' ', }, { align: 'left', field: 'id', label: t('customer.extendedList.tableVisibleColumns.id'), name: 'id', + isId: true, }, { align: 'left', field: 'name', label: t('customer.extendedList.tableVisibleColumns.name'), name: 'name', + cardVisible: true, }, { align: 'left', field: 'fi', label: t('customer.extendedList.tableVisibleColumns.fi'), name: 'fi', + cardVisible: true, }, { align: 'left', @@ -494,7 +498,7 @@ const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id); /> - + - - + + + From e0379dd1bc5d2dc565e0052b1e15b7e006c76605 Mon Sep 17 00:00:00 2001 From: alexm Date: Sun, 28 Apr 2024 18:47:44 +0200 Subject: [PATCH 002/170] feat: refs #6825 fix modes --- src/components/common/VnTable.vue | 131 +++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 37 deletions(-) diff --git a/src/components/common/VnTable.vue b/src/components/common/VnTable.vue index a537c5215..2f60fb634 100644 --- a/src/components/common/VnTable.vue +++ b/src/components/common/VnTable.vue @@ -1,14 +1,14 @@ diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue index 789e90834..444726ad2 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedList.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedList.vue @@ -1,19 +1,15 @@ diff --git a/src/components/common/VnTableFilterMore.vue b/src/components/common/VnTableFilterMore.vue new file mode 100644 index 000000000..fd4880431 --- /dev/null +++ b/src/components/common/VnTableFilterMore.vue @@ -0,0 +1,13 @@ + + diff --git a/src/components/common/VnTableObj.json b/src/components/common/VnTableObj.json new file mode 100644 index 000000000..ceaedd647 --- /dev/null +++ b/src/components/common/VnTableObj.json @@ -0,0 +1,33 @@ +// { +// isId: Boolean +// align: 'left', +// field: 'hasFile', +// label: t('globals.original'), +// name: 'hasFile', +// component: QCheckbox ?? span, +// cardVisible: Boolean +// isId: 1/2 +// color: function +// props: (prop) => ({ +// disable: true, +// 'model-value': Boolean(prop.value), +// }), +// tableActions: { +// field: 'tableActions', +// name: 'tableActions', +// actions: [ +// { +// title: t('Client ticket list'), +// icon: 'vn:ticket', +// action: redirectToCreateView, +// isPrimary: true, +// }, +// { +// title: t('Client ticket list'), +// icon: 'preview', +// action: (row) => viewSummary(row.id, CustomerSummary), +// }, +// ], +// }, +// }, +// tableActions y hacer bucle diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index eb0bbbe66..380bafb03 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -62,6 +62,8 @@ onMounted(() => { if (Object.keys(store.userParams).length > 0) { userParams.value = JSON.parse(JSON.stringify(store.userParams)); } + + console.log('userParams.value: ', userParams.value); emit('init', { params: userParams.value }); }); @@ -165,7 +167,7 @@ function formatValue(value) { - + [ field: 'customerStatus', label: 'customerStatus', name: 'customerStatus', + columnFilter: false, }, { align: 'left', @@ -272,6 +273,9 @@ const columns = computed(() => [ label: t('customer.extendedList.tableVisibleColumns.id'), name: 'id', isId: 1, + columnFilter: { + field: 'search', + }, }, { align: 'left', @@ -279,6 +283,11 @@ const columns = computed(() => [ label: t('customer.extendedList.tableVisibleColumns.name'), name: 'name', isId: 2, + columnFilter: { + inWhere: { + prefix: 'c', + }, + }, }, { align: 'left', From 6a6a47bc82f03bb5a0b1dec94519a656b5a5cc69 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 6 May 2024 15:26:57 +0200 Subject: [PATCH 006/170] feat: refs #6825 right filter panel --- src/components/common/VnSelect.vue | 13 +++- src/components/common/VnTable.vue | 76 +++++++++++++++---- src/components/common/VnTableFilter.vue | 38 +++++++--- src/components/ui/VnFilterPanel.vue | 39 +++++++--- .../ExtendedList/CustomerExtendedList.vue | 10 +-- 5 files changed, 132 insertions(+), 44 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 05c74f00a..0fea2180b 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -16,11 +16,11 @@ const $props = defineProps({ }, optionLabel: { type: [String], - default: '', + default: 'name', }, optionValue: { type: String, - default: '', + default: 'id', }, url: { type: String, @@ -108,11 +108,18 @@ async function fetchFilter(val) { const { fields, sortBy, limit } = $props; let key = optionLabel.value; + console.log('key: ', key); if (new RegExp(/\d/g).test(val)) key = optionValue.value; + console.log('key: ', key); const where = { [key]: { like: `%${val}%` } }; - return dataRef.value.fetch({ fields, where, order: sortBy, limit }); + const fetchOptions = { where, order: sortBy, limit }; + console.log('where: ', where); + console.log('fields: ', fields); + if (fields) fetchOptions.fields = fields; + console.log('fetchOptions: ', fetchOptions); + return dataRef.value.fetch(fetchOptions); } async function filterHandler(val, update) { diff --git a/src/components/common/VnTable.vue b/src/components/common/VnTable.vue index 66296311f..b18f34779 100644 --- a/src/components/common/VnTable.vue +++ b/src/components/common/VnTable.vue @@ -168,9 +168,9 @@ function columnsCard(cols) {