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 1c6ccfa5a..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,34 +139,22 @@ 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); break; case 'ColorAndPrice': - tagObj.field = 'showOrder, price'; + tagObj.name = 'showOrder, price'; params.orderBy = JSON.stringify(tagObj); break; case 'Name': - tagObj.field = 'name'; + tagObj.name = 'name'; params.orderBy = JSON.stringify(tagObj); break; case 'Price': - tagObj.field = 'price'; + tagObj.name = 'price'; params.orderBy = JSON.stringify(tagObj); break; } @@ -308,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);
- +