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