Blame view

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

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