0
0
Fork 0

updates: OrderCatlago

This commit is contained in:
Javier Segarra 2024-07-22 15:13:03 +02:00
parent 848b267112
commit 368b8404fa
3 changed files with 36 additions and 6 deletions

View File

@ -31,7 +31,10 @@ const url = computed(() => {
if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`; if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`;
return props.customUrl; return props.customUrl;
}); });
const searchRightDataKey = computed(() => {
if (!props.searchDataKey) return route.name;
else return props.searchDataKey;
});
const arrayData = useArrayData(props.dataKey, { const arrayData = useArrayData(props.dataKey, {
url: url.value, url: url.value,
filter: props.filter, filter: props.filter,
@ -74,10 +77,9 @@ if (props.baseUrl) {
:redirect="searchRedirect" :redirect="searchRedirect"
/> />
</slot> </slot>
<slot v-else name="searchbar" />
<RightMenu> <RightMenu>
<template #right-panel v-if="props.filterPanel"> <template #right-panel v-if="props.filterPanel">
<component :is="props.filterPanel" :data-key="props.searchDataKey" /> <component :is="props.filterPanel" :data-key="searchRightDataKey" />
</template> </template>
</RightMenu> </RightMenu>
<QPageContainer> <QPageContainer>

View File

@ -1,16 +1,44 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n';
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import VnCard from 'components/common/VnCard.vue'; import VnCard from 'components/common/VnCard.vue';
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue'; import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
import OrderFilter from './OrderFilter.vue'; import OrderFilter from './OrderFilter.vue';
import OrderSearchbar from './OrderSearchbar.vue'; import OrderSearchbar from './OrderSearchbar.vue';
import OrderCatalogFilter from './OrderCatalogFilter.vue';
const config = {
OrderCatalog: OrderCatalogFilter,
};
const route = useRoute();
const routeName = computed(() => route.name);
const customRouteRedirectName = computed(() => {
const route = config[routeName.value];
if (route) return null;
return 'OrderList';
//Jon, asi es como lo dejamos
// if (routeName.value === 'OrderCatalog') return null;
// return 'OrderList';
});
const customFilterPanel = computed(() => {
const filterPanel = config[routeName.value] ?? OrderFilter;
return filterPanel;
//Jon, asi es como lo dejamos
// if (routeName.value === 'OrderCatalog') return null;
// return 'OrderList';
// if (routeName.value === 'OrderCatalog') return OrderCatalogFilter;
// return OrderFilter;
});
</script> </script>
<template> <template>
<VnCard <VnCard
data-key="Order" data-key="Order"
base-url="Orders" base-url="Orders"
:descriptor="OrderDescriptor" :descriptor="OrderDescriptor"
:filter-panel="OrderFilter" :filter-panel="customFilterPanel"
search-data-key="OrderList" :search-data-key="customRouteRedirectName"
> >
<template #searchbar> <template #searchbar>
<OrderSearchbar /> <OrderSearchbar />

View File

@ -205,7 +205,7 @@ const useLang = (values) => {
<VnFilterPanel <VnFilterPanel
:data-key="props.dataKey" :data-key="props.dataKey"
:hidden-tags="['orderFk', 'orderBy']" :hidden-tags="['orderFk', 'orderBy']"
:unremovable-params="['orderFk', 'orderBy']" :un-removable-params="['orderFk', 'orderBy']"
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:custom-tags="['tagGroups']" :custom-tags="['tagGroups']"
@remove="clearFilter" @remove="clearFilter"