|
|
@@ -1,4 +1,3 @@
|
|
|
-<!-- eslint-disable @intlify/vue-i18n/no-raw-text -->
|
|
|
<template>
|
|
|
<q-drawer
|
|
|
v-bind="$attrs"
|
|
|
@@ -9,13 +8,13 @@
|
|
|
:width="250"
|
|
|
:mini-width="64"
|
|
|
:breakpoint="500"
|
|
|
- :mini="miniState"
|
|
|
+ :mini="!$q.screen.lt.md ? miniState : true"
|
|
|
:behavior="'desktop'"
|
|
|
class="detached-container"
|
|
|
>
|
|
|
<div class="column full-height q-pa-sm no-wrap">
|
|
|
<div
|
|
|
- v-if="!$q.screen.lt.sm"
|
|
|
+ v-if="!$q.screen.lt.md"
|
|
|
class="toggle-button-wrapper absolute"
|
|
|
style="top: 50%; right: -32px; z-index: 1"
|
|
|
>
|
|
|
@@ -33,7 +32,7 @@
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
- >{{ miniState ? "Expandir menu" : "Colapsar menu" }}</q-tooltip
|
|
|
+ >{{ miniState ? $t('navigation.expand_menu') : $t('navigation.collapse_menu') }}</q-tooltip
|
|
|
>
|
|
|
</q-btn>
|
|
|
</div>
|
|
|
@@ -53,12 +52,47 @@
|
|
|
<q-item-section>{{ user_store.user.name }}</q-item-section>
|
|
|
</div>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.sm"
|
|
|
+ v-if="miniState && !$q.screen.lt.md"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
>{{ user_store.user.name }}</q-tooltip
|
|
|
>
|
|
|
+ <q-menu anchor="center right" self="top start">
|
|
|
+ <q-list class="column no-wrap overflow-hidden">
|
|
|
+ <q-item
|
|
|
+ v-ripple
|
|
|
+ v-close-popup
|
|
|
+ clickable
|
|
|
+ :to="{ name: 'ProfilePage' }"
|
|
|
+ exact
|
|
|
+ exact-active-class="menu-selected"
|
|
|
+ >
|
|
|
+ <div class="flex">
|
|
|
+ <q-item-section avatar>
|
|
|
+ <q-icon
|
|
|
+ name="account_circle"
|
|
|
+ color="primary"
|
|
|
+ style="font-size: 18px"
|
|
|
+ />
|
|
|
+ </q-item-section>
|
|
|
+ <q-item-section>{{ $t("navigation.perfil") }}</q-item-section>
|
|
|
+ </div>
|
|
|
+ </q-item>
|
|
|
+ <q-item v-ripple clickable @click="logoutFn">
|
|
|
+ <div class="flex">
|
|
|
+ <q-item-section avatar>
|
|
|
+ <q-icon
|
|
|
+ name="logout"
|
|
|
+ color="negative"
|
|
|
+ style="font-size: 18px"
|
|
|
+ />
|
|
|
+ </q-item-section>
|
|
|
+ <q-item-section>{{ $t("navigation.logout") }}</q-item-section>
|
|
|
+ </div>
|
|
|
+ </q-item>
|
|
|
+ </q-list>
|
|
|
+ </q-menu>
|
|
|
</q-item>
|
|
|
</q-list>
|
|
|
|
|
|
@@ -80,7 +114,7 @@
|
|
|
</q-item-section>
|
|
|
<q-item-section>{{ $t(menu.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.sm"
|
|
|
+ v-if="miniState && !$q.screen.lt.md"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -91,7 +125,7 @@
|
|
|
<div v-else>
|
|
|
<template v-if="!miniState">
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.sm"
|
|
|
+ v-if="miniState && !$q.screen.lt.md"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -99,7 +133,7 @@
|
|
|
>
|
|
|
<q-expansion-item
|
|
|
v-model="isExpasionItemExpanded"
|
|
|
- header-class=" menu-item--spaced"
|
|
|
+ header-class="menu-item--spaced"
|
|
|
:class="{
|
|
|
'menu-selected':
|
|
|
childrenAreActive(menu.children) && !isExpasionItemExpanded,
|
|
|
@@ -119,14 +153,14 @@
|
|
|
:to="{ name: child.name }"
|
|
|
exact
|
|
|
exact-active-class="menu-selected"
|
|
|
- class="menu-item--spaced"
|
|
|
+ class="menu-item--spaced q-pl-lg"
|
|
|
>
|
|
|
<q-item-section avatar>
|
|
|
<q-icon :name="child.icon" style="font-size: 18px" />
|
|
|
</q-item-section>
|
|
|
<q-item-section>{{ $t(child.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.sm"
|
|
|
+ v-if="miniState && !$q.screen.lt.md"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -149,14 +183,14 @@
|
|
|
</q-item-section>
|
|
|
<q-item-section>{{ $t(menu.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.sm"
|
|
|
+ v-if="miniState && !$q.screen.lt.md"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
>{{ $t(menu.title) }}</q-tooltip
|
|
|
>
|
|
|
- <q-menu anchor="top right" self="top left">
|
|
|
- <q-list style="min-width: 100px">
|
|
|
+ <q-menu anchor="center right" self="top start">
|
|
|
+ <q-list>
|
|
|
<q-item
|
|
|
v-for="child in menu.childrens"
|
|
|
:key="child.name"
|
|
|
@@ -166,7 +200,6 @@
|
|
|
:to="{ name: child.name }"
|
|
|
exact
|
|
|
exact-active-class="menu-selected"
|
|
|
- class="menu-item--spaced"
|
|
|
>
|
|
|
<q-item-section avatar>
|
|
|
<q-icon :name="child.icon" style="font-size: 18px" />
|
|
|
@@ -180,40 +213,49 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</q-list>
|
|
|
- <q-list class="column no-wrap overflow-hidden q-mt-auto">
|
|
|
- <q-item v-ripple clickable @click="logoutFn">
|
|
|
- <div class="flex">
|
|
|
- <q-item-section avatar>
|
|
|
- <q-icon name="logout" color="negative" style="font-size: 18px" />
|
|
|
- </q-item-section>
|
|
|
- <q-item-section>Sair</q-item-section>
|
|
|
+ <q-list class="q-mt-auto">
|
|
|
+ <q-item v-ripple clickable @click="openUrl('https://softpar.inf.br')">
|
|
|
+ <div class="flex full-width justify-center">
|
|
|
+ <q-img
|
|
|
+ :src="
|
|
|
+ miniState
|
|
|
+ ? LogoSoftparMini
|
|
|
+ : $q.dark.isActive
|
|
|
+ ? LogoSoftparLight
|
|
|
+ : LogoSoftparDark
|
|
|
+ "
|
|
|
+ style="width: 100%; height: 30px; max-width: 114px"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.sm"
|
|
|
- anchor="center right"
|
|
|
- self="center left"
|
|
|
- :offset="[10, 10]"
|
|
|
- >Sair</q-tooltip
|
|
|
- >
|
|
|
</q-item>
|
|
|
</q-list>
|
|
|
+ <div class="full-width text-center text-subtitle3">
|
|
|
+
|
|
|
+ <span class="text-caption text-weight-light">{{ version }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</q-drawer>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, onMounted } from "vue";
|
|
|
+import { ref, onMounted, watch } from "vue";
|
|
|
import { useAuth } from "src/composables/useAuth";
|
|
|
import { permissionStore } from "src/stores/permission";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import { userStore } from "src/stores/user";
|
|
|
+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";
|
|
|
+import { Cookies } from "quasar";
|
|
|
|
|
|
const { logout } = useAuth();
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
const user_store = userStore();
|
|
|
|
|
|
+const version = "0.0.1";
|
|
|
+
|
|
|
const leftDrawerOpen = ref(true);
|
|
|
-const miniState = ref(true);
|
|
|
+const miniState = ref(Cookies.get("miniState") === "true" ?? false);
|
|
|
|
|
|
const childrenAreActive = (children) => {
|
|
|
if (!children) return false;
|
|
|
@@ -285,6 +327,14 @@ const logoutFn = async () => {
|
|
|
router.push({ name: "LoginPage" });
|
|
|
};
|
|
|
|
|
|
+const openUrl = (url) => {
|
|
|
+ window.open(url, "_blank");
|
|
|
+};
|
|
|
+
|
|
|
+watch(miniState, () => {
|
|
|
+ Cookies.set("miniState", miniState.value);
|
|
|
+});
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getMenuAccess();
|
|
|
});
|