From 789dffe2e21e88ed05109542ffd7735cafc5078b Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 19 Jun 2024 12:05:21 +0200 Subject: [PATCH 01/17] refs #6898 vntable, traductions --- src/i18n/locale/en.yml | 8 ++ src/i18n/locale/es.yml | 8 ++ src/pages/Supplier/SupplierList.vue | 141 +++++++++++++++------------- 3 files changed, 90 insertions(+), 67 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 4e7d7bb8a..f740ba9e0 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1015,6 +1015,14 @@ supplier: payDay: Pay day account: Account newSupplier: New supplier + tableVisibleColumns: + id: Id + name: Name + nif: NIF/CIF + nickname: Alias + account: Account + payMethod: Pay Method + payDay: Pay Day summary: responsible: Responsible notes: Notes diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 68ffc4e5b..bf3b60ffc 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1000,6 +1000,14 @@ supplier: payDay: Día de pago account: Cuenta newSupplier: Nuevo proveedor + tableVisibleColumns: + id: Id + name: Nombre + nif: NIF/CIF + nickname: Alias + account: Cuenta + payMethod: Método de pago + payDay: Dia de pago summary: responsible: Responsable notes: Notas diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index d53781a38..9491a938b 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -1,85 +1,92 @@ From a803250cb913e1a821ff6a1bb2eb230ee20ecf88 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 19 Jun 2024 13:01:31 +0200 Subject: [PATCH 02/17] refs #6898 fix create --- src/pages/Supplier/SupplierList.vue | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index 9491a938b..89ab12a67 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -1,11 +1,12 @@ From 9956561e4c907a39d7199646c05dc4e34555bf58 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 24 Jun 2024 16:17:21 +0200 Subject: [PATCH 03/17] chore: refs #7300 wip: create reset function --- src/composables/useArrayData.js | 5 ++++ src/stores/useArrayDataStore.js | 41 +++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index f97ade7bf..385cb6045 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -130,6 +130,10 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { delete store[option]; } + function reset(opts = []) { + if (arrayDataStore.get(key)) arrayDataStore.reset(key, opts); + } + function cancelRequest() { if (canceller) { canceller.abort(); @@ -245,5 +249,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { updateStateParams, isLoading, deleteOption, + reset, }; } diff --git a/src/stores/useArrayDataStore.js b/src/stores/useArrayDataStore.js index ebe32f8d0..0fe16d075 100644 --- a/src/stores/useArrayDataStore.js +++ b/src/stores/useArrayDataStore.js @@ -3,36 +3,47 @@ import { defineStore } from 'pinia'; export const useArrayDataStore = defineStore('arrayDataStore', () => { const state = ref({}); + const defaultOpts = { + filter: {}, + userFilter: {}, + userParams: {}, + url: '', + limit: 10, + skip: 0, + order: '', + data: ref(), + isLoading: false, + userParamsChanged: false, + exprBuilder: null, + searchUrl: 'params', + navigate: null, + }; function get(key) { return state.value[key]; } function set(key) { - state.value[key] = { - filter: {}, - userFilter: {}, - userParams: {}, - url: '', - limit: 10, - skip: 0, - order: '', - data: ref(), - isLoading: false, - userParamsChanged: false, - exprBuilder: null, - searchUrl: 'params', - navigate: null, - }; + state.value[key] = defaultOpts; } function clear(key) { delete state.value[key]; } + function reset(key, opts = []) { + let obj = state.value[key]; + if (!opts.length) obj = defaultOpts; + else + for (const opt in opts) { + if (Object.hasOwn(obj, opt)) obj[opt] = defaultOpts[opt]; + } + } + return { get, set, clear, + reset, }; }); From def8d4222ba886cab30bc7764ecc554d063db958 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 26 Jun 2024 11:33:02 +0200 Subject: [PATCH 04/17] refs #6898 fix warnings --- src/pages/Supplier/SupplierList.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index 89ab12a67..0d60e7219 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -2,8 +2,6 @@ import { computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import VnTable from 'components/VnTable/VnTable.vue'; -import RightMenu from 'src/components/common/RightMenu.vue'; -import SupplierListFilter from './SupplierListFilter.vue'; const { t } = useI18n(); const tableRef = ref(); From efa8791b9d79eeb725e89e4ed3400cca998fcd5f Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 26 Jun 2024 11:40:59 +0200 Subject: [PATCH 05/17] refs #6898 remove comment --- src/pages/Supplier/SupplierList.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index 0d60e7219..efb86b4bb 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -58,11 +58,6 @@ const columns = computed(() => [