|
@@ -1,211 +1,17 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <DefaultHeaderPage>
|
|
|
|
|
- <template #after>
|
|
|
|
|
- <q-btn
|
|
|
|
|
- outline
|
|
|
|
|
- icon="mdi-calendar"
|
|
|
|
|
- color="primary"
|
|
|
|
|
- @click="showFilter"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </DefaultHeaderPage>
|
|
|
|
|
- <q-expansion-item
|
|
|
|
|
- v-model="filter"
|
|
|
|
|
- dense
|
|
|
|
|
- hide-expand-icon
|
|
|
|
|
- class="remove-header-expansion-item"
|
|
|
|
|
- >
|
|
|
|
|
- <DatePeriodSelector
|
|
|
|
|
- v-model:selected-period="defaultPeriod"
|
|
|
|
|
- v-model:selected-event-id="defaultEventId"
|
|
|
|
|
- class="q-pa-sm"
|
|
|
|
|
- />
|
|
|
|
|
- </q-expansion-item>
|
|
|
|
|
-
|
|
|
|
|
- <div v-if="!isLoading" class="column gap q-pa-sm">
|
|
|
|
|
- <div class="flex full-width gap">
|
|
|
|
|
- <div class="flex flex-grow gap">
|
|
|
|
|
- <CardIconMiniChart
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- :title="t('dashboard.cards.total_earnings')"
|
|
|
|
|
- :icon="'mdi-currency-usd'"
|
|
|
|
|
- :number-porcent="paymentsChart.percentage_change"
|
|
|
|
|
- :number-card="
|
|
|
|
|
- t('dashboard.currency_format', {
|
|
|
|
|
- value: paymentsChart.current_total,
|
|
|
|
|
- })
|
|
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <MiniLineChart
|
|
|
|
|
- :data="paymentsChart.trend_data"
|
|
|
|
|
- fill-color="rgba(0, 0, 0, 0)"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconMiniChart>
|
|
|
|
|
- <CardIconMiniChart
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- :title="t('orders.plural')"
|
|
|
|
|
- :icon="'mdi-package-variant'"
|
|
|
|
|
- :number-porcent="ordersChart.percentage_change"
|
|
|
|
|
- :number-card="ordersChart.current_total"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <MiniBarChart
|
|
|
|
|
- :data="ordersChart.trend_data"
|
|
|
|
|
- fill-color="rgba(0, 0, 0, 0)"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconMiniChart>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="flex flex-grow gap">
|
|
|
|
|
- <CardIconMiniChart
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- :title="t('dashboard.cards.tickets_sold')"
|
|
|
|
|
- :icon="'mdi-ticket-outline'"
|
|
|
|
|
- :number-porcent="ticketsSoldChart.percentage_change"
|
|
|
|
|
- :number-card="ticketsSoldChart.current_total"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <MiniLineChart
|
|
|
|
|
- :data="ticketsSoldChart.trend_data"
|
|
|
|
|
- fill-color="rgba(0, 0, 0, 0)"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconMiniChart>
|
|
|
|
|
- <CardIconMiniChart
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- :title="t('dashboard.cards.registrations')"
|
|
|
|
|
- :icon="'mdi-account-group-outline'"
|
|
|
|
|
- :number-porcent="participantsChart.percentage_change"
|
|
|
|
|
- :number-card="participantsChart.current_total"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <MiniBarChart
|
|
|
|
|
- :data="participantsChart.trend_data"
|
|
|
|
|
- fill-color="rgba(0, 0, 0, 0)"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconMiniChart>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="flex full-width gap">
|
|
|
|
|
- <div class="flex flex-grow">
|
|
|
|
|
- <CardIconChart
|
|
|
|
|
- :title="t('dashboard.charts.tickets_by_type.title')"
|
|
|
|
|
- :icon="'mdi-ticket-account'"
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <BarChart
|
|
|
|
|
- :data="eventTicketsByTypeChart"
|
|
|
|
|
- :data-set-label="t('events.tickets.plural')"
|
|
|
|
|
- :label-x="t('events.tickets.types_singular')"
|
|
|
|
|
- :label-y="t('common.terms.quantity')"
|
|
|
|
|
- :show-legend="true"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconChart>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="flex flex-grow">
|
|
|
|
|
- <CardIconChart
|
|
|
|
|
- :title="t('dashboard.charts.participants_by_document.title')"
|
|
|
|
|
- :icon="'mdi-badge-account'"
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <DoughnutChart
|
|
|
|
|
- :data="eventParticipantsByCNPJAndCPF"
|
|
|
|
|
- :data-set-label="t('events.attendance.participant_plural')"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconChart>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="flex full-width gap">
|
|
|
|
|
- <div class="flex flex-grow">
|
|
|
|
|
- <CardIconChart
|
|
|
|
|
- :title="t('dashboard.charts.sales_over_time.title')"
|
|
|
|
|
- :icon="'mdi-chart-line'"
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <LineChart
|
|
|
|
|
- :data="salesOverTimeLineChart"
|
|
|
|
|
- :data-set-label="t('ui.navigation.sales')"
|
|
|
|
|
- :label-x="t('common.terms.month')"
|
|
|
|
|
- :label-y="
|
|
|
|
|
- t('dashboard.charts.sales_over_time.y_label', {
|
|
|
|
|
- currency: 'R$',
|
|
|
|
|
- })
|
|
|
|
|
- "
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconChart>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="flex flex-grow">
|
|
|
|
|
- <CardIconChart
|
|
|
|
|
- :title="t('dashboard.charts.registration_source.title')"
|
|
|
|
|
- :icon="'mdi-chart-pie'"
|
|
|
|
|
- class="flex-grow"
|
|
|
|
|
- >
|
|
|
|
|
- <template #chart>
|
|
|
|
|
- <PieChart
|
|
|
|
|
- :data="eventSourcePieChart"
|
|
|
|
|
- :data-set-label="
|
|
|
|
|
- t('dashboard.charts.registration_source.source')
|
|
|
|
|
- "
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </CardIconChart>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div v-else class="flex flex-center full-width q-pa-xl">
|
|
|
|
|
- <q-spinner color="primary" size="50px" />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <DefaultHeaderPage />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { onMounted, ref, watch, defineAsyncComponent } from "vue";
|
|
|
|
|
|
|
+import { onMounted, ref, watch } from "vue";
|
|
|
import { useI18n } from "vue-i18n";
|
|
import { useI18n } from "vue-i18n";
|
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
|
-import DatePeriodSelector from "./components/DatePeriodSelector.vue";
|
|
|
|
|
-
|
|
|
|
|
-const MiniLineChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/mini/MiniLineChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const MiniBarChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/mini/MiniBarChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const CardIconMiniChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/CardIconMiniChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const CardIconChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/CardIconChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const BarChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/normal/BarChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const DoughnutChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/normal/DoughnutChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const LineChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/normal/LineChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
-const PieChart = defineAsyncComponent(
|
|
|
|
|
- () => import("src/components/charts/normal/PieChart.vue"),
|
|
|
|
|
-);
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
const isLoading = ref(true);
|
|
const isLoading = ref(true);
|
|
|
-const filter = ref(false);
|
|
|
|
|
const defaultPeriod = ref("month");
|
|
const defaultPeriod = ref("month");
|
|
|
const defaultEventId = ref(1);
|
|
const defaultEventId = ref(1);
|
|
|
|
|
|
|
@@ -218,10 +24,6 @@ const eventParticipantsByCNPJAndCPF = ref({});
|
|
|
const salesOverTimeLineChart = ref({});
|
|
const salesOverTimeLineChart = ref({});
|
|
|
const eventSourcePieChart = ref({});
|
|
const eventSourcePieChart = ref({});
|
|
|
|
|
|
|
|
-const showFilter = () => {
|
|
|
|
|
- filter.value = !filter.value;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const generateMockData = () => {
|
|
const generateMockData = () => {
|
|
|
const createMiniChartData = (currentTotal, percentage) => ({
|
|
const createMiniChartData = (currentTotal, percentage) => ({
|
|
|
current_total: currentTotal,
|
|
current_total: currentTotal,
|