fix: refs #8322 add userFilter
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2025-01-21 12:50:30 +01:00
parent 5c593697b9
commit ed5ce3c459
2 changed files with 36 additions and 1 deletions

View File

@ -12,6 +12,7 @@ const props = defineProps({
baseUrl: { type: String, default: undefined },
customUrl: { type: String, default: undefined },
filter: { type: Object, default: () => {} },
userFilter: { type: Object, default: () => {} },
descriptor: { type: Object, required: true },
filterPanel: { type: Object, default: undefined },
searchDataKey: { type: String, default: undefined },
@ -32,6 +33,7 @@ const url = computed(() => {
const arrayData = useArrayData(props.dataKey, {
url: url.value,
filter: props.filter,
userFilter: props.userFilter,
});
onBeforeMount(async () => {

View File

@ -1,7 +1,40 @@
<script setup>
import TravelDescriptor from './TravelDescriptor.vue';
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
const userFilter = {
fields: [
'id',
'ref',
'shipped',
'landed',
'totalEntries',
'warehouseInFk',
'warehouseOutFk',
'cargoSupplierFk',
'agencyModeFk',
],
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
],
};
</script>
<template>
<VnCardBeta data-key="Travel" base-url="Travels" :descriptor="TravelDescriptor" />
<VnCardBeta
data-key="Travel"
base-url="Travels"
:descriptor="TravelDescriptor"
:user-filter="userFilter"
/>
</template>