refactor: refs #8463 replace CardDescriptor with EntityDescriptor in multiple components

This commit is contained in:
Alex Moreno 2025-03-14 09:13:45 +01:00
parent 148eab2333
commit 1139035e45
28 changed files with 171 additions and 171 deletions

View File

@ -73,10 +73,10 @@ function hasRouteParam(params, valueToCheck = ':addressId') {
} }
</script> </script>
<template> <template>
<span v-if="visual"> <template v-if="visual">
<VnSubToolbar /> <VnSubToolbar />
<div :class="[useCardSize(), $attrs.class]"> <div :class="[useCardSize(), $attrs.class]">
<RouterView :key="$route.path" /> <RouterView :key="$route.path" />
</div> </div>
</span> </template>
</template> </template>

View File

@ -1,76 +1,36 @@
<script setup> <script setup>
import { onBeforeMount, watch, computed, ref } from 'vue'; import { ref } from 'vue';
import { useArrayData } from 'composables/useArrayData';
import { useState } from 'src/composables/useState';
import { useRoute } from 'vue-router';
import VnDescriptor from './VnDescriptor.vue'; import VnDescriptor from './VnDescriptor.vue';
const $props = defineProps({ const $props = defineProps({
url: { id: {
type: String, type: Number,
default: '', default: false,
}, },
filter: { card: {
type: Object, type: Object,
default: null, default: null,
}, },
dataKey: {
type: String,
default: null,
},
}); });
const state = useState();
const route = useRoute();
let arrayData;
let store;
let entity;
const isLoading = ref(false);
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
defineExpose({ getData });
onBeforeMount(async () => {
arrayData = useArrayData($props.dataKey, {
url: $props.url,
userFilter: $props.filter,
skip: 0,
oneRecord: true,
});
store = arrayData.store;
entity = computed(() => {
const data = store.data ?? {};
if (data) emit('onFetch', data);
return data;
});
// It enables to load data only once if the module is the same as the dataKey
if (!isSameDataKey.value || !route.params.id) await getData();
watch(
() => [$props.url, $props.filter],
async () => {
if (!isSameDataKey.value) await getData();
},
);
});
async function getData() {
store.url = $props.url;
store.filter = $props.filter ?? {};
isLoading.value = true;
try {
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
state.set($props.dataKey, data);
emit('onFetch', data);
} finally {
isLoading.value = false;
}
}
const emit = defineEmits(['onFetch']); const emit = defineEmits(['onFetch']);
const entity = ref();
</script> </script>
<template> <template>
<VnDescriptor v-model="entity" v-bind="$attrs" :module="dataKey"> <component
:is="card"
:id
:visual="false"
v-bind="$attrs"
@on-fetch="
(data) => {
entity = data;
emit('onFetch', data);
}
"
/>
<VnDescriptor v-model="entity" v-bind="$attrs">
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName"> <template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" /> <slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template> </template>

View File

@ -1,38 +0,0 @@
<script setup>
import { ref } from 'vue';
import VnDescriptor from './VnDescriptor.vue';
const $props = defineProps({
id: {
type: Number,
default: false,
},
card: {
type: Object,
default: null,
},
});
const emit = defineEmits(['onFetch']);
const entity = ref();
</script>
<template>
<component
:is="card"
:id
:visual="false"
v-bind="$attrs"
@on-fetch="
(data) => {
entity = data;
emit('onFetch', data);
}
"
/>
<VnDescriptor v-model="entity" v-bind="$attrs">
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template>
</VnDescriptor>
</template>

View File

