@@ -16,7 +16,7 @@
|
||||
:label="$t('selectDates')"
|
||||
@show="loadSettings"
|
||||
>
|
||||
<DateDaySelect @update:dates="updateReport" />
|
||||
<DateDaySelect @update:dates="updateReport" v-model:weekdays="weekdays" />
|
||||
<div class="column justify-end q-pa-md">
|
||||
<div class="row q-ma-md">
|
||||
<q-input
|
||||
@@ -136,6 +136,7 @@ import ReportStat from 'src/components/ReportStat.vue';
|
||||
import type { Group, Groups } from 'src/vueLib/models/group';
|
||||
import { getLocalPageDefaults, setLocalPageDefaults } from 'src/localstorage/localStorage';
|
||||
import html2pdf from 'html2pdf.js';
|
||||
import type { PageDefault } from 'src/vueLib/models/pagedefaults';
|
||||
|
||||
const filter = ref<string>('');
|
||||
const group = ref<Group[]>([]);
|
||||
@@ -148,6 +149,7 @@ const dropdownRef = ref();
|
||||
const loading = ref(false);
|
||||
const amounts = ref<Amount[]>([]);
|
||||
const reportExportRef = ref<HTMLElement | null>(null);
|
||||
const weekdays = ref<number[]>([0, 3]);
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
@@ -186,10 +188,13 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
function loadSettings() {
|
||||
const settings = getLocalPageDefaults('report');
|
||||
const settings = getLocalPageDefaults('report') as PageDefault;
|
||||
if (!settings) return;
|
||||
if (settings.filteredValues.length > 0) {
|
||||
group.value = JSON.parse(settings?.filteredValues[0] || '') as Groups;
|
||||
if (settings.groups) {
|
||||
group.value = settings.groups;
|
||||
}
|
||||
if (settings.weekdays) {
|
||||
weekdays.value = settings.weekdays;
|
||||
}
|
||||
}
|
||||
function applyDateChoice() {
|
||||
@@ -214,7 +219,7 @@ function applyDateChoice() {
|
||||
}
|
||||
payload.date = allDates.value;
|
||||
|
||||
setLocalPageDefaults('report', filter.value || '', [JSON.stringify(group.value || '')]);
|
||||
setLocalPageDefaults('report', <PageDefault>{ groups: group.value, weekdays: weekdays.value });
|
||||
|
||||
appApi
|
||||
.post('report', payload)
|
||||
@@ -248,7 +253,7 @@ function applyDateChoice() {
|
||||
.filter((day) => data.data[day]) // Only include days that exist in the response
|
||||
.map((day) => ({
|
||||
...data.data[day],
|
||||
name: i18n.global.t(day), // Dynamically translate the name
|
||||
name: day, // Dynamically translate the name
|
||||
}));
|
||||
if (amounts.value.length == 2) {
|
||||
amounts.value.splice(1);
|
||||
|
||||
Reference in New Issue
Block a user