Compare commits
6 Commits
v1.2.3
...
9a55d4c2f0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a55d4c2f0 | ||
|
|
bf481da21e | ||
|
|
b0d225f7b8 | ||
|
|
5324787f23 | ||
|
|
bb626bf6b5 | ||
|
|
d4663a9afc |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lightcontrol",
|
"name": "lightcontrol",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"description": "A Tecamino App",
|
"description": "A Tecamino App",
|
||||||
"productName": "Attendence Records",
|
"productName": "Attendence Records",
|
||||||
"author": "A. Zuercher",
|
"author": "A. Zuercher",
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export default defineConfig((/* ctx */) => {
|
|||||||
//directives: [],
|
//directives: [],
|
||||||
|
|
||||||
// Quasar plugins
|
// Quasar plugins
|
||||||
plugins: ['Notify', 'Dialog'],
|
plugins: ['Cookies', 'Notify', 'Dialog'],
|
||||||
},
|
},
|
||||||
|
|
||||||
// animations: 'all', // --- includes all animations
|
// animations: 'all', // --- includes all animations
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ FridayShort: Vi
|
|||||||
Saturday: Sábado
|
Saturday: Sábado
|
||||||
SaturdayShort: Sá
|
SaturdayShort: Sá
|
||||||
Sunday: Domingo
|
Sunday: Domingo
|
||||||
Sunday: Do
|
SundayShort: Do
|
||||||
currentPassword: Contraseña actual
|
currentPassword: Contraseña actual
|
||||||
addFirstUser: Añadir primer usuario administrador
|
addFirstUser: Añadir primer usuario administrador
|
||||||
report: Informe
|
report: Informe
|
||||||
|
|||||||
78
src/components/DateDaySelect.vue
Normal file
78
src/components/DateDaySelect.vue
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<template>
|
||||||
|
<div class="q-gutter-sm">
|
||||||
|
<h6 class="text-center text-bold q-ma-md text-primary">{{ props.title }}</h6>
|
||||||
|
<div class="row">
|
||||||
|
<q-checkbox
|
||||||
|
style="min-width: 75px"
|
||||||
|
dense
|
||||||
|
v-for="opt in weekdayOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
v-model="selectedWeekdays"
|
||||||
|
:val="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<q-date v-model="dateRange" range flat />
|
||||||
|
<div>
|
||||||
|
<q-badge color="secondary"> Total dates selected: {{ filteredDates.length }} </q-badge>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, onMounted } from 'vue';
|
||||||
|
import { date } from 'quasar';
|
||||||
|
import { i18n } from 'src/boot/lang';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: String,
|
||||||
|
});
|
||||||
|
|
||||||
|
const startDate = new Date();
|
||||||
|
|
||||||
|
// Initial range (format: YYYY/MM/DD)
|
||||||
|
const dateRange = ref();
|
||||||
|
const selectedWeekdays = ref([0, 3]); // Default to weekdays
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
dateRange.value = date.formatDate(startDate, 'YYYY/MM/DD');
|
||||||
|
});
|
||||||
|
|
||||||
|
const weekdayOptions = [
|
||||||
|
{ label: i18n.global.t('MondayShort'), value: 1 },
|
||||||
|
{ label: i18n.global.t('TuesdayShort'), value: 2 },
|
||||||
|
{ label: i18n.global.t('WednesdayShort'), value: 3 },
|
||||||
|
{ label: i18n.global.t('ThursdayShort'), value: 4 },
|
||||||
|
{ label: i18n.global.t('FridayShort'), value: 5 },
|
||||||
|
{ label: i18n.global.t('SaturdayShort'), value: 6 },
|
||||||
|
{ label: i18n.global.t('SundayShort'), value: 0 },
|
||||||
|
];
|
||||||
|
|
||||||
|
// The Logic: Calculate all specific dates within the range that match weekdays
|
||||||
|
const filteredDates = computed(() => {
|
||||||
|
if (!dateRange.value) {
|
||||||
|
return [];
|
||||||
|
} else if (typeof dateRange.value === 'string') {
|
||||||
|
const current = new Date(dateRange.value);
|
||||||
|
if (current !== undefined && selectedWeekdays.value.includes(current.getDay())) {
|
||||||
|
return [date.formatDate(current, 'YYYY/MM/DD')];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const end = new Date(dateRange.value.to);
|
||||||
|
const result = [];
|
||||||
|
|
||||||
|
let current = new Date(dateRange.value.from);
|
||||||
|
|
||||||
|
while (current <= end) {
|
||||||
|
if (selectedWeekdays.value.includes(current.getDay())) {
|
||||||
|
result.push(date.formatDate(current, 'YYYY/MM/DD'));
|
||||||
|
}
|
||||||
|
current = date.addToDate(current, { days: 1 });
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -69,7 +69,6 @@
|
|||||||
filled
|
filled
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-value="name"
|
|
||||||
option-label="name"
|
option-label="name"
|
||||||
v-model="localMember.group"
|
v-model="localMember.group"
|
||||||
></q-select>
|
></q-select>
|
||||||
@@ -107,7 +106,7 @@
|
|||||||
import DialogFrame from 'src/vueLib/dialog/DialogFrame.vue';
|
import DialogFrame from 'src/vueLib/dialog/DialogFrame.vue';
|
||||||
import { type PropType, ref } from 'vue';
|
import { type PropType, ref } from 'vue';
|
||||||
import { appApi } from 'src/boot/axios';
|
import { appApi } from 'src/boot/axios';
|
||||||
import type { Member } from 'src/vueLib/models/member';
|
import type { Member, Members } from 'src/vueLib/models/member';
|
||||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||||
import { i18n } from 'src/boot/lang';
|
import { i18n } from 'src/boot/lang';
|
||||||
import type { Responsibles } from 'src/vueLib/models/responsible';
|
import type { Responsibles } from 'src/vueLib/models/responsible';
|
||||||
@@ -127,7 +126,7 @@ const props = defineProps({
|
|||||||
type: Object as PropType<Responsibles>,
|
type: Object as PropType<Responsibles>,
|
||||||
},
|
},
|
||||||
group: {
|
group: {
|
||||||
type: Array,
|
type: Object as PropType<Members>,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -164,6 +163,7 @@ async function save() {
|
|||||||
let payload = JSON.stringify([localMember.value]);
|
let payload = JSON.stringify([localMember.value]);
|
||||||
if (newMember.value) {
|
if (newMember.value) {
|
||||||
query = 'members/add';
|
query = 'members/add';
|
||||||
|
console.log(33, localMember.value);
|
||||||
payload = JSON.stringify(localMember.value);
|
payload = JSON.stringify(localMember.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
<q-header elevated>
|
<q-header elevated>
|
||||||
<q-toolbar>
|
<q-toolbar>
|
||||||
<q-img
|
<q-img
|
||||||
|
v-if="localLogo !== undefined && localLogo !== ''"
|
||||||
:src="localLogo"
|
:src="localLogo"
|
||||||
alt="Logo"
|
alt="Logo"
|
||||||
style="width: 40px; height: 40px; background-color: var(--q-primary)"
|
style="width: 40px; height: 40px; background-color: var(--q-primary)"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-btn flat dense round icon="menu" aria-label="Menu" @click="toggleLeftDrawer" />
|
<q-btn flat dense round icon="menu" aria-label="Menu" @click="toggleLeftDrawer" />
|
||||||
|
|
||||||
<q-toolbar-title class="text-primary-text"> {{ $t(appName) }} </q-toolbar-title>
|
<q-toolbar-title class="text-primary-text"> {{ $t(appName) }} </q-toolbar-title>
|
||||||
@@ -66,7 +68,7 @@
|
|||||||
<q-item v-if="!autorized" to="/login" exact clickable v-ripple @click="closeDrawer">
|
<q-item v-if="!autorized" to="/login" exact clickable v-ripple @click="closeDrawer">
|
||||||
<q-item-section>{{ $t('login') }}</q-item-section>
|
<q-item-section>{{ $t('login') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<!-- <q-item
|
<q-item
|
||||||
v-if="autorized || user.isPermittedTo('members', 'read')"
|
v-if="autorized || user.isPermittedTo('members', 'read')"
|
||||||
to="/report"
|
to="/report"
|
||||||
exact
|
exact
|
||||||
@@ -75,7 +77,7 @@
|
|||||||
@click="closeDrawer"
|
@click="closeDrawer"
|
||||||
>
|
>
|
||||||
<q-item-section> {{ $t('report') }}</q-item-section>
|
<q-item-section> {{ $t('report') }}</q-item-section>
|
||||||
</q-item> -->
|
</q-item>
|
||||||
<q-item v-if="autorized" to="/stats" exact clickable v-ripple @click="closeDrawer">
|
<q-item v-if="autorized" to="/stats" exact clickable v-ripple @click="closeDrawer">
|
||||||
<q-item-section> {{ $t('stats') }}</q-item-section>
|
<q-item-section> {{ $t('stats') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|||||||
@@ -24,8 +24,13 @@ export function getLocalSettings(): Settings {
|
|||||||
db = databaseName.value;
|
db = databaseName.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let iconName = localStorage.getItem('icon');
|
||||||
|
if (iconName === undefined || iconName === 'undefined') {
|
||||||
|
iconName = '';
|
||||||
|
}
|
||||||
|
|
||||||
return <Settings>{
|
return <Settings>{
|
||||||
icon: localStorage.getItem('icon'),
|
icon: iconName,
|
||||||
appName: name,
|
appName: name,
|
||||||
databaseName: db,
|
databaseName: db,
|
||||||
primaryColor: localStorage.getItem('primaryColor'),
|
primaryColor: localStorage.getItem('primaryColor'),
|
||||||
|
|||||||
36
src/pages/ReportPage.vue
Normal file
36
src/pages/ReportPage.vue
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<template>
|
||||||
|
<div class="rows">
|
||||||
|
<div class="row justify-end">
|
||||||
|
<div class="column">
|
||||||
|
<DateDaySelect title="hjgjh" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<q-btn @click="openDateSelect">Hallo</q-btn>
|
||||||
|
<DialogFrame :header-title="$t('selectDates')" :width="350" :height="500" ref="dateSelect">
|
||||||
|
<DateDaySelect :title="$t('selectDates')" />
|
||||||
|
<q-btn color="primary" no-caps>{{ $t('apply') }}</q-btn>
|
||||||
|
</DialogFrame>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { appApi } from 'src/boot/axios';
|
||||||
|
import DateDaySelect from 'src/components/DateDaySelect.vue';
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||||
|
import DialogFrame from 'src/vueLib/dialog/DialogFrame.vue';
|
||||||
|
|
||||||
|
const dateSelect = ref();
|
||||||
|
const { NotifyResponse } = useNotify();
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
appApi
|
||||||
|
.get('events')
|
||||||
|
.then((resp) => console.log(1, resp))
|
||||||
|
.catch((err) => NotifyResponse(err, 'error'));
|
||||||
|
});
|
||||||
|
|
||||||
|
function openDateSelect() {
|
||||||
|
dateSelect.value?.open();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user