feat: refs #8118 add VnDropdown component and integrate it into Claim and Ticket summaries #1517

Merged
benjaminedc merged 53 commits from 8118-createComponentVnDropdown into dev 2025-03-26 10:32:30 +00:00
3 changed files with 14 additions and 15 deletions
Showing only changes of commit b7309298aa - Show all commits
src
components/common
pages

View File

@ -48,15 +48,6 @@ async function changeState(value) {
focus-on-mount
@update:model-value="changeState"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.name || scope.opt?.description }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
benjaminedc marked this conversation as resolved
Review

Este template es el que tiene por defecto VnSelect, no hace falta que lo añadas aquí.

Este template es el que tiene por defecto VnSelect, no hace falta que lo añadas aquí.
</QBtnDropdown>
</template>

View File

@ -183,14 +183,15 @@ async function changeState(value) {
function claimUrl(section) {
return '#/claim/' + entityId.value + '/' + section;
}
onMounted(async () => {
const { data } = await axios.get('ClaimStates');
claimStates.value = data;
});
</script>
benjaminedc marked this conversation as resolved Outdated

Pasar a fetchData y obtener solo los campos que necesitas(id y name)

Pasar a fetchData y obtener solo los campos que necesitas(id y name)
<template>
<FetchData
url="ClaimStates"
:filter="{ fields: ['id', 'description'] }"
@on-fetch="(data) => (claimStates = data)"
auto-load
/>
<FetchData
url="ClaimDms"
:filter="claimDmsFilter"
@ -208,7 +209,12 @@ onMounted(async () => {
{{ claim.id }} - {{ claim.client.name }} ({{ claim.client.id }})
</template>
<template #header-right>
<VnDropdown :options="claimStates" @change-state="changeState($event)" />
<VnDropdown
:options="claimStates"
option-value="id"
option-label="description"
benjaminedc marked this conversation as resolved Outdated

Si usas id no no hace falta pasar la propiedad, utiliza ese por defecto

Si usas id no no hace falta pasar la propiedad, utiliza ese por defecto
@change-state="changeState($event)"
/>
</template>
<template #menu="{ entity }">
<ClaimDescriptorMenu :claim="entity.claim" />

View File

@ -117,6 +117,8 @@ onMounted(async () => {
:moduleId="entityId"
:options="editableStates"
:disable="!isEditable()"
benjaminedc marked this conversation as resolved Outdated

no hace falta usar ":" cuando es texto.

no hace falta usar ":" cuando es texto.
:option-label="'name'"
benjaminedc marked this conversation as resolved Outdated

Aquí tenías puesto antes el code, ahora usas el id,, pero el back espera un code.

Aquí tenías puesto antes el code, ahora usas el id,, pero el back espera un code.
:option-value="'code'"
benjaminedc marked this conversation as resolved
Review

No hace falta poner $event, con poner changeState es suficiente.

No hace falta poner $event, con poner **changeState** es suficiente.
@change-state="changeState($event)"
/>
</template>