Explorar o código

side menu update

ali %!s(int64=3) %!d(string=hai) anos
pai
achega
1a9a23306e

+ 8 - 31
src/components/Template/Header/MainHeader.vue

@@ -91,7 +91,7 @@
       <div class="left-side">
         <q-btn v-if="user && user.id !== null"
                color="primary"
-               :to="{name: 'UserPanel.Profile.UserInfo'}">
+               @click="goToProperPanel">
           <svg id="_000000ff"
                data-name="#000000ff"
                xmlns="http://www.w3.org/2000/svg"
@@ -150,36 +150,6 @@ export default {
     return {
       user: new User(),
       topMenuItems: [
-        // {
-        //   title: 'معرفی پروژه',
-        //   scrollTo: '#introSection',
-        //   routeName: 'aaaaaaaaaaaa'
-        // },
-        // {
-        //   title: 'مجامع',
-        //   scrollTo: '#majameSection',
-        //   routeName: 'aaaaaaaaaaaa'
-        // },
-        // {
-        //   title: 'مشاورین حقوقی',
-        //   scrollTo: '#moshaverinSection',
-        //   routeName: 'aaaaaaaaaaaa'
-        // },
-        // {
-        //   title: 'تصاویر',
-        //   scrollTo: '#gallerySection',
-        //   routeName: 'aaaaaaaaaaaa'
-        // },
-        // {
-        //   title: 'اخبار و رویدادها',
-        //   scrollTo: '#newsSection',
-        //   routeName: 'aaaaaaaaaaaa'
-        // },
-        // {
-        //   title: 'ارتباط با ما',
-        //   scrollTo: '#feedback',
-        //   routeName: 'aaaaaaaaaaaa'
-        // }
       ]
     }
   },
@@ -208,6 +178,13 @@ export default {
     loadAuthData () {
       this.user = this.$store.getters['Auth/user']
     },
+    goToProperPanel () {
+      if (this.user.isSuperUser()) {
+        this.$router.push({ name: 'Admin.User.Index' })
+      } else {
+        this.$router.push({ name: 'UserPanel.Profile.UserInfo' })
+      }
+    },
     goToHome () {
       this.$router.push({ name: 'Public.Home' })
     },

+ 4 - 7
src/layouts/AdminLayout.vue

@@ -5,7 +5,6 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
 import Router from 'src/router/Router.vue'
 
 export default {
@@ -15,12 +14,10 @@ export default {
       keepAliveComponents: []
     }
   },
-  computed: {
-    ...mapGetters('AppLayout', [
-      'breadcrumbsVisibility',
-      'breadcrumbs',
-      'breadcrumbLoading'
-    ])
+  mounted () {
+    if (typeof window !== 'undefined') {
+      this.$store.commit('AppLayout/updateLayoutLeftDrawerVisible', window.screen.width > this.$q.screen.sizes.md)
+    }
   },
   methods: {
     hasRoute (route) {

+ 4 - 7
src/layouts/UserPanelLayout.vue

@@ -5,7 +5,6 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
 import Router from 'src/router/Router.vue'
 
 export default {
@@ -15,12 +14,10 @@ export default {
       keepAliveComponents: []
     }
   },
-  computed: {
-    ...mapGetters('AppLayout', [
-      'breadcrumbsVisibility',
-      'breadcrumbs',
-      'breadcrumbLoading'
-    ])
+  mounted () {
+    if (typeof window !== 'undefined') {
+      this.$store.commit('AppLayout/updateLayoutLeftDrawerVisible', window.screen.width > this.$q.screen.sizes.md)
+    }
   },
   methods: {
     hasRoute (route) {