Blame view

src/components/pageHeader/AppToolbar.vue 3.95 KB
93a68cfa1   Jatinder Singh   first commit
1
  <template>
687e0b929   Neeraj Sharma   add user,attenden...
2
    <v-toolbar class="fixcolors" fixed app>
cf94564ea   Neeraj Sharma   fixed toolbar sid...
3
4
      <v-toolbar-title class="ml-0">
        <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide white--text"></v-toolbar-side-icon>
03dcbf0c1   Neeraj Sharma   fix all api and r...
5
      </v-toolbar-title>
a17c68a03   Neeraj Sharma   implement two rou...
6
7
  
      <!-- ****** SEARCH ALL EXISTING STUDENTS ****** -->
db0c39244   Neeraj Sharma   implement event a...
8
9
10
11
      <v-flex
        xs7
        sm3
        class="userSearch"
1c69557ac   Neeraj Sharma   implement design ...
12
        v-if="$route.name != 'Dashboard' && $route.name != 'changepassword' && $route.name != 'generalSetting'  && $route.name != 'resetPassword' && $route.name != 'bulkImport'"
db0c39244   Neeraj Sharma   implement event a...
13
      >
a17c68a03   Neeraj Sharma   implement two rou...
14
15
16
17
        <v-text-field
          flat
          append-icon="search"
          label="Seacrh"
cf94564ea   Neeraj Sharma   fixed toolbar sid...
18
          class="pl-3"
a17c68a03   Neeraj Sharma   implement two rou...
19
20
21
22
23
24
25
26
27
          color="white"
          @input.native="emitSearch"
          type="text"
          dark
        ></v-text-field>
      </v-flex>
      <v-spacer></v-spacer>
      <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition">
        <v-btn icon large flat slot="activator">
79583580d   Neeraj Sharma   implement task ma...
28
          <v-avatar>
687e0b929   Neeraj Sharma   add user,attenden...
29
            <!-- <img src="/static/icon/user.png" /> -->
99cd79184   Neeraj Sharma   implement all tas...
30
            <v-icon dark size="40px" v-if="!userData.schoolLogoUrl && !userData.profilePicUrl">account_circle</v-icon>
66a5c3b75   Neeraj Sharma   implement gloabal...
31
            <img :src="userData.schoolLogoUrl" v-else-if="userData.schoolLogoUrl" />
99cd79184   Neeraj Sharma   implement all tas...
32
            <img :src="userData.profilePicUrl" v-else-if="userData.profilePicUrl" />
a17c68a03   Neeraj Sharma   implement two rou...
33
          </v-avatar>
93a68cfa1   Jatinder Singh   first commit
34
        </v-btn>
a17c68a03   Neeraj Sharma   implement two rou...
35
36
37
38
39
40
41
42
43
44
45
46
47
        <v-list class="pa-0">
          <v-list-tile
            v-for="(item,index) in items"
            :to="!item.href ? { name: item.name } : null"
            :href="item.href"
            @click="item.click"
            ripple="ripple"
            :disabled="item.disabled"
            :target="item.target"
            rel="noopener"
            :key="index"
          >
            <v-list-tile-action v-if="item.icon">
1571e40b5   Neeraj Sharma   gallery and socia...
48
              <v-icon class="iconSize">{{ item.icon }}</v-icon>
a17c68a03   Neeraj Sharma   implement two rou...
49
50
51
52
53
54
55
            </v-list-tile-action>
            <v-list-tile-content>
              <v-list-tile-title>{{ item.title }}</v-list-tile-title>
            </v-list-tile-content>
          </v-list-tile>
        </v-list>
      </v-menu>
93a68cfa1   Jatinder Singh   first commit
56
57
58
    </v-toolbar>
  </template>
  <script>
66a5c3b75   Neeraj Sharma   implement gloabal...
59
  import http from "@/Services/http.js";
