targo-frontend/src/layouts/main-layout.vue
Nic D e37ec79827 fix(many): refactor timesheet approval download menu, details window fixes, store refactor
- Timesheet Approval's download menu has had its UI overhauled and the script has been streamlined to better match backend structure and logic

- Details window in timesheet approval has a few bug and oversight fixes.

- Refactored UI store to work with camelCase instead of snake_case
2026-03-18 09:18:06 -04:00

50 lines
1.5 KiB
Vue

<script
lang="ts"
setup
>
import HeaderBar from 'src/layouts/components/main-layout-header-bar.vue';
import FooterBar from 'src/layouts/components/main-layout-footer-bar.vue';
import LeftDrawer from 'src/layouts/components/main-layout-left-drawer.vue';
import ChatbotDrawer from 'src/modules/chatbot/components/chatbot-drawer.vue';
import { onMounted, watch, ref } from 'vue';
import { RouterView } from 'vue-router';
import { useUiStore } from 'src/stores/ui-store';
import { useAuthStore } from 'src/stores/auth-store';
const ui_store = useUiStore();
const auth_store = useAuthStore();
const userPreferences = ref(ui_store.userPreferences);
onMounted(async () => {
if (ui_store.userPreferences.id === -1) {
await ui_store.getUserPreferences();
}
});
watch(userPreferences, async () => {
if (ui_store.userPreferences.id !== -1) {
await ui_store.updateUserPreferences();
return
}
await ui_store.getUserPreferences();
}, { deep: true });
</script>
<template>
<q-layout view="hHh lpR fFf">
<HeaderBar />
<LeftDrawer />
<ChatbotDrawer v-if="auth_store.user?.user_module_access.includes('chatbot')"/>
<q-page-container>
<router-view />
</q-page-container>
<FooterBar v-if="!$q.platform.is.mobile" />
</q-layout>
</template>