WIP: #8120: Compact summaryPopup #1200
|
@ -1,6 +1,5 @@
|
|||
<script setup>
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const $props = defineProps({
|
||||
jon marked this conversation as resolved
Outdated
|
||||
id: {
|
||||
|
@ -11,30 +10,19 @@ const $props = defineProps({
|
|||
type: Object,
|
||||
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]);
|
||||
|
||||
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>
|
||||
<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">
|
||||
<component :is="$props.summary" :id="$props.id" :class="moduleClass" />
|
||||
<component :is="$props.summary" :id="$props.id" :class="$props.moduleClass" />
|
||||
</QDialog>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -36,6 +36,10 @@ const $props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
moduleClass: {
|
||||
type: String,
|
||||
default: 'defaultSummary',
|
||||
},
|
||||
});
|
||||
|
||||
const state = useState();
|
||||
|
@ -128,9 +132,10 @@ const toModule = computed(() =>
|
|||
</QTooltip>
|
||||
</QBtn></slot
|
||||
>
|
||||
|
||||
<QBtn
|
||||
@click.stop="viewSummary(entity.id, $props.summary)"
|
||||
@click.stop="
|
||||
viewSummary(entity.id, $props.summary, $props.moduleClass)
|
||||
"
|
||||
round
|
||||
flat
|
||||
dense
|
||||
|
|
|
@ -4,10 +4,10 @@ import { useQuasar } from 'quasar';
|
|||
export function useSummaryDialog() {
|
||||
const quasar = useQuasar();
|
||||
|
||||
function viewSummary(id, summary) {
|
||||
function viewSummary(id, summary, moduleClass) {
|
||||
quasar.dialog({
|
||||
component: VnSummaryDialog,
|
||||
componentProps: { id, summary },
|
||||
componentProps: { id, summary, moduleClass },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ const debtWarning = computed(() => {
|
|||
@on-fetch="setData"
|
||||
:summary="$props.summary"
|
||||
data-key="customer"
|
||||
:module-class="'largeSummary'"
|
||||
>
|
||||
<template #menu="{ entity }">
|
||||
<CustomerDescriptorMenu :customer="entity" />
|
||||
|
|
Loading…
Reference in New Issue
LLevar