93a68cfa1   Jatinder Singh   first commit
60
  export default {
03dcbf0c1   Neeraj Sharma   fix all api and r...
61
    name: "app-toolbar",
93a68cfa1   Jatinder Singh   first commit
62
    data: () => ({
a17c68a03   Neeraj Sharma   implement two rou...
63
      userName: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
64
      search: "",
66a5c3b75   Neeraj Sharma   implement gloabal...
65
      userData: {},
93a68cfa1   Jatinder Singh   first commit
66
67
      items: [
        {
db0c39244   Neeraj Sharma   implement event a...
68
          icon: "account_circle",
79583580d   Neeraj Sharma   implement task ma...
69
          href: "/resetPassword",
03dcbf0c1   Neeraj Sharma   fix all api and r...
70
71
          title: "Change Password",
          click: e => {
93a68cfa1   Jatinder Singh   first commit
72
73
74
75
76
77
78
79
80
81
82
83
            console.log(e);
          }
        },
        // {
        //   icon: 'settings',
        //   href: '#',
        //   title: 'Settings',
        //   click: (e) => {
        //     console.log(e);
        //   }
        // },
        {
db0c39244   Neeraj Sharma   implement event a...
84
          icon: "lock",
03dcbf0c1   Neeraj Sharma   fix all api and r...
85
86
87
88
          href: "#",
          title: "Logout",
          click: e => {
            window.getApp.$emit("APP_LOGOUT");
93a68cfa1   Jatinder Singh   first commit
89
90
          }
        }
03dcbf0c1   Neeraj Sharma   fix all api and r...
91
      ]
93a68cfa1   Jatinder Singh   first commit
92
93
    }),
    computed: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
94
      toolbarColor() {
93a68cfa1   Jatinder Singh   first commit
95
96
97
        return this.$vuetify.options.extra.mainNav;
      }
    },
66a5c3b75   Neeraj Sharma   implement gloabal...
98
99
100
    mounted() {
      this.getUserData();
    },
93a68cfa1   Jatinder Singh   first commit
101
    methods: {
db0c39244   Neeraj Sharma   implement event a...
102
103
104
      emitSearch(ev) {
        this.$root.$emit("app:search", ev.target.value);
        console.log("ev.target.value", ev.target.value);
a17c68a03   Neeraj Sharma   implement two rou...
105
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
106
107
      handleDrawerToggle() {
        window.getApp.$emit("APP_DRAWER_TOGGLED");
93a68cfa1   Jatinder Singh   first commit
108
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
109
      handleFullScreen() {
93a68cfa1   Jatinder Singh   first commit
110
        Util.toggleFullScreen();
66a5c3b75   Neeraj Sharma   implement gloabal...
111
112
113
114
115
116
117
118
119
120
121
122
123
124
      },
      getUserData() {
        http()
          .get("/getParticularUserDetail")
          .then(response => {
            this.userData = response.data.data;
          })
          .catch(error => {
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
          });
93a68cfa1   Jatinder Singh   first commit
125
      }
a17c68a03   Neeraj Sharma   implement two rou...
126
    }
93a68cfa1   Jatinder Singh   first commit
127
128
  };
  </script>
03dcbf0c1   Neeraj Sharma   fix all api and r...
129
  <style>
a17c68a03   Neeraj Sharma   implement two rou...
130
131
  .v-icon {
    font-size: 30px;
03dcbf0c1   Neeraj Sharma   fix all api and r...
132
  }
687e0b929   Neeraj Sharma   add user,attenden...
133
  .fixcolors {
79583580d   Neeraj Sharma   implement task ma...
134
    background: #444b54 !important;
687e0b929   Neeraj Sharma   add user,attenden...
135
  }
a17c68a03   Neeraj Sharma   implement two rou...
136
137
138
139
140
  @media screen and (min-width: 1270px) {
    .hide {
      display: none;
    }
    /* }
a0fe54618   Neeraj Sharma   finally fix
141
142
  @media screen and (max-width: 962px) {
  .imglogo{
659b42db7   Neeraj Sharma   changes something...
143
144
145
146
147
      position: absolute;
      top: 13px;
      left: 13px !important;
      width: 70px;
      height: 24px;
f42c1d9c9   Neeraj Sharma   something change ...
148
  } */
a0fe54618   Neeraj Sharma   finally fix
149
  }
a17c68a03   Neeraj Sharma   implement two rou...
150
151
152
153
154
155
156
157
  @media screen and (max-width: 420px) {
    .v-list__tile {
      font-size: 14px;
      padding: 0 10px;
    }
    .name {
      font-size: 15px;
    }
03dcbf0c1   Neeraj Sharma   fix all api and r...
158
159
  }
  </style>