|
|
@@ -8,47 +8,11 @@
|
|
|
:width="235"
|
|
|
:mini-width="64"
|
|
|
:breakpoint="500"
|
|
|
- :mini="miniState"
|
|
|
+ :mini="navigation_store.miniState"
|
|
|
:behavior="'desktop'"
|
|
|
class="left-menu-drawer"
|
|
|
>
|
|
|
<div class="column full-height no-wrap left-menu-inner">
|
|
|
-
|
|
|
- <!-- ── Logo ──────────────────────────────────────────────── -->
|
|
|
- <div class="left-menu-logo-wrapper" :class="{ 'left-menu-logo-wrapper--mini': miniState }">
|
|
|
- <q-img
|
|
|
- v-if="!miniState"
|
|
|
- :src="Logo"
|
|
|
- fit="contain"
|
|
|
- class="left-menu-logo"
|
|
|
- />
|
|
|
- <q-img
|
|
|
- v-else
|
|
|
- :src="LogoSmall"
|
|
|
- fit="contain"
|
|
|
- class="left-menu-logo--mini"
|
|
|
- />
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- ── Toggle expand/collapse ────────────────────────────── -->
|
|
|
- <div
|
|
|
- v-if="!$q.screen.lt.md"
|
|
|
- class="toggle-button-wrapper absolute"
|
|
|
- style="top: 2px; right: -32px; z-index: 1"
|
|
|
- >
|
|
|
- <div @click="miniState = !miniState">
|
|
|
- <q-icon
|
|
|
- size="sm"
|
|
|
- :name="miniState ? 'mdi-page-layout-sidebar-right' : 'mdi-page-layout-sidebar-left'"
|
|
|
- color="violet-normal"
|
|
|
- />
|
|
|
- <q-tooltip anchor="center right" self="center left" :offset="[10, 10]">
|
|
|
- {{ miniState ? $t('ui.navigation.expand_menu') : $t('ui.navigation.collapse_menu') }}
|
|
|
- </q-tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- ── Menu items (background image section) ─────────────── -->
|
|
|
<div class="left-menu-items-wrapper column full-height no-wrap">
|
|
|
<div class="left-menu-bg-overlay" />
|
|
|
<div class="left-menu-bg-tint" />
|
|
|
@@ -57,7 +21,6 @@
|
|
|
<template v-for="(item, index) in navigation_store.navigationItems" :key="index">
|
|
|
<template v-if="item.permission">
|
|
|
|
|
|
- <!-- Single item -->
|
|
|
<q-item
|
|
|
v-if="item.type === 'single'"
|
|
|
v-ripple
|
|
|
@@ -71,18 +34,17 @@
|
|
|
<q-item-section avatar>
|
|
|
<q-icon :name="item.icon" class="left-menu-icon" />
|
|
|
</q-item-section>
|
|
|
- <q-item-section v-if="!miniState">{{ $t(item.title) }}</q-item-section>
|
|
|
+ <q-item-section v-if="!navigation_store.miniState">{{ $t(item.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState"
|
|
|
+ v-if="navigation_store.miniState"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
>{{ $t(item.title) }}</q-tooltip>
|
|
|
</q-item>
|
|
|
|
|
|
- <!-- Expansive item -->
|
|
|
<div v-else>
|
|
|
- <template v-if="!miniState">
|
|
|
+ <template v-if="!navigation_store.miniState">
|
|
|
<q-expansion-item
|
|
|
v-model="isExpasionItemExpanded[index]"
|
|
|
:class="{ 'menu-selected': childrenAreActive(item.childrens) && !isExpasionItemExpanded[index] }"
|
|
|
@@ -152,14 +114,13 @@
|
|
|
</template>
|
|
|
</q-list>
|
|
|
|
|
|
- <!-- ── Footer ──────────────────────────────────────────── -->
|
|
|
<q-list class="q-mt-auto left-menu-footer">
|
|
|
<q-item v-ripple class="left-menu-item left-menu-logout text-center" clickable @click="logoutFn">
|
|
|
<q-item-section avatar >
|
|
|
<q-icon name="logout" class="left-menu-icon left-menu-logout__icon"/>
|
|
|
</q-item-section>
|
|
|
- <q-item-section v-if="!miniState" class="text-violet-normal">{{ $t('auth.logout') }}</q-item-section>
|
|
|
- <q-tooltip v-if="miniState" anchor="center right" self="center left" :offset="[10, 10]">
|
|
|
+ <q-item-section v-if="!navigation_store.miniState" class="text-violet-normal">{{ $t('auth.logout') }}</q-item-section>
|
|
|
+ <q-tooltip v-if="navigation_store.miniState" anchor="center right" self="center left" :offset="[10, 10]">
|
|
|
{{ $t('auth.logout') }}
|
|
|
</q-tooltip>
|
|
|
</q-item>
|
|
|
@@ -167,9 +128,9 @@
|
|
|
<q-item v-ripple class="left-menu-item" clickable @click="openUrl('https://softpar.inf.br')">
|
|
|
<div class="flex full-width justify-center">
|
|
|
<q-img
|
|
|
- :src="miniState || $q.screen.lt.md ? LogoSoftparMini : $q.dark.isActive ? LogoSoftparLight : LogoSoftparDark"
|
|
|
+ :src="navigation_store.miniState || $q.screen.lt.md ? LogoSoftparMini : $q.dark.isActive ? LogoSoftparLight : LogoSoftparDark"
|
|
|
style="height: 30px"
|
|
|
- :style="miniState || $q.screen.lt.md ? 'max-width: 48px; width: 48px' : 'max-width: 100px; width: 100%'"
|
|
|
+ :style="navigation_store.miniState || $q.screen.lt.md ? 'max-width: 48px; width: 48px' : 'max-width: 100px; width: 100%'"
|
|
|
/>
|
|
|
</div>
|
|
|
</q-item>
|
|
|
@@ -179,7 +140,7 @@
|
|
|
class="full-width text-center q-pb-xs cursor-pointer left-menu-version"
|
|
|
@click="gotoVersionPage()"
|
|
|
>
|
|
|
- <span v-if="!(miniState || $q.screen.lt.md)" class="text-caption text-weight-light">
|
|
|
+ <span v-if="!(navigation_store.miniState || $q.screen.lt.md)" class="text-caption text-weight-light">
|
|
|
{{ $t('common.terms.version') + ' ' + version }}
|
|
|
</span>
|
|
|
<span v-else class="text-caption text-weight-light">{{ version }}</span>
|
|
|
@@ -190,15 +151,13 @@
|
|
|
</q-drawer>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, watch, watchEffect, onMounted } from "vue";
|
|
|
+import { ref, watchEffect, onMounted } from "vue";
|
|
|
import { useAuth } from "src/composables/useAuth";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import { navigationStore } from "src/stores/navigation";
|
|
|
-import { useQuasar, Cookies } from "quasar";
|
|
|
+import { useQuasar } from "quasar";
|
|
|
import { version } from "src/../package.json";
|
|
|
|
|
|
-import Logo from "src/assets/logo_serprati_associado.svg";
|
|
|
-import LogoSmall from "src/assets/logo_serprati_associado_small.svg";
|
|
|
import LogoSoftparLight from "src/assets/softpar_logo_light.svg";
|
|
|
import LogoSoftparDark from "src/assets/softpar_logo_dark.svg";
|
|
|
import LogoSoftparMini from "src/assets/softpar_logo_mini.svg";
|
|
|
@@ -209,13 +168,6 @@ const route = useRoute();
|
|
|
const navigation_store = navigationStore();
|
|
|
const $q = useQuasar();
|
|
|
|
|
|
-// const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
|
-// ? "dark"
|
|
|
-// : "light";
|
|
|
-// const systemTheme = "light";
|
|
|
-const miniStateCookies = Cookies.get("miniState");
|
|
|
-const miniState = ref(miniStateCookies === "true" ? true : false);
|
|
|
-
|
|
|
const childrenAreActive = (children) => {
|
|
|
if (!Array.isArray(children) || children.length === 0) {
|
|
|
return false;
|
|
|
@@ -227,8 +179,8 @@ const isExpasionItemExpanded = ref([]);
|
|
|
|
|
|
watchEffect(() => {
|
|
|
if ($q.screen.lt.md) {
|
|
|
- miniState.value = true;
|
|
|
- isExpasionItemExpanded.value.forEach((expansion, index) => {
|
|
|
+ navigation_store.miniState = true;
|
|
|
+ isExpasionItemExpanded.value.forEach((_, index) => {
|
|
|
isExpasionItemExpanded.value[index] = false;
|
|
|
});
|
|
|
}
|
|
|
@@ -247,10 +199,6 @@ const gotoVersionPage = () => {
|
|
|
router.push({ name: "SystemVersionsPage" });
|
|
|
};
|
|
|
|
|
|
-watch(miniState, () => {
|
|
|
- Cookies.set("miniState", miniState.value, { path: "/", sameSite: "Lax" });
|
|
|
-});
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
navigation_store.navigationItems.forEach((item, index) => {
|
|
|
if (childrenAreActive(item.childrens)) {
|
|
|
@@ -264,7 +212,6 @@ onMounted(() => {
|
|
|
@use "sass:map";
|
|
|
@use "src/css/quasar.variables.scss" as vars;
|
|
|
|
|
|
-// ── Drawer container ───────────────────────────────────────────────────────
|
|
|
:deep(.q-drawer) {
|
|
|
background: transparent !important;
|
|
|
box-shadow: none !important;
|
|
|
@@ -280,36 +227,11 @@ onMounted(() => {
|
|
|
background: transparent;
|
|
|
}
|
|
|
|
|
|
-// ── Logo wrapper ───────────────────────────────────────────────────────────
|
|
|
-.left-menu-logo-wrapper {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- background-color: vars.$violet-normal;
|
|
|
- border-radius: 8px 8px 0 0;
|
|
|
- min-height: 64px;
|
|
|
- flex-shrink: 0;
|
|
|
-}
|
|
|
-
|
|
|
-.left-menu-logo-wrapper--mini {
|
|
|
- padding: 10px 8px;
|
|
|
-}
|
|
|
-
|
|
|
-.left-menu-logo {
|
|
|
- width: 120px;
|
|
|
- height: 60px;
|
|
|
-}
|
|
|
-
|
|
|
-.left-menu-logo--mini {
|
|
|
- width: 36px;
|
|
|
- height: 36px;
|
|
|
-}
|
|
|
-
|
|
|
.left-menu-items-wrapper {
|
|
|
position: relative;
|
|
|
flex: 1;
|
|
|
overflow: hidden;
|
|
|
- border-radius: 0 0 8px 8px;
|
|
|
+ border-radius: 8px;
|
|
|
|
|
|
&::before {
|
|
|
content: "";
|
|
|
@@ -380,11 +302,4 @@ onMounted(() => {
|
|
|
padding-bottom: 6px;
|
|
|
}
|
|
|
|
|
|
-.toggle-button-wrapper {
|
|
|
- transition: transform 0.3s ease;
|
|
|
-}
|
|
|
-
|
|
|
-.toggle-button-wrapper:hover {
|
|
|
- transform: scale(1.1);
|
|
|
-}
|
|
|
</style>
|