Blame view
src/components/pageHeader/AppToolbar.vue
4.39 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 18 |
></v-text-field>--> <v-toolbar-title class="header-route-name pl-2">{{ $route.name }}</v-toolbar-title> |
a17c68a03
|
19 20 |
</v-flex> <v-spacer></v-spacer> |
5e2012ed2
|
21 |
<v-btn type="button" @click="goToSchool" v-if="adminRole && SchoolRole">Towards School!</v-btn> |
68d742034
|
22 23 24 |
<v-toolbar-items class="hidden-sm-and-down"> <v-icon class="header-icon">notifications_none</v-icon> </v-toolbar-items> |
a17c68a03
|
25 26 |
<v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> <v-btn icon large flat slot="activator"> |
68d742034
|
27 |
<v-avatar size="26"> |
aa310d61a
|
28 |
<img src="/static/icon/setting1.png" alt="icon" /> |
a17c68a03
|
29 |
</v-avatar> |
93a68cfa1
|
30 |
</v-btn> |
a17c68a03
|
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
|
44 |
<v-icon class="iconSize">{{ item.icon }}</v-icon> |
a17c68a03
|
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
|
52 53 54 |
</v-toolbar> </template> <script> |
66a5c3b75
|
55 |
import http from "@/Services/http.js"; |
93a68cfa1
|
56 |
export default { |
03dcbf0c1
|
57 |
name: "app-toolbar", |
93a68cfa1
|
58 |
data: () => ({ |
a17c68a03
|
59 |
userName: "", |
03dcbf0c1
|
60 |
search: "", |
66a5c3b75
|
61 |
userData: {}, |
93a68cfa1
|
62 63 |
items: [ { |
db0c39244
|
64 |
icon: "account_circle", |
79583580d
|
65 |
href: "/resetPassword", |
03dcbf0c1
|
66 67 |
title: "Change Password", click: e => { |
93a68cfa1
|
68 69 70 71 72 73 74 75 76 77 78 79 |
console.log(e); } }, // { // icon: 'settings', // href: '#', // title: 'Settings', // click: (e) => { // console.log(e); // } // }, { |
db0c39244
|
80 |
icon: "lock", |
03dcbf0c1
|
81 82 83 84 |
href: "#", title: "Logout", click: e => { window.getApp.$emit("APP_LOGOUT"); |
93a68cfa1
|
85 86 |
} } |
68d600c97
|
87 |
], |
fb54501f0
|
88 |
adminRole: "", |
5e2012ed2
|
89 |
SchoolRole: "" |
93a68cfa1
|
90 91 |
}), computed: { |
03dcbf0c1
|
92 |
toolbarColor() { |
93a68cfa1
|
93 94 95 |
return this.$vuetify.options.extra.mainNav; } }, |
66a5c3b75
|
96 |
mounted() { |
8deade193
|
97 |
// this.getUserData(); |
68d600c97
|
98 |
this.adminRole = this.$store.state.role; |
fb54501f0
|
99 |
// console.log("this.adminRole", this.adminRole); |
5e2012ed2
|
100 |
this.SchoolRole = this.$store.state.schoolRole; |
66a5c3b75
|
101 |
}, |
93a68cfa1
|
102 |
methods: { |
68d742034
|
103 104 105 |
// emitSearch(ev) { // this.$root.$emit("app:search", ev.target.value); // }, |
03dcbf0c1
|
106 107 |
handleDrawerToggle() { window.getApp.$emit("APP_DRAWER_TOGGLED"); |
93a68cfa1
|
108 |
}, |
03dcbf0c1
|
109 |
handleFullScreen() { |
93a68cfa1
|
110 |
Util.toggleFullScreen(); |
66a5c3b75
|
111 112 113 |
}, getUserData() { http() |
25205ccca
|
114 |
.get("/getParticularUserDetail", { |
de2bd4eb9
|
115 116 117 |
// headers: { // Authorization: "Bearer " + this.$store.state.token // } |
25205ccca
|
118 |
}) |
66a5c3b75
|
119 120 121 122 |
.then(response => { this.userData = response.data.data; }) .catch(error => { |
7d0816758
|
123 124 125 126 127 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
66a5c3b75
|
128 |
}); |
68d600c97
|
129 130 131 132 133 134 135 136 137 138 139 |
}, 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
|
140 |
} |
a17c68a03
|
141 |
} |
93a68cfa1
|
142 143 |
}; </script> |
03dcbf0c1
|
144 |
<style> |
a17c68a03
|
145 146 |
.v-icon { font-size: 30px; |
03dcbf0c1
|
147 |
} |
687e0b929
|
148 |
.fixcolors { |
79583580d
|
149 |
background: #444b54 !important; |
687e0b929
|
150 |
} |
68d742034
|
151 |
|
a17c68a03
|
152 153 154 155 156 |
@media screen and (min-width: 1270px) { .hide { display: none; } /* } |
a0fe54618
|
157 158 |
@media screen and (max-width: 962px) { .imglogo{ |
659b42db7
|
159 160 161 162 163 |
position: absolute; top: 13px; left: 13px !important; width: 70px; height: 24px; |
f42c1d9c9
|
164 |
} */ |
a0fe54618
|
165 |
} |
a17c68a03
|
166 167 168 169 170 171 172 173 |
@media screen and (max-width: 420px) { .v-list__tile { font-size: 14px; padding: 0 10px; } .name { font-size: 15px; } |
03dcbf0c1
|
174 175 |
} </style> |