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

View File

@ -1,16 +1,44 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { computed } from 'vue';
import { useRoute } from 'vue-router';
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';
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>
<template>
<VnCard
data-key="Order"
base-url="Orders"
:descriptor="OrderDescriptor"
:filter-panel="OrderFilter"
search-data-key="OrderList"
:filter-panel="customFilterPanel"
:search-data-key="customRouteRedirectName"
>
<template #searchbar>
<OrderSearchbar />

View File

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