Blame view
src/components/pageHeader/AppToolbar.vue
4.67 KB
93a68cfa1
|
1 |
<template> |
68d742034
|
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
|
5 |
</v-toolbar-title> |
a17c68a03
|
6 |
<!-- ****** SEARCH ALL EXISTING STUDENTS ****** --> |
68d742034
|
7 8 |
<v-flex xs12 class="white"> <!-- <v-text-field |
a17c68a03
|
9 10 11 |
flat append-icon="search" label="Seacrh" |
cf94564ea
|
12 |
class="pl-3" |
a17c68a03
|
13 14 15 16 |
color="white" @input.native="emitSearch" type="text" dark |
68d742034
|
17 |
></v-text-field>--> |
fe15ee8b4
|
18 19 20 |
<v-toolbar-title class="header-route-name pl-2" >{{ $route.name }}</v-toolbar-title> |
a17c68a03
|
21 22 |
</v-flex> <v-spacer></v-spacer> |
5e2012ed2
|
23 |
<v-btn type="button" @click="goToSchool" v-if="adminRole && SchoolRole">Towards School!</v-btn> |
11d037abe
|
24 |
<!-- <v-toolbar-items class="hidden-sm-and-down"> |
68d742034
|
25 |
<v-icon class="header-icon">notifications_none</v-icon> |
11d037abe
|
26 |
</v-toolbar-items>--> |
a17c68a03
|
27 28 |
<v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> <v-btn icon large flat slot="activator"> |
68d742034
|
29 |
<v-avatar size="26"> |
aa310d61a
|
30 |
<img src="/static/icon/setting1.png" alt="icon" /> |
a17c68a03
|
31 |
</v-avatar> |
93a68cfa1
|
32 |
</v-btn> |
a17c68a03
|
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
|
46 |
<v-icon class="iconSize">{{ item.icon }}</v-icon> |
a17c68a03
|
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
|
54 55 56 |
</v-toolbar> </template> <script> |
66a5c3b75
|
57 |
import http from "@/Services/http.js"; |
93a68cfa1
|
58 |
export default { |
03dcbf0c1
|
59 |
name: "app-toolbar", |
93a68cfa1
|
60 |
data: () => ({ |
a17c68a03
|
61 |
userName: "", |
03dcbf0c1
|
62 |
search: "", |
66a5c3b75
|
63 |
userData: {}, |
93a68cfa1
|
64 65 |
items: [ { |
db0c39244
|
66 |
icon: "account_circle", |
79583580d
|
67 |
href: "/resetPassword", |
03dcbf0c1
|
68 69 |
title: "Change Password", click: e => { |
93a68cfa1
|
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
|
82 |
icon: "lock", |
03dcbf0c1
|
83 84 85 86 |
href: "#", title: "Logout", click: e => { window.getApp.$emit("APP_LOGOUT"); |
93a68cfa1
|
87 88 |
} } |
68d600c97
|
89 |
], |
fb54501f0
|
90 |
adminRole: "", |
5e2012ed2
|
91 |
SchoolRole: "" |
93a68cfa1
|
92 93 |
}), computed: { |
03dcbf0c1
|
94 |
toolbarColor() { |
93a68cfa1
|
95 96 97 |
return this.$vuetify.options.extra.mainNav; } }, |
66a5c3b75
|
98 |
mounted() { |
8deade193
|
99 |
// this.getUserData(); |
68d600c97
|
100 |
this.adminRole = this.$store.state.role; |
11d037abe
|
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
|
113 |
// console.log("this.adminRole", this.adminRole); |
5e2012ed2
|
114 |
this.SchoolRole = this.$store.state.schoolRole; |
66a5c3b75
|
115 |
}, |
93a68cfa1
|
116 |
methods: { |
68d742034
|
117 118 119 |
// emitSearch(ev) { // this.$root.$emit("app:search", ev.target.value); // }, |
03dcbf0c1
|
120 121 |
handleDrawerToggle() { window.getApp.$emit("APP_DRAWER_TOGGLED"); |
93a68cfa1
|
122 |
}, |
03dcbf0c1
|
123 |
handleFullScreen() { |
93a68cfa1
|
124 |
Util.toggleFullScreen(); |
66a5c3b75
|
125 126 127 |
}, getUserData() { http() |
25205ccca
|
128 |
.get("/getParticularUserDetail", { |
de2bd4eb9
|
129 130 131 |
// headers: { // Authorization: "Bearer " + this.$store.state.token // } |
25205ccca
|
132 |
}) |
66a5c3b75
|
133 134 135 136 |
.then(response => { this.userData = response.data.data; }) .catch(error => { |
7d0816758
|
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
|
142 |
}); |
68d600c97
|
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
|
154 |
} |
a17c68a03
|
155 |
} |
93a68cfa1
|
156 157 |
}; </script> |
03dcbf0c1
|
158 |
<style> |
a17c68a03
|
159 160 |
.v-icon { font-size: 30px; |
03dcbf0c1
|
161 |
} |
687e0b929
|
162 |
.fixcolors { |
79583580d
|
163 |
background: #444b54 !important; |
687e0b929
|
164 |
} |
68d742034
|
165 |
|
a17c68a03
|
166 167 168 169 170 |
@media screen and (min-width: 1270px) { .hide { display: none; } /* } |
a0fe54618
|
171 172 |
@media screen and (max-width: 962px) { .imglogo{ |
659b42db7
|
173 174 175 176 177 |
position: absolute; top: 13px; left: 13px !important; width: 70px; height: 24px; |
f42c1d9c9
|
178 |
} */ |
a0fe54618
|
179 |
} |
a17c68a03
|
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
|
188 189 |
} </style> |