From e51ea9996b5bb8fb797ec1085313cd24b69bbea3 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 9 Apr 2024 08:18:18 -0300 Subject: [PATCH] Item list view --- src/components/ui/VnPaginate.vue | 7 +- src/composables/useArrayData.js | 2 + src/i18n/en/index.js | 2 + src/i18n/es/index.js | 2 + src/pages/Item/ItemCreate.vue | 1 + src/pages/Item/ItemList.vue | 443 +++++++++++++++---------------- src/router/modules/item.js | 8 + 7 files changed, 239 insertions(+), 226 deletions(-) create mode 100644 src/pages/Item/ItemCreate.vue diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index d1b2f5ccb..fc81c82b1 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -61,7 +61,6 @@ const props = defineProps({ }); const emit = defineEmits(['onFetch', 'onPaginate']); -defineExpose({ fetch }); const isLoading = ref(false); const pagination = ref({ sortBy: props.order, @@ -91,6 +90,10 @@ watch( } ); +const addFilter = async (filter, params) => { + await arrayData.addFilter({ filter, params }); +}; + async function fetch() { await arrayData.fetch({ append: false }); if (!arrayData.hasMoreData.value) { @@ -140,6 +143,8 @@ async function onLoad(index, done) { if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value; done(isDone); } + +defineExpose({ fetch, addFilter });