#6943 removes duplicate toggle menu & fix loading animation #491
|
@ -13,7 +13,7 @@ const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const stateStore = computed(() => useStateStore());
|
const stateStore = computed(() => useStateStore());
|
||||||
const rows = ref([]);
|
const rows = ref([]);
|
||||||
const totalAmount = ref(0);
|
const totalAmount = ref();
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -75,7 +75,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: (value) => value.user.name,
|
field: (value) => value?.user?.name,
|
||||||
label: t('Created by'),
|
label: t('Created by'),
|
||||||
name: 'createdBy',
|
name: 'createdBy',
|
||||||
},
|
},
|
||||||
|
@ -87,7 +87,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: (value) => value.greugeType.name,
|
field: (value) => value?.greugeType?.name,
|
||||||
label: t('Type'),
|
label: t('Type'),
|
||||||
name: 'type',
|
name: 'type',
|
||||||
},
|
},
|
||||||
|
@ -108,26 +108,9 @@ const setRows = (data) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData :filter="filter" @on-fetch="setRows" auto-load url="greuges" />
|
<FetchData :filter="filter" @on-fetch="setRows" auto-load url="greuges" />
|
||||||
<template v-if="stateStore.isHeaderMounted()">
|
|
||||||
<Teleport to="#actions-append">
|
|
||||||
<div class="row q-gutter-x-sm">
|
|
||||||
<QBtn
|
|
||||||
flat
|
|
||||||
@click="stateStore.toggleRightDrawer()"
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
icon="menu"
|
|
||||||
>
|
|
||||||
<QTooltip bottom anchor="bottom right">
|
|
||||||
{{ t('globals.collapseMenu') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</div>
|
|
||||||
</Teleport>
|
|
||||||
</template>
|
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="300" show-if-above>
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="300" show-if-above>
|
||||||
<QCard class="full-width q-pa-sm">
|
<QCard class="full-width q-pa-sm">
|
||||||
<h6 class="flex justify-end q-my-lg q-pr-lg" v-if="totalAmount">
|
<h6 class="flex justify-end q-my-lg q-pr-lg" v-if="totalAmount !== undefined">
|
||||||
jorgep marked this conversation as resolved
Outdated
|
|||||||
<span class="color-vn-label q-mr-md">{{ t('Total') }}:</span>
|
<span class="color-vn-label q-mr-md">{{ t('Total') }}:</span>
|
||||||
{{ toCurrency(totalAmount) }}
|
{{ toCurrency(totalAmount) }}
|
||||||
</h6>
|
</h6>
|
||||||
|
|
Loading…
Reference in New Issue
Si es undefined, quiere decir que no aún se está haciendo la llamada para obetener los datos. Un vez se ha hecho totalAmount ya es como mínimo igual a 0. Así nos evitamos crear una variable tipo "isLoading".
Otra alternativa sería: v-if="totalAmount !== undefined"
el total amount podria ser < 0
Pues lo cambio a la alternativa