@ -0,0 +1,78 @@
<script setup>
import { onBeforeMount, watch, computed, ref } from 'vue';
import { useArrayData } from 'composables/useArrayData';
import { useState } from 'src/composables/useState';
import { useRoute } from 'vue-router';
import VnDescriptor from './VnDescriptor.vue';
const $props = defineProps({
url: {
type: String,
default: '',
},
filter: {
type: Object,
default: null,
},
dataKey: {
type: String,
default: null,
},
});
const state = useState();
const route = useRoute();
let arrayData;
let store;
let entity;
const isLoading = ref(false);
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
defineExpose({ getData });
onBeforeMount(async () => {
arrayData = useArrayData($props.dataKey, {
url: $props.url,
userFilter: $props.filter,
skip: 0,
oneRecord: true,
});
store = arrayData.store;
entity = computed(() => {
const data = store.data ?? {};
if (data) emit('onFetch', data);
return data;
});
// It enables to load data only once if the module is the same as the dataKey
if (!isSameDataKey.value || !route.params.id) await getData();
watch(
() => [$props.url, $props.filter],
async () => {
if (!isSameDataKey.value) await getData();
},
);
});
async function getData() {
store.url = $props.url;
store.filter = $props.filter ?? {};
isLoading.value = true;
try {
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
state.set($props.dataKey, data);
emit('onFetch', data);
} finally {
isLoading.value = false;
}
}
const emit = defineEmits(['onFetch']);
</script>
<template>
<VnDescriptor v-model="entity" v-bind="$attrs" :module="dataKey">
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template>
</VnDescriptor>
</template>

View File

