Blame view
src/components/pageHeader/AppToolbar.vue
4 KB
93a68cfa1
|
1 |
<template> |
687e0b929
|
2 |
<v-toolbar class="fixcolors" fixed app> |
cf94564ea
|
3 4 |
<v-toolbar-title class="ml-0"> <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide white--text"></v-toolbar-side-icon> |
03dcbf0c1
|
5 |
</v-toolbar-title> |
a17c68a03
|
6 7 |
<!-- ****** SEARCH ALL EXISTING STUDENTS ****** --> |
db0c39244
|
8 9 10 11 |
<v-flex xs7 sm3 class="userSearch" |
1c69557ac
|
12 |
v-if="$route.name != 'Dashboard' && $route.name != 'changepassword' && $route.name != 'generalSetting' && $route.name != 'resetPassword' && $route.name != 'bulkImport'" |
db0c39244
|
13 |
> |
a17c68a03
|
14 15 16 17 |
<v-text-field flat append-icon="search" label="Seacrh" |
cf94564ea
|
18 |
class="pl-3" |
a17c68a03
|
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
|
28 |
<v-avatar> |
687e0b929
|
29 |
<!-- <img src="/static/icon/user.png" /> --> |
96f88269a
|
30 31 32 33 34 |
<v-icon dark size="40px" v-if="!userData.schoolLogoUrl && !userData.profilePicUrl" >account_circle</v-icon> |
66a5c3b75
|
35 |
<img :src="userData.schoolLogoUrl" v-else-if="userData.schoolLogoUrl" /> |
99cd79184
|
36 |
<img :src="userData.profilePicUrl" v-else-if="userData.profilePicUrl" /> |
a17c68a03
|
37 |
</v-avatar> |
93a68cfa1
|
38 |
</v-btn> |
a17c68a03
|
39 40 41 42 43 44 45 46 47 48 49 50 51 |
<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
|
52 |
<v-icon class="iconSize">{{ item.icon }}</v-icon> |
a17c68a03
|
53 54 55 56 57 58 59 |
</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
|
60 61 62 |
</v-toolbar> </template> <script> |
66a5c3b75
|
63 |
import http from "@/Services/http.js"; |
93a68cfa1
|
64 |
export default { |
03dcbf0c1
|
65 |
name: "app-toolbar", |
93a68cfa1
|
66 |
data: () => ({ |
a17c68a03
|
67 |
userName: "", |
03dcbf0c1
|
68 |
search: "", |
66a5c3b75
|
69 |
userData: {}, |
93a68cfa1
|
70 71 |
items: [ { |
db0c39244
|
72 |
icon: "account_circle", |
79583580d
|
73 |
href: "/resetPassword", |
03dcbf0c1
|
74 75 |
title: "Change Password", click: e => { |
93a68cfa1
|
76 77 78 79 80 81 82 83 84 85 86 87 |
console.log(e); } }, // { // icon: 'settings', // href: '#', // title: 'Settings', // click: (e) => { // console.log(e); // } // }, { |
db0c39244
|
88 |
icon: "lock", |
03dcbf0c1
|
89 90 91 92 |
href: "#", title: "Logout", click: e => { window.getApp.$emit("APP_LOGOUT"); |
93a68cfa1
|
93 94 |
} } |
03dcbf0c1
|
95 |
] |
93a68cfa1
|
96 97 |
}), computed: { |
03dcbf0c1
|
98 |
toolbarColor() { |
93a68cfa1
|
99 100 101 |
return this.$vuetify.options.extra.mainNav; } }, |
66a5c3b75
|
102 103 104 |
mounted() { this.getUserData(); }, |
93a68cfa1
|
105 |
methods: { |
db0c39244
|
106 107 |
emitSearch(ev) { this.$root.$emit("app:search", ev.target.value); |
96f88269a
|
108 |
// console.log("ev.target.value", ev.target.value); |
a17c68a03
|
109 |
}, |
03dcbf0c1
|
110 111 |
handleDrawerToggle() { window.getApp.$emit("APP_DRAWER_TOGGLED"); |
93a68cfa1
|
112 |
}, |
03dcbf0c1
|
113 |
handleFullScreen() { |
93a68cfa1
|
114 |
Util.toggleFullScreen(); |
66a5c3b75
|
115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
}, 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
|
129 |
} |
a17c68a03
|
130 |
} |
93a68cfa1
|
131 132 |
}; </script> |
03dcbf0c1
|
133 |
<style> |
a17c68a03
|
134 135 |
.v-icon { font-size: 30px; |
03dcbf0c1
|
136 |
} |
687e0b929
|
137 |
.fixcolors { |
79583580d
|
138 |
background: #444b54 !important; |
687e0b929
|
139 |
} |
a17c68a03
|
140 141 142 143 144 |
@media screen and (min-width: 1270px) { .hide { display: none; } /* } |
a0fe54618
|
145 146 |
@media screen and (max-width: 962px) { .imglogo{ |
659b42db7
|
147 148 149 150 151 |
position: absolute; top: 13px; left: 13px !important; width: 70px; height: 24px; |
f42c1d9c9
|
152 |
} */ |
a0fe54618
|
153 |
} |
a17c68a03
|
154 155 156 157 158 159 160 161 |
@media screen and (max-width: 420px) { .v-list__tile { font-size: 14px; padding: 0 10px; } .name { font-size: 15px; } |
03dcbf0c1
|
162 163 |
} </style> |