0
0
Fork 0

Merge pull request 'Se hace corrección en el desplegable' (#9) from features/ms_19_desplegable_detalle_2 into dev

Reviewed-on: hyervoni/salix-front-mindshore#9
This commit is contained in:
Carlos Fonseca 2023-11-23 17:32:00 +00:00
commit 2755e3c20e
3 changed files with 48 additions and 42 deletions

View File

@ -83,6 +83,7 @@ const options = [
</QTooltip> </QTooltip>
</QBtn> </QBtn>
</RouterLink> </RouterLink>
<RouterLink :to="{ name: `${module}Summary`, params: { id: entity.id } }"> <RouterLink :to="{ name: `${module}Summary`, params: { id: entity.id } }">
<QBtn <QBtn
class="link" class="link"
@ -93,31 +94,21 @@ const options = [
round round
size="md" size="md"
> >
<QMenu auto-close> <QTooltip>
<QList dense v-for="option in options" :key="option"> {{ t('components.cardDescriptor.summary') }}
<QItem v-ripple clickable> </QTooltip>
{{ option }}
</QItem>
</QList>
</QMenu>
</QBtn> </QBtn>
</RouterLink> </RouterLink>
<QBtn <QBtn color="white" dense flat icon="more_vert" round size="md">
color="white"
dense
flat
icon="more_vert"
round
size="md"
v-if="slots.menu"
>
<QTooltip> <QTooltip>
{{ t('components.cardDescriptor.moreOptions') }} {{ t('components.cardDescriptor.moreOptions') }}
</QTooltip> </QTooltip>
<QMenu> <QMenu>
<QList> <QList dense v-for="option in options" :key="option">
<slot name="menu" :entity="entity" /> <QItem v-ripple clickable>
{{ option }}
</QItem>
</QList> </QList>
</QMenu> </QMenu>
</QBtn> </QBtn>

View File

@ -1,21 +1,35 @@
<script setup> <script setup>
import { ref, watch } from 'vue';
const $props = defineProps({ const $props = defineProps({
id: { type: Number, default: null }, id: { type: Number, default: null },
isSelected: { type: Boolean, default: false },
title: { type: String, default: null }, title: { type: String, default: null },
}); });
const checkSelect = ref(false);
watch(
() => $props.isSelected,
(value, prevValue) => {
checkSelect.value = value;
}
);
</script> </script>
<template> <template>
<QCard class="card q-mb-md cursor-pointer q-hoverable bg-white-7 q-pa-lg"> <QCard class="card q-mb-md cursor-pointer q-hoverable bg-white-7 q-pa-lg">
<div> <div>
<slot name="title"> <slot name="title">
<div class="flex justify-between">
<div class="flex"> <div class="flex">
<div class="title text-primary text-weight-bold text-h5"> <div class="title text-primary text-weight-bold text-h5">
{{ $props.title ?? `#${$props.id}` }} {{ $props.title }}
</div> </div>
<div class="q_chip"> <QChip outline color="grey" size="sm">
<QChip outline color="grey" size="sm">ID: 12345</QChip> ID: {{ $props.id }}
</QChip>
</div> </div>
<QCheckbox v-model="checkSelect" />
</div> </div>
</slot> </slot>
<div class="card-list-body"> <div class="card-list-body">
@ -36,12 +50,6 @@ const $props = defineProps({
margin-right: 25px; margin-right: 25px;
} }
.q_chip {
display: flex;
flex-direction: column;
justify-content: center;
}
.card-list-body { .card-list-body {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, onUnmounted } from 'vue'; import { onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -12,10 +12,11 @@ import InvoiceOutFilter from './InvoiceOutFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardList2 from 'src/components/ui/CardList2.vue'; import CardList2 from 'src/components/ui/CardList2.vue';
const stateStore = useStateStore();
const router = useRouter();
const quasar = useQuasar();
const { t } = useI18n(); const { t } = useI18n();
const manageCheckboxes = ref(false);
const quasar = useQuasar();
const router = useRouter();
const stateStore = useStateStore();
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.rightDrawer = false));
@ -38,19 +39,19 @@ function viewSummary(id) {
<template v-if="stateStore.isHeaderMounted()"> <template v-if="stateStore.isHeaderMounted()">
<Teleport to="#searchbar"> <Teleport to="#searchbar">
<VnSearchbar <VnSearchbar
data-key="InvoiceOutList"
:label="t('Search invoice')"
:info="t('You can search by invoice reference')" :info="t('You can search by invoice reference')"
:label="t('Search invoice')"
data-key="InvoiceOutList"
/> />
</Teleport> </Teleport>
<Teleport to="#actions-append"> <Teleport to="#actions-append">
<div class="row q-gutter-x-sm"> <div class="row q-gutter-x-sm">
<QBtn <QBtn
flat
@click="stateStore.toggleRightDrawer()" @click="stateStore.toggleRightDrawer()"
round
dense dense
flat
icon="menu" icon="menu"
round
> >
<QTooltip bottom anchor="bottom right"> <QTooltip bottom anchor="bottom right">
{{ t('globals.collapseMenu') }} {{ t('globals.collapseMenu') }}
@ -67,17 +68,23 @@ function viewSummary(id) {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="card-list">
<VnPaginate <VnPaginate
data-key="InvoiceOutList"
url="InvoiceOuts/filter"
order="issued DESC, id DESC"
auto-load auto-load
data-key="InvoiceOutList"
order="issued DESC, id DESC"
url="InvoiceOuts/filter"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<div class="flex justify-around q-mb-md">
<QCheckbox label="Marcar todo" v-model="manageCheckboxes" />
<QBtn label="Descargar" color="primary" type="submit" />
</div>
<CardList2 <CardList2
v-for="row of rows" :id="row.id"
:isSelected="manageCheckboxes"
:key="row.id" :key="row.id"
:title="row.ref" :title="row.ref"
@click="navigate(row.id)" @click="navigate(row.id)"
v-for="row of rows"
> >
<template #list-items> <template #list-items>
<VnLv label="ID" :value="row.id" /> <VnLv label="ID" :value="row.id" />