diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 57a5e2c04..2d75ccb22 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -41,16 +41,13 @@ async function search() { }); if (!props.redirect) return; - const moduleRoute = route.matched[1]; - console.log(moduleRoute); - const rows = store.data; + const module = route.matched[1]; if (rows.length === 1) { - const firstRow = rows[0]; - const stateName = `${moduleRoute.name}Card`; - await router.push({ name: stateName, params: { id: firstRow.id } }); + const [firstRow] = rows; + await router.push({ path: `/${module.name}/${firstRow.id}` }); } else if (route.matched.length > 3) { - await router.push({ name: moduleRoute.name }); + await router.push({ path: `/${module.name}` }); arrayData.updateStateParams(); } } diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index b8954702a..c251a2915 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -25,13 +25,8 @@ export function useArrayData(key, userOptions) { if (userOptions.url) store.url = userOptions.url; if (userOptions.limit) store.limit = userOptions.limit; if (userOptions.order) store.order = userOptions.order; - //Object.assign(store.value, userOptions); - //console.log(options.value); } - // if (typeof userOptions === 'object' && userOptions.filter) { - // Object.assign(filter.value, userOptions.filter); - // } onMounted(() => { const query = route.query; if (query.params) { @@ -91,6 +86,12 @@ export function useArrayData(key, userOptions) { canceller = null; } + function clear() { + if (arrayDataStore.get(key)) { + arrayDataStore.clear(key); + } + } + function cancelRequest() { if (canceller) { canceller.abort(); @@ -98,23 +99,6 @@ export function useArrayData(key, userOptions) { } } - // async function request({ userFilter }) { - // if (!store.url) return; - - // const filter = { - // order: store.order, - // limit: store.limit, - // skip: store.skip, - // }; - - // Object.assign(filter, userFilter); - - // const requestOptions = { params: { filter: filter } }; - // const response = await axios.get(store.url, requestOptions); - - // return response.data; - // } - async function applyFilter({ filter, params }) { if (filter) store.userFilter = filter; if (params) store.userParams = Object.assign({}, params); @@ -161,6 +145,7 @@ export function useArrayData(key, userOptions) { applyFilter, addFilter, refresh, + clear, loadMore, store, hasMoreData, diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index df6faf323..19be5756d 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -1,11 +1,18 @@ \ No newline at end of file + + + +es: + Search by claim id or name: Buscar por id o nombre de la reclamación + diff --git a/src/pages/Claim/ClaimFilter.vue b/src/pages/Claim/ClaimFilter.vue deleted file mode 100644 index a64ee7367..000000000 --- a/src/pages/Claim/ClaimFilter.vue +++ /dev/null @@ -1,223 +0,0 @@ - - - - - -en: - params: - fi: FI - name: Name - socialName: Social Name - salesPersonFk: Salesperson - provinceFk: Province - city: City - phone: Phone - email: Email - zoneFk: Zone - postcode: Postcode -es: - params: - fi: NIF - name: Nombre - socialName: Razón Social - salesPersonFk: Comercial - provinceFk: Provincia - city: Ciudad - phone: Teléfono - email: Email - zoneFk: Zona - postcode: CP - FI: NIF - Name: Nombre - Social Name: Razón social - Salesperson: Comercial - Province: Provincia - City: Ciudad - More options: Más opciones - Phone: Teléfono - Email: Email - Zone: Zona - Postcode: Código postal - - - diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index 4373b0354..6001e02d0 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -1,31 +1,24 @@