|
|
@@ -8,7 +8,7 @@
|
|
|
:width="250"
|
|
|
:mini-width="64"
|
|
|
:breakpoint="500"
|
|
|
- :mini="!$q.screen.lt.md ? miniState : true"
|
|
|
+ :mini="miniState"
|
|
|
:behavior="'desktop'"
|
|
|
class="detached-container"
|
|
|
>
|
|
|
@@ -32,7 +32,11 @@
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
- >{{ miniState ? $t('navigation.expand_menu') : $t('navigation.collapse_menu') }}</q-tooltip
|
|
|
+ >{{
|
|
|
+ miniState
|
|
|
+ ? $t("navigation.expand_menu")
|
|
|
+ : $t("navigation.collapse_menu")
|
|
|
+ }}</q-tooltip
|
|
|
>
|
|
|
</q-btn>
|
|
|
</div>
|
|
|
@@ -52,7 +56,7 @@
|
|
|
<q-item-section>{{ user_store.user.name }}</q-item-section>
|
|
|
</div>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.md"
|
|
|
+ v-if="miniState"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -114,7 +118,7 @@
|
|
|
</q-item-section>
|
|
|
<q-item-section>{{ $t(menu.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.md"
|
|
|
+ v-if="miniState"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -125,7 +129,7 @@
|
|
|
<div v-else>
|
|
|
<template v-if="!miniState">
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.md"
|
|
|
+ v-if="miniState"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -160,7 +164,7 @@
|
|
|
</q-item-section>
|
|
|
<q-item-section>{{ $t(child.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.md"
|
|
|
+ v-if="miniState"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -183,7 +187,7 @@
|
|
|
</q-item-section>
|
|
|
<q-item-section>{{ $t(menu.title) }}</q-item-section>
|
|
|
<q-tooltip
|
|
|
- v-if="miniState && !$q.screen.lt.md"
|
|
|
+ v-if="miniState"
|
|
|
anchor="center right"
|
|
|
self="center left"
|
|
|
:offset="[10, 10]"
|
|
|
@@ -230,14 +234,13 @@
|
|
|
</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, watch } from "vue";
|
|
|
+import { ref, onMounted, watch, watchEffect } from "vue";
|
|
|
import { useAuth } from "src/composables/useAuth";
|
|
|
import { permissionStore } from "src/stores/permission";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
@@ -246,7 +249,9 @@ 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";
|
|
|
+import { useQuasar } from "quasar";
|
|
|
|
|
|
+const $q = useQuasar();
|
|
|
const { logout } = useAuth();
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
@@ -274,7 +279,7 @@ const menus = ref([
|
|
|
{
|
|
|
type: "single",
|
|
|
title: "navigation.dashboard",
|
|
|
- name: "HomePage",
|
|
|
+ name: "DashboardPage",
|
|
|
icon: "mdi-home-variant-outline",
|
|
|
disable: false,
|
|
|
permission: false,
|
|
|
@@ -322,6 +327,20 @@ const getMenuAccess = () => {
|
|
|
.filter((menu) => menu !== null);
|
|
|
};
|
|
|
|
|
|
+watchEffect(() => {
|
|
|
+ if ($q.screen.lt.md) {
|
|
|
+ miniState.value = true
|
|
|
+ if (Array.isArray(isExpasionItemExpanded.value)) {
|
|
|
+ isExpasionItemExpanded.value.forEach((expansion, index) => {
|
|
|
+ isExpasionItemExpanded.value[index] = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log("isExpasionItemExpanded", isExpasionItemExpanded.value);
|
|
|
+ isExpasionItemExpanded.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
const logoutFn = async () => {
|
|
|
await logout();
|
|
|
router.push({ name: "LoginPage" });
|