Blame view

src/components/pageHeader/AppToolbar.vue 4.77 KB
93a68cfa1   Jatinder Singh   first commit
1
  <template>
6f7cf8cf5   Amber Dev   added discussion ...
2
    <v-toolbar flat class="white" fixed app>
68d742034   Neeraj Sharma   implement new des...
3
4
      <v-toolbar-title>
        <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide darkBlue-color"></v-toolbar-side-icon>
03dcbf0c1   Neeraj Sharma   fix all api and r...
5
      </v-toolbar-title>
a17c68a03   Neeraj Sharma   implement two rou...
6
      <!-- ****** SEARCH ALL EXISTING STUDENTS ****** -->
68d742034   Neeraj Sharma   implement new des...
7
8
      <v-flex xs12 class="white">
        <!-- <v-text-field
a17c68a03   Neeraj Sharma   implement two rou...
9
10
11
          flat
          append-icon="search"
          label="Seacrh"
cf94564ea   Neeraj Sharma   fixed toolbar sid...
12
          class="pl-3"
a17c68a03   Neeraj Sharma   implement two rou...
13
14
15
16
          color="white"
          @input.native="emitSearch"
          type="text"
          dark
68d742034   Neeraj Sharma   implement new des...
17
        ></v-text-field>-->
6f7cf8cf5   Amber Dev   added discussion ...
18
        <v-toolbar-title class="header-route-name pl-2">{{ $route.name }}</v-toolbar-title>
a17c68a03   Neeraj Sharma   implement two rou...
19
20
      </v-flex>
      <v-spacer></v-spacer>
5e2012ed2   Shikha Mishra   minor chnage in code
21
      <v-btn type="button" @click="goToSchool" v-if="adminRole && SchoolRole">Towards School!</v-btn>
11d037abe   Neeraj Sharma   commit code
22
      <!-- <v-toolbar-items class="hidden-sm-and-down">
68d742034   Neeraj Sharma   implement new des...
23
        <v-icon class="header-icon">notifications_none</v-icon>
11d037abe   Neeraj Sharma   commit code
24
      </v-toolbar-items>-->
a17c68a03   Neeraj Sharma   implement two rou...
25
26
      <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition">
        <v-btn icon large flat slot="activator">
68d742034   Neeraj Sharma   implement new des...
27
          <v-avatar size="26">
aa310d61a   Shikha Mishra   added functionali...
28
            <img src="/static/icon/setting1.png" alt="icon" />
a17c68a03   Neeraj Sharma   implement two rou...
29
          </v-avatar>
93a68cfa1   Jatinder Singh   first commit
30
        </v-btn>
a17c68a03   Neeraj Sharma   implement two rou...
31
32
33
34
35
36
37
38
39
40
41
42
43
        <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...
44
              <v-icon class="iconSize">{{ item.icon }}</v-icon>
a17c68a03   Neeraj Sharma   implement two rou...
45
46
47
48
49
50
51
            </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
52
53
54
    </v-toolbar>
  </template>
  <script>
66a5c3b75   Neeraj Sharma   implement gloabal...
55
  import http from "@/Services/http.js";
