From ec5eeaa30831e09f261e8d61b44665599cb1c497 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 28 Jun 2024 10:14:24 +0200 Subject: [PATCH] fix: refs #6151 fixed filters and styles --- src/pages/Order/Card/OrderCard.vue | 9 ++---- src/pages/Order/Card/OrderCatalogFilter.vue | 35 ++++++--------------- src/pages/Order/Card/OrderCatalogItem.vue | 2 +- src/pages/Order/Card/OrderSummary.vue | 24 +++++++++----- src/pages/Order/OrderCatalog.vue | 1 + src/pages/Order/OrderList.vue | 8 +++-- 6 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/pages/Order/Card/OrderCard.vue b/src/pages/Order/Card/OrderCard.vue index 5b6896656..12b61e913 100644 --- a/src/pages/Order/Card/OrderCard.vue +++ b/src/pages/Order/Card/OrderCard.vue @@ -2,7 +2,6 @@ import VnCard from 'components/common/VnCard.vue'; import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue'; import OrderFilter from './OrderFilter.vue'; -import OrderSearchbar from './OrderSearchbar.vue'; diff --git a/src/pages/Order/Card/OrderCatalogFilter.vue b/src/pages/Order/Card/OrderCatalogFilter.vue index fd5300122..c354ec94b 100644 --- a/src/pages/Order/Card/OrderCatalogFilter.vue +++ b/src/pages/Order/Card/OrderCatalogFilter.vue @@ -37,6 +37,10 @@ const selectedOrder = ref(null); const selectedOrderField = ref(null); const moreFields = ref([]); const moreFieldsOrder = ref([]); +const selectedTag = ref(null); +const tagValues = ref([{}]); +const tagOptions = ref([]); + const createValue = (val, done) => { if (val.length > 2) { if (!tagOptions.value.includes(val)) { @@ -95,10 +99,6 @@ function exprBuilder(param, value) { } } -const selectedTag = ref(null); -const tagValues = ref([{}]); -const tagOptions = ref([]); - const applyTagFilter = (params, search) => { if (!tagValues.value?.length) { params.tagGroups = null; @@ -139,39 +139,23 @@ const onOrderChange = (value, params) => { }; const onOrderFieldChange = (value, params) => { - const tagObj = JSON.parse(params.orderBy); // esto donde va - const fields = { - Relevancy: (value) => value + ' DESC, name', - ColorAndPrice: 'showOrder, price', - Name: 'name', - Price: 'price', - }; - let tagField = fields[value]; - if (!tagField) return; - - if (typeof tagField === 'function') tagField = tagField(value); - tagObj.field = tagField; - params.orderBy = JSON.stringify(tagObj); + const tagObj = JSON.parse(params.orderBy); switch (value) { case 'Relevancy': - tagObj.field = value + ' DESC, name'; + tagObj.name = value + ' DESC, name'; params.orderBy = JSON.stringify(tagObj); - console.log('params: ', params); break; case 'ColorAndPrice': - tagObj.field = 'showOrder, price'; + tagObj.name = 'showOrder, price'; params.orderBy = JSON.stringify(tagObj); - console.log('params: ', params); break; case 'Name': - tagObj.field = 'name'; + tagObj.name = 'name'; params.orderBy = JSON.stringify(tagObj); - console.log('params: ', params); break; case 'Price': - tagObj.field = 'price'; + tagObj.name = 'price'; params.orderBy = JSON.stringify(tagObj); - console.log('params: ', params); break; } }; @@ -312,6 +296,7 @@ const useLang = (values) => { v-model="selectedOrder" :options="moreFields" option-label="label" + option-value="way" dense outlined rounded diff --git a/src/pages/Order/Card/OrderCatalogItem.vue b/src/pages/Order/Card/OrderCatalogItem.vue index 34e22915d..8fa0bb5b9 100644 --- a/src/pages/Order/Card/OrderCatalogItem.vue +++ b/src/pages/Order/Card/OrderCatalogItem.vue @@ -27,7 +27,7 @@ const dialog = ref(null);
- +