Blame view

src/components/pageHeader/AppDrawer.vue 5.58 KB
93a68cfa1   Jatinder Singh   first commit
1
2
3
4
5
6
7
8
9
10
  <template>
    <v-navigation-drawer
      id="appDrawer"
      :mini-variant.sync="mini"
      fixed
      :dark="$vuetify.dark"
      app
      v-model="drawer"
      width="260"
      >
55f72b7d7   Neeraj Sharma   add new page are ...
11
      <v-toolbar style="background:#39b982"  >
654e1501d   Neeraj Sharma   remove school-man...
12
        <img v-bind:src="computeLogo" height="40" width="150" class="imgLogo" alt="ana">
55f72b7d7   Neeraj Sharma   add new page are ...
13
       <v-toolbar-title class="ml-0 pl-3" >
93a68cfa1   Jatinder Singh   first commit
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
        </v-toolbar-title>        
      </v-toolbar>
      <vue-perfect-scrollbar class="drawer-menu--scroll" :settings="scrollSettings">
        <v-list dense expand>
          <template v-for="(item, i) in menus">
              <!--group with subitems-->
              <v-list-group v-if="item.items" :key="item.name" :group="item.group" :prepend-icon="item.icon" no-action="no-action">
                <v-list-tile slot="activator" ripple="ripple">
                  <v-list-tile-content>
                    <v-list-tile-title>{{ item.title }}</v-list-tile-title>
                  </v-list-tile-content>
                </v-list-tile>
                <template v-for="(subItem, i) in item.items">
                  <!--sub group-->
                  <v-list-group v-if="subItem.items" :key="subItem.name" :group="subItem.group" sub-group="sub-group">
                    <v-list-tile slot="activator" ripple="ripple">
                      <v-list-tile-content>
                        <v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
                      </v-list-tile-content>
                    </v-list-tile>
                    <v-list-tile v-for="(grand, i) in subItem.children" :key="i" :to="genChildTarget(item, grand)" :href="grand.href" ripple="ripple">
                      <v-list-tile-content>
                        <v-list-tile-title>{{ grand.title }}</v-list-tile-title>
                      </v-list-tile-content>
                    </v-list-tile>
                  </v-list-group>
                  <!--child item-->
                  <v-list-tile v-else :key="i" :to="genChildTarget(item, subItem)" :href="subItem.href" :disabled="subItem.disabled" :target="subItem.target" ripple="ripple">
                    <v-list-tile-content>
                      <v-list-tile-title><span>{{ subItem.title }}</span></v-list-tile-title>
                    </v-list-tile-content>
                    <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> -->
                    <v-list-tile-action v-if="subItem.action">
                      <v-icon :class="[subItem.actionClass || 'success--text']">{{ subItem.action }}</v-icon>
                    </v-list-tile-action>
                  </v-list-tile>
                </template>
              </v-list-group>
              <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader>
              <v-divider v-else-if="item.divider" :key="i"></v-divider>
              <!--top-level link-->
              <v-list-tile v-else :to="!item.href ? { name: item.name } : null" :href="item.href" ripple="ripple" :disabled="item.disabled" :target="item.target" rel="noopener" :key="item.name">
                <v-list-tile-action v-if="item.icon">
                  <v-icon>{{ item.icon }}</v-icon>
                </v-list-tile-action>
                <v-list-tile-content>
                  <v-list-tile-title>{{ item.title }}</v-list-tile-title>
                </v-list-tile-content>
                <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> -->
                <v-list-tile-action v-if="item.subAction">
                  <v-icon class="success--text">{{ item.subAction }}</v-icon>
                </v-list-tile-action>
                <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> -->
              </v-list-tile>
          </template>
        </v-list>        
      </vue-perfect-scrollbar>        
    </v-navigation-drawer>
  </template>
  <script>
  import menu from '@/api/menu';
  import VuePerfectScrollbar from 'vue-perfect-scrollbar';
  export default {
    name: 'app-drawer',
    components: {
      VuePerfectScrollbar,
    },
    props: {
      expanded: {
        type: Boolean,
        default: true
      },
    },
    data: () => ({
      mini: false,
      drawer: true,
      menus: menu,
      scrollSettings: {
        maxScrollbarLength: 160
      }    
    }),
    computed: {
      computeGroupActive () {
        return true;
      },
55f72b7d7   Neeraj Sharma   add new page are ...
99
      computeLogo () {
654e1501d   Neeraj Sharma   remove school-man...
100
        return '/static/icon.png';
55f72b7d7   Neeraj Sharma   add new page are ...
101
      },
93a68cfa1   Jatinder Singh   first commit
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
  
      sideToolbarColor () {
        return this.$vuetify.options.extra.sideNav;
      }    
    },
    created () {
      window.getApp.$on('APP_DRAWER_TOGGLED', () => {
        this.drawer = (!this.drawer);
      });
    },
    
  
    methods: {
      genChildTarget (item, subItem) {
        if (subItem.href) return;
        if (subItem.component) {
          return {
            name: subItem.component,
          };
        }
        return { name: `${item.group}/${(subItem.name)}` };
      },
    }
  };
  </script>
  
  
  <style lang="stylus">
  // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl';
  
  #appDrawer
    overflow: hidden
    .drawer-menu--scroll
      height: calc(100vh - 48px)
      overflow: auto
03dcbf0c1   Neeraj Sharma   fix all api and r...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
  .v-list--dense .v-list__tile:not(.v-list__tile--avatar) {
      height: 60px;
      font-size:17px;
  }
  .v-list__tile__action {
    min-width:36px;
  }
  .v-list__tile.primary--text {
      color:black !important;
      border-left: 4px solid black;
      border-radius: 4px;
  }
  @media screen and (max-width: 420px) { 
  .v-list--dense .v-list__tile:not(.v-list__tile--avatar) {
      font-size: 14px;
  }
f42c1d9c9   Neeraj Sharma   something change ...
153
  .imgLogo{
5c102c705   Neeraj Sharma   responsive logo i...
154
155
    height: 32px;
    width:  120px;;
f42c1d9c9   Neeraj Sharma   something change ...
156
  }
03dcbf0c1   Neeraj Sharma   fix all api and r...
157
  }
93a68cfa1   Jatinder Singh   first commit
158
  </style>
d75967ec2   Neeraj Sharma   implemented chang...
159
160
161
162
163
164
  
  
  <style scoped>
  .theme--light .v-icon, .application .theme--light.v-icon {
      color: #39b982;
  }
55f72b7d7   Neeraj Sharma   add new page are ...
165

d75967ec2   Neeraj Sharma   implemented chang...
166
  </style>