93a68cfa1   Jatinder Singh   first commit
56
  export default {
03dcbf0c1   Neeraj Sharma   fix all api and r...
57
    name: "app-toolbar",
93a68cfa1   Jatinder Singh   first commit
58
    data: () => ({
a17c68a03   Neeraj Sharma   implement two rou...
59
      userName: "",
03dcbf0c1   Neeraj Sharma   fix all api and r...
60
      search: "",
66a5c3b75   Neeraj Sharma   implement gloabal...
61
      userData: {},
93a68cfa1   Jatinder Singh   first commit
62
63
      items: [
        {
db0c39244   Neeraj Sharma   implement event a...
64
          icon: "account_circle",
79583580d   Neeraj Sharma   implement task ma...
65
          href: "/resetPassword",
03dcbf0c1   Neeraj Sharma   fix all api and r...
66
          title: "Change Password",
860da881d   Shikha Mishra   comment all consoles
67
68
69
          click: (e) => {
            //   console.log(e);
          },
93a68cfa1   Jatinder Singh   first commit
70
71
72
73
74
75
76
77
78
79
        },
        // {
        //   icon: 'settings',
        //   href: '#',
        //   title: 'Settings',
        //   click: (e) => {
        //     console.log(e);
        //   }
        // },
        {
db0c39244   Neeraj Sharma   implement event a...
80
          icon: "lock",
03dcbf0c1   Neeraj Sharma   fix all api and r...
81
82
          href: "#",
          title: "Logout",
860da881d   Shikha Mishra   comment all consoles
83
          click: (e) => {
03dcbf0c1   Neeraj Sharma   fix all api and r...
84
            window.getApp.$emit("APP_LOGOUT");
860da881d   Shikha Mishra   comment all consoles
85
86
          },
        },
68d600c97   Shikha Mishra   improve dashboard...
87
      ],
fb54501f0   Shikha Mishra   minor change in r...
88
      adminRole: "",
860da881d   Shikha Mishra   comment all consoles
89
      SchoolRole: "",
93a68cfa1   Jatinder Singh   first commit
90
91
    }),
    computed: {
03dcbf0c1   Neeraj Sharma   fix all api and r...
92
      toolbarColor() {
93a68cfa1   Jatinder Singh   first commit
93
        return this.$vuetify.options.extra.mainNav;
860da881d   Shikha Mishra   comment all consoles
94
      },
93a68cfa1   Jatinder Singh   first commit
95
    },
66a5c3b75   Neeraj Sharma   implement gloabal...
96
    mounted() {
8deade193   Shikha Mishra   token issue solved
97
      // this.getUserData();
68d600c97   Shikha Mishra   improve dashboard...
98
      this.adminRole = this.$store.state.role;
e91641fe5   Amber Dev   solved bugs
99
100
101
102
103
104
105
106
107
108
109
110
111
      /* push something in the settings option */
      // if (this.adminRole == "PARENT") {
      //   var obj = {};
      //   obj = {
      //     icon: "face",
      //     href: "/changeStudents",
      //     title: "Change Student",
      //     click: e => {
      //       console.log(e);
      //     }
      //   };
      //   this.items.splice(0, 0, obj);
      // }
fb54501f0   Shikha Mishra   minor change in r...
112
      // console.log("this.adminRole", this.adminRole);
5e2012ed2   Shikha Mishra   minor chnage in code
113
      this.SchoolRole = this.$store.state.schoolRole;
66a5c3b75   Neeraj Sharma   implement gloabal...
114
    },
93a68cfa1   Jatinder Singh   first commit
115
    methods: {
68d742034   Neeraj Sharma   implement new des...
116
117
118
      // emitSearch(ev) {
      //   this.$root.$emit("app:search", ev.target.value);
      // },
03dcbf0c1   Neeraj Sharma   fix all api and r...
119
120
      handleDrawerToggle() {
        window.getApp.$emit("APP_DRAWER_TOGGLED");
93a68cfa1   Jatinder Singh   first commit
121
      },
03dcbf0c1   Neeraj Sharma   fix all api and r...
122
      handleFullScreen() {
93a68cfa1   Jatinder Singh   first commit
123
        Util.toggleFullScreen();
66a5c3b75   Neeraj Sharma   implement gloabal...
124
125
126
      },
      getUserData() {
        http()
25205ccca   Shikha Mishra   show school logo ...
127
          .get("/getParticularUserDetail", {
de2bd4eb9   Shikha Mishra   issue solved rela...
128
129
130
            //  headers: {
            //   Authorization: "Bearer " + this.$store.state.token
            // }
25205ccca   Shikha Mishra   show school logo ...
131
          })
860da881d   Shikha Mishra   comment all consoles
132
          .then((response) => {
66a5c3b75   Neeraj Sharma   implement gloabal...
133
134
            this.userData = response.data.data;
          })
860da881d   Shikha Mishra   comment all consoles
135
          .catch((error) => {
7d0816758   Shikha Mishra   show dashboard wh...
136
137
138
139
140
            // if (error.response.status === 401) {
            //   this.$router.replace({ path: "/" });
            //   this.$store.dispatch("setToken", null);
            //   this.$store.dispatch("Id", null);
            // }
66a5c3b75   Neeraj Sharma   implement gloabal...
141
          });
68d600c97   Shikha Mishra   improve dashboard...
142
143
      },
      goToSchool() {
860da881d   Shikha Mishra   comment all consoles
144
        //   console.log("click");
68d600c97   Shikha Mishra   improve dashboard...
145
146
147
148
149
150
151
152
        if (this.$store.state.role === "ADMIN") {
          this.$store.dispatch("Role", null);
          this.$store.dispatch("setToken", null);
          this.$router.push("/schooldashboard");
          setTimeout(() => {
            location.reload();
          }, 1000);
        }
860da881d   Shikha Mishra   comment all consoles
153
154
      },
    },
93a68cfa1   Jatinder Singh   first commit
155
156
  };
  </script>
03dcbf0c1   Neeraj Sharma   fix all api and r...
157
  <style>
a17c68a03   Neeraj Sharma   implement two rou...
158
159
  .v-icon {
    font-size: 30px;
03dcbf0c1   Neeraj Sharma   fix all api and r...
160
  }
687e0b929   Neeraj Sharma   add user,attenden...
161
  .fixcolors {
79583580d   Neeraj Sharma   implement task ma...
162
    background: #444b54 !important;
687e0b929   Neeraj Sharma   add user,attenden...
163
  }
68d742034   Neeraj Sharma   implement new des...
164

a17c68a03   Neeraj Sharma   implement two rou...
165
166
167
168
169
  @media screen and (min-width: 1270px) {
    .hide {
      display: none;
    }
    /* }
a0fe54618   Neeraj Sharma   finally fix
170
171
  @media screen and (max-width: 962px) {
  .imglogo{
659b42db7   Neeraj Sharma   changes something...
172
173
174
175
176
      position: absolute;
      top: 13px;
      left: 13px !important;
      width: 70px;
      height: 24px;
f42c1d9c9   Neeraj Sharma   something change ...
177
  } */
a0fe54618   Neeraj Sharma   finally fix
178
  }
a17c68a03   Neeraj Sharma   implement two rou...
179
180
181
182
183
184
185
186
  @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...
187
188
  }
  </style>