@ -118,7 +118,7 @@ const toModule = computed(() => {
</QBtn> </QBtn>
</slot> </slot>
<QBtn <QBtn
@click.stop="viewSummary(entity.id, $props.summary, $props.width)" @click.stop="viewSummary(entity.id, summary, width)"
round round
flat flat
dense dense
@ -158,8 +158,8 @@ const toModule = computed(() => {
<QList dense> <QList dense>
<QItemLabel header class="ellipsis text-h5" :lines="1"> <QItemLabel header class="ellipsis text-h5" :lines="1">
<div class="title"> <div class="title">
<span v-if="$props.title" :title="getValueFromPath(title)"> <span v-if="title" :title="getValueFromPath(title)">
{{ getValueFromPath(title) ?? $props.title }} {{ getValueFromPath(title) ?? title }}
</span> </span>
<slot v-else name="description" :entity="entity"> <slot v-else name="description" :entity="entity">
<span :title="entity.name"> <span :title="entity.name">

View File

@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import axios from 'axios'; import axios from 'axios';
@ -48,7 +48,7 @@ const removeAlias = () => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
ref="descriptor" ref="descriptor"
:url="`MailAliases/${entityId}`" :url="`MailAliases/${entityId}`"
data-key="Alias" data-key="Alias"
@ -62,7 +62,7 @@ const removeAlias = () => {
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('role.description')" :value="entity.description" /> <VnLv :label="t('role.description')" :value="entity.description" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import AccountDescriptorMenu from './AccountDescriptorMenu.vue'; import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
import VnImg from 'src/components/ui/VnImg.vue'; import VnImg from 'src/components/ui/VnImg.vue';
@ -20,7 +20,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
ref="descriptor" ref="descriptor"
:url="`VnUsers/preview`" :url="`VnUsers/preview`"
:filter="{ ...filter, where: { id: entityId } }" :filter="{ ...filter, where: { id: entityId } }"
@ -78,7 +78,7 @@ onMounted(async () => {
</QIcon> </QIcon>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<style scoped> <style scoped>
.q-item__label { .q-item__label {

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import axios from 'axios'; import axios from 'axios';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
@ -32,7 +32,7 @@ const removeRole = async () => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
url="VnRoles" url="VnRoles"
:filter="{ where: { id: entityId } }" :filter="{ where: { id: entityId } }"
data-key="Role" data-key="Role"
@ -46,7 +46,7 @@ const removeRole = async () => {
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('role.description')" :value="entity.description" /> <VnLv :label="t('role.description')" :value="entity.description" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<style scoped> <style scoped>
.q-item__label { .q-item__label {

View File

@ -6,7 +6,7 @@ import { toDateHourMinSec, toPercentage } from 'src/filters';
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue'; import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue'; import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
@ -44,7 +44,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Claims/${entityId}`" :url="`Claims/${entityId}`"
:filter="filter" :filter="filter"
title="client.name" title="client.name"
@ -147,7 +147,7 @@ onMounted(async () => {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<style scoped> <style scoped>
.q-item__label { .q-item__label {

View File

@ -7,7 +7,7 @@ import { toCurrency, toDate } from 'src/filters';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue'; import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
@ -54,7 +54,7 @@ const debtWarning = computed(() => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Clients/${entityId}/getCard`" :url="`Clients/${entityId}/getCard`"
:summary="$props.summary" :summary="$props.summary"
data-key="Customer" data-key="Customer"
@ -232,7 +232,7 @@ const debtWarning = computed(() => {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -6,7 +6,7 @@ import { toDate } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue'; import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
import axios from 'axios'; import axios from 'axios';
@ -145,7 +145,7 @@ async function deleteEntry() {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Entries/${entityId}`" :url="`Entries/${entityId}`"
:filter="entryFilter" :filter="entryFilter"
title="supplier.nickname" title="supplier.nickname"
@ -264,7 +264,7 @@ async function deleteEntry() {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>
es: es:

View File

@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n';
import axios from 'axios'; import axios from 'axios';
import { toCurrency, toDate } from 'src/filters'; import { toCurrency, toDate } from 'src/filters';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
import filter from './InvoiceInFilter.js'; import filter from './InvoiceInFilter.js';
import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue'; import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue';
@ -88,7 +88,7 @@ async function setInvoiceCorrection(id) {
} }
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
ref="cardDescriptorRef" ref="cardDescriptorRef"
data-key="InvoiceIn" data-key="InvoiceIn"
:url="`InvoiceIns/${entityId}`" :url="`InvoiceIns/${entityId}`"
@ -163,7 +163,7 @@ async function setInvoiceCorrection(id) {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.q-dialog { .q-dialog {

View File

@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue'; import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue';
@ -34,7 +34,7 @@ function ticketFilter(invoice) {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
ref="descriptor" ref="descriptor"
:url="`InvoiceOuts/${entityId}`" :url="`InvoiceOuts/${entityId}`"
:filter="filter" :filter="filter"
@ -93,5 +93,5 @@ function ticketFilter(invoice) {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>

View File

@ -3,7 +3,7 @@ import { computed, ref, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; import EntityDescriptor from 'src/components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue'; import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
@ -90,7 +90,7 @@ const updateStock = async () => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
data-key="Item" data-key="Item"
:summary="$props.summary" :summary="$props.summary"
:url="`Items/${entityId}/getCard`" :url="`Items/${entityId}/getCard`"
@ -162,7 +162,7 @@ const updateStock = async () => {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import filter from './ItemTypeFilter.js'; import filter from './ItemTypeFilter.js';
@ -25,7 +25,7 @@ const entityId = computed(() => {
}); });
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`ItemTypes/${entityId}`" :url="`ItemTypes/${entityId}`"
:filter="filter" :filter="filter"
title="code" title="code"
@ -45,5 +45,5 @@ const entityId = computed(() => {
:value="entity.category?.name" :value="entity.category?.name"
/> />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>

View File

@ -7,7 +7,7 @@ import { useState } from 'src/composables/useState';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import OrderCard from './OrderCard.vue'; import OrderCard from './OrderCard.vue';
import CardDescriptorBeta from 'src/components/ui/CardDescriptorBeta.vue'; import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
const DEFAULT_ITEMS = 0; const DEFAULT_ITEMS = 0;
@ -53,7 +53,7 @@ const getConfirmationValue = (isConfirmed) => {
} }
" "
/> />
<CardDescriptorBeta <CardDescriptor
v-bind="$attrs" v-bind="$attrs"
:id="entityId" :id="entityId"
:card="OrderCard" :card="OrderCard"
@ -110,5 +110,5 @@ const getConfirmationValue = (isConfirmed) => {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptorBeta> </CardDescriptor>
</template> </template>

View File

@ -3,7 +3,7 @@ import { computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
const props = defineProps({ const props = defineProps({
@ -21,7 +21,7 @@ const { store } = useArrayData('Parking');
const card = computed(() => store.data); const card = computed(() => store.data);
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
data-key="Agency" data-key="Agency"
:url="`Agencies/${entityId}`" :url="`Agencies/${entityId}`"
:title="card?.name" :title="card?.name"
@ -30,5 +30,5 @@ const card = computed(() => store.data);
<template #body="{ entity: agency }"> <template #body="{ entity: agency }">
<VnLv :label="t('globals.name')" :value="agency.name" /> <VnLv :label="t('globals.name')" :value="agency.name" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import { dashIfEmpty, toDate } from 'src/filters'; import { dashIfEmpty, toDate } from 'src/filters';
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue'; import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
@ -47,7 +47,7 @@ onMounted(async () => {
}); });
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Routes/${entityId}`" :url="`Routes/${entityId}`"
:filter="filter" :filter="filter"
:title="null" :title="null"
@ -69,7 +69,7 @@ onMounted(async () => {
<template #menu="{ entity }"> <template #menu="{ entity }">
<RouteDescriptorMenu :route="entity" /> <RouteDescriptorMenu :route="entity" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>
es: es:

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import { dashIfEmpty, toDateHourMin } from 'src/filters'; import { dashIfEmpty, toDateHourMin } from 'src/filters';
import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue'; import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue';
@ -30,7 +30,7 @@ const entityId = computed(() => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Roadmaps/${entityId}`" :url="`Roadmaps/${entityId}`"
:filter="filter" :filter="filter"
data-key="Roadmap" data-key="Roadmap"
@ -51,7 +51,7 @@ const entityId = computed(() => {
<template #menu="{ entity }"> <template #menu="{ entity }">
<RoadmapDescriptorMenu :route="entity" /> <RoadmapDescriptorMenu :route="entity" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>
es: es:

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import axios from 'axios'; import axios from 'axios';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
@ -20,7 +20,7 @@ const route = useRoute();
const entityId = computed(() => props.id || route.params.id); const entityId = computed(() => props.id || route.params.id);
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Vehicles/${entityId}`" :url="`Vehicles/${entityId}`"
data-key="Vehicle" data-key="Vehicle"
title="numberPlate" title="numberPlate"
@ -53,7 +53,7 @@ const entityId = computed(() => props.id || route.params.id);
<VnLv :label="$t('globals.model')" :value="entity.model" /> <VnLv :label="$t('globals.model')" :value="entity.model" />
<VnLv :label="$t('globals.country')" :value="entity.countryCodeFk" /> <VnLv :label="$t('globals.country')" :value="entity.countryCodeFk" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>
es: es:

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import ShelvingDescriptorMenu from 'pages/Shelving/Card/ShelvingDescriptorMenu.vue'; import ShelvingDescriptorMenu from 'pages/Shelving/Card/ShelvingDescriptorMenu.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue';
@ -24,7 +24,7 @@ const entityId = computed(() => {
}); });
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Shelvings/${entityId}`" :url="`Shelvings/${entityId}`"
:filter="filter" :filter="filter"
title="code" title="code"
@ -45,5 +45,5 @@ const entityId = computed(() => {
<template #menu="{ entity }"> <template #menu="{ entity }">
<ShelvingDescriptorMenu :shelving="entity" /> <ShelvingDescriptorMenu :shelving="entity" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import filter from './ParkingFilter.js'; import filter from './ParkingFilter.js';
const props = defineProps({ const props = defineProps({
@ -16,7 +16,7 @@ const route = useRoute();
const entityId = computed(() => props.id || route.params.id); const entityId = computed(() => props.id || route.params.id);
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
data-key="Parking" data-key="Parking"
:url="`Parkings/${entityId}`" :url="`Parkings/${entityId}`"
title="code" title="code"
@ -28,5 +28,5 @@ const entityId = computed(() => props.id || route.params.id);
<VnLv :label="$t('parking.pickingOrder')" :value="entity.pickingOrder" /> <VnLv :label="$t('parking.pickingOrder')" :value="entity.pickingOrder" />
<VnLv :label="$t('parking.sector')" :value="entity.sector?.description" /> <VnLv :label="$t('parking.sector')" :value="entity.sector?.description" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>

View File

@ -3,7 +3,7 @@ import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { toDateString } from 'src/filters'; import { toDateString } from 'src/filters';
@ -61,7 +61,7 @@ const getEntryQueryParams = (supplier) => {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Suppliers/${entityId}`" :url="`Suppliers/${entityId}`"
:filter="filter" :filter="filter"
data-key="Supplier" data-key="Supplier"
@ -136,7 +136,7 @@ const getEntryQueryParams = (supplier) => {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -4,7 +4,7 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import DepartmentDescriptorProxy from 'pages/Worker/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue'; import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { toDateTimeFormat } from 'src/filters/date'; import { toDateTimeFormat } from 'src/filters/date';
@ -57,7 +57,7 @@ function getInfo() {
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Tickets/${entityId}`" :url="`Tickets/${entityId}`"
:filter="filter" :filter="filter"
data-key="Ticket" data-key="Ticket"
@ -155,7 +155,7 @@ function getInfo() {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue'; import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
@ -31,7 +31,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
:url="`Travels/${entityId}`" :url="`Travels/${entityId}`"
:title="data.title" :title="data.title"
:subtitle="data.subtitle" :subtitle="data.subtitle"
@ -79,7 +79,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -2,7 +2,7 @@
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; import EntityDescriptor from 'src/components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import VnChangePassword from 'src/components/common/VnChangePassword.vue'; import VnChangePassword from 'src/components/common/VnChangePassword.vue';
@ -52,7 +52,7 @@ const handlePhotoUpdated = (evt = false) => {
}; };
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
ref="cardDescriptorRef" ref="cardDescriptorRef"
:data-key="dataKey" :data-key="dataKey"
:summary="$props.summary" :summary="$props.summary"
@ -167,7 +167,7 @@ const handlePhotoUpdated = (evt = false) => {
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
<VnChangePassword <VnChangePassword
ref="changePassRef" ref="changePassRef"
:submit-fn=" :submit-fn="

View File

@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useVnConfirm } from 'composables/useVnConfirm'; import { useVnConfirm } from 'composables/useVnConfirm';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue'; import EntityDescriptor from 'src/components/ui/EntityDescriptor.vue';
import axios from 'axios'; import axios from 'axios';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
@ -40,7 +40,7 @@ const removeDepartment = async () => {
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
</script> </script>
<template> <template>
<CardDescriptor <EntityDescriptoror
ref="DepartmentDescriptorRef" ref="DepartmentDescriptorRef"
:url="`Departments/${entityId}`" :url="`Departments/${entityId}`"
:summary="$props.summary" :summary="$props.summary"
@ -95,7 +95,7 @@ const { openConfirmationModal } = useVnConfirm();
</QBtn> </QBtn>
</QCardActions> </QCardActions>
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>
<i18n> <i18n>

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { toTimeFormat } from 'src/filters/date'; import { toTimeFormat } from 'src/filters/date';
import { toCurrency } from 'filters/index'; import { toCurrency } from 'filters/index';
@ -25,7 +25,7 @@ const entityId = computed(() => {
</script> </script>
<template> <template>
<CardDescriptor :url="`Zones/${entityId}`" :filter="filter" data-key="Zone"> <EntityDescriptoror :url="`Zones/${entityId}`" :filter="filter" data-key="Zone">
<template #menu="{ entity }"> <template #menu="{ entity }">
<ZoneDescriptorMenuItems :zone="entity" /> <ZoneDescriptorMenuItems :zone="entity" />
</template> </template>
@ -36,5 +36,5 @@ const entityId = computed(() => {
<VnLv :label="$t('list.price')" :value="toCurrency(entity.price)" /> <VnLv :label="$t('list.price')" :value="toCurrency(entity.price)" />
<VnLv :label="$t('zone.bonus')" :value="toCurrency(entity.bonus)" /> <VnLv :label="$t('zone.bonus')" :value="toCurrency(entity.bonus)" />
</template> </template>
</CardDescriptor> </EntityDescriptoror>
</template> </template>