WIP: #8120: Compact summaryPopup #1200
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useDialogPluginComponent } from 'quasar';
|
import { useDialogPluginComponent } from 'quasar';
|
||||||
import { computed } from 'vue';
|
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
jon marked this conversation as resolved
Outdated
|
|||||||
id: {
|
id: {
|
||||||
|
@ -11,30 +10,19 @@ const $props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
moduleClass: {
|
||||||
alexm
commented
igual li havera dit size i les clases foren 'xl', 'sm', etx igual li havera dit size i les clases foren 'xl', 'sm', etx
|
|||||||
|
type: String,
|
||||||
|
default: 'defaultSummary',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineEmits([...useDialogPluginComponent.emits]);
|
defineEmits([...useDialogPluginComponent.emits]);
|
||||||
|
|
||||||
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
const { dialogRef, onDialogHide } = useDialogPluginComponent();
|
||||||
|
|
||||||
const moduleClass = computed(() => {
|
|
||||||
const name = $props.summary.__name;
|
|
||||||
|
|
||||||
const classMap = {
|
|
||||||
CustomerSummary: 'largeSummary',
|
|
||||||
EntrySummary: 'largeSummary',
|
|
||||||
InvoiceOutSummary: 'largeSummary',
|
|
||||||
RouteSummary: 'largeSummary',
|
|
||||||
TicketrSummary: 'largeSummary',
|
|
||||||
InvoiceInSummary: 'xlargeSummary',
|
|
||||||
};
|
|
||||||
|
|
||||||
return classMap[name] || 'defaultSummary';
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
jon marked this conversation as resolved
Outdated
alexm
commented
Poner en cada sección la clase para que se la pase a aqui Poner en cada sección la clase para que se la pase a aqui
|
|||||||
<QDialog ref="dialogRef" @hide="onDialogHide">
|
<QDialog ref="dialogRef" @hide="onDialogHide">
|
||||||
<component :is="$props.summary" :id="$props.id" :class="moduleClass" />
|
<component :is="$props.summary" :id="$props.id" :class="$props.moduleClass" />
|
||||||
</QDialog>
|
</QDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ const $props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
moduleClass: {
|
||||||
|
type: String,
|
||||||
|
default: 'defaultSummary',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
@ -128,9 +132,10 @@ const toModule = computed(() =>
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn></slot
|
</QBtn></slot
|
||||||
>
|
>
|
||||||
|
|
||||||
<QBtn
|
<QBtn
|
||||||
@click.stop="viewSummary(entity.id, $props.summary)"
|
@click.stop="
|
||||||
|
viewSummary(entity.id, $props.summary, $props.moduleClass)
|
||||||
|
"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
|
|
|
@ -4,10 +4,10 @@ import { useQuasar } from 'quasar';
|
||||||
export function useSummaryDialog() {
|
export function useSummaryDialog() {
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
|
||||||
function viewSummary(id, summary) {
|
function viewSummary(id, summary, moduleClass) {
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnSummaryDialog,
|
component: VnSummaryDialog,
|
||||||
componentProps: { id, summary },
|
componentProps: { id, summary, moduleClass },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ const debtWarning = computed(() => {
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
data-key="customer"
|
data-key="customer"
|
||||||
|
:module-class="'largeSummary'"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<CustomerDescriptorMenu :customer="entity" />
|
<CustomerDescriptorMenu :customer="entity" />
|
||||||
|
|
Loading…
Reference in New Issue
LLevar