Blame view
src/pages/Dashboard/dashboard.vue
10.6 KB
a17c68a03
|
1 2 |
<template> <v-app id="pages-dasboard"> |
6c05a9f84
|
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
<v-container fluid grid-list-xl> <!-- <v-card flat class="dashCard"> --> <v-layout row wrap class="pt-3"> <!-- ***** Total Students ***** --> <v-flex xs12 class="pt-2"> <v-layout row wrap> <v-flex xs12 sm12 lg3 md4> <v-card width="90" height="90" class="ml-3 pa-1 white iconCard" dark> <img src="/static/schoolIcons/Students.png" class="iconOfDashboard" width="80" alt="Students" /> </v-card> <v-card class="pa-3" style="margin-top: -44px;"> <div class="body-2 grey--text text-xs-right">Students</div> <br /> <h3 class="headline text-xs-right pb-4">{{ students.length }}</h3> </v-card> </v-flex> <!-- ***** Total Parents ***** --> <v-flex xs12 sm12 lg3 md4> <v-card width="90" height="90" class="ml-3 pa-1 white agentIcon" dark> <img src="/static/schoolIcons/Parents.png" width="80" class="iconOfDashboard" alt="Parents" /> </v-card> <v-card class="pa-3" style="margin-top: -44px;"> <div class="body-2 grey--text text-xs-right">Parents</div> <br /> <h3 class="headline text-xs-right pb-4">{{ parents.length }}</h3> </v-card> </v-flex> <!-- ***** Total Teachers***** --> <v-flex xs12 sm12 lg3 md4> <v-card width="90" height="90" class="ml-3 pa-1 white farmerIcon" dark> <img src="/static/schoolIcons/Teachers.png" width="80" class="iconOfDashboard" alt="Teachers" /> </v-card> <v-card class="pa-3" style="margin-top: -44px;"> <div class="body-2 grey--text text-xs-right">Teachers</div> <br /> <h3 class="headline text-xs-right pb-4">{{ teachers.length }}</h3> </v-card> </v-flex> <!-- ***** Total Class***** --> <v-flex xs12 sm12 lg3 md4> <v-card width="90" height="90" class="ml-3 pa-1 white khasraIcon" dark> |
00e4bc4e1
|
59 60 61 62 63 64 |
<img src="/static/schoolIcons/Class.png" width="80" class="iconOfDashboard" alt="class" /> |
6c05a9f84
|
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
</v-card> <v-card class="pa-3" style="margin-top: -44px;"> <div class="body-2 grey--text text-xs-right">Class</div> <br /> <h3 class="headline text-xs-right pb-4">{{ classes.length}}</h3> </v-card> </v-flex> </v-layout> </v-flex> </v-layout> <v-card class="pt-4 mt-3" flat> <full-calendar ref="calendar" defaultView="month" droppable="false" :events="events" :config="config" ></full-calendar> </v-card> </v-container> |
a17c68a03
|
85 86 87 |
<v-dialog v-model="dialog" max-width="500"> <v-card color="grey lighten-4" flat> <v-toolbar dark color="fixcolors"> |
bf5ab636b
|
88 |
<!-- <v-toolbar-title class="white--text">Title</v-toolbar-title> --> |
a17c68a03
|
89 90 91 92 93 94 95 96 97 |
<v-spacer></v-spacer> <v-btn icon @click="dialog= false"> <v-icon>close</v-icon> </v-btn> </v-toolbar> <v-flex class="py-4"> <v-list-tile> <v-list-tile-action> <v-icon>edit</v-icon> |
8bb178441
|
98 99 |
</v-list-tile-action> <v-list-tile-content> |
a17c68a03
|
100 |
<v-list-tile-title>{{ selected.title }}</v-list-tile-title> |
8bb178441
|
101 102 |
</v-list-tile-content> </v-list-tile> |
a17c68a03
|
103 104 105 106 107 108 |
<v-list-tile> <v-list-tile-action> <v-icon>access_time</v-icon> </v-list-tile-action> <v-list-tile-content> <v-list-tile-title>{{ date(selected.start)}}</v-list-tile-title> |
db0c39244
|
109 |
<!-- <v-list-tile-sub-title>{{ date(selected.end) }}</v-list-tile-sub-title> --> |
a17c68a03
|
110 111 112 113 114 |
</v-list-tile-content> </v-list-tile> </v-flex> </v-card> </v-dialog> |
8bb178441
|
115 116 117 118 119 120 121 122 123 |
<div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> </v-app> </template> <script> import http from "@/Services/http.js"; import Util from "@/util"; |
a17c68a03
|
124 |
import moment from "moment"; |
8bb178441
|
125 126 |
export default { |
a17c68a03
|
127 128 129 130 |
data() { return { showLoader: false, dialog: false, |
b28a5f17d
|
131 132 |
HolidaysList: [], EventsList: [], |
ceb43037a
|
133 |
events: [], |
a17c68a03
|
134 135 136 137 |
config: { eventClick: event => { this.selected = event; this.dialog = true; |
8bb178441
|
138 139 |
} }, |
6c05a9f84
|
140 141 142 143 144 |
selected: {}, students: "", parents: "", teachers: "", classes: "" |
a17c68a03
|
145 146 |
}; }, |
6c05a9f84
|
147 148 149 150 151 152 153 154 |
mounted() { this.token = this.$store.state.token; this.getData(); this.getStudents(); this.getTeachers(); this.getParents(); this.getClasses(); }, |
8bb178441
|
155 |
methods: { |
a17c68a03
|
156 157 |
date: function(date) { return moment(date).format("MMMM DD, YYYY HH:mm:ss"); |
8bb178441
|
158 |
}, |
a17c68a03
|
159 160 161 162 163 164 165 166 167 |
refreshEvents() { this.$refs.calendar.$emit("refetch-events"); }, removeEvent() { this.$refs.calendar.$emit("remove-event", this.selected); this.selected = {}; }, eventSelected(event) { this.selected = event; |
db0c39244
|
168 |
console.log("this.selected", this.selected); |
a17c68a03
|
169 |
}, |
687e0b929
|
170 171 172 |
// eventDropStart: function(event) { // event.editable = false; // }, |
a17c68a03
|
173 174 |
eventCreated(...test) { console.log(test); |
8bb178441
|
175 |
}, |
687e0b929
|
176 |
getData() { |
db0c39244
|
177 178 179 180 181 182 183 |
this.showLoader = true; var token = this.$store.state.token; http() .get("/getHolidaysList", { headers: { Authorization: "Bearer " + token } }) .then(response => { |
b28a5f17d
|
184 185 |
this.HolidaysList = response.data.data; // this.events = response.data.data; |
db0c39244
|
186 187 188 189 190 191 192 193 194 |
this.showLoader = false; }) .catch(err => { // console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); |
00e4bc4e1
|
195 |
this.$store.dispatch("Role", null); |
db0c39244
|
196 197 |
} }); |
b28a5f17d
|
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
http() .get("/getSchoolEventsList", { headers: { Authorization: "Bearer " + token } }) .then(response => { this.EventsList = response.data.data; let allData = []; allData = this.HolidaysList.concat(this.EventsList); this.events = allData; this.showLoader = false; }) .catch(error => { // console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); |
00e4bc4e1
|
216 |
this.$store.dispatch("Role", null); |
b28a5f17d
|
217 218 |
} }); |
6c05a9f84
|
219 220 221 222 223 224 225 226 227 228 |
}, getStudents() { http() .get("/getStudentsList", { headers: { Authorization: "Bearer " + this.token } }) .then(response => { this.students = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
229 |
.catch(error => { |
6c05a9f84
|
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
// console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); }, getParents() { http() .get("/getParentsList", { headers: { Authorization: "Bearer " + this.token } }) .then(response => { this.parents = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
248 |
.catch(error => { |
6c05a9f84
|
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
// console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); }, getTeachers() { http() .get("/getTeachersList", { headers: { Authorization: "Bearer " + this.token } }) .then(response => { this.teachers = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
267 |
.catch(error => { |
6c05a9f84
|
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
// console.log("err====>", err); this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); }, getClasses() { http() .get("/getClassesList", { headers: { Authorization: "Bearer " + this.token } }) .then(response => { this.classes = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
286 |
.catch(error => { |
6c05a9f84
|
287 288 289 290 291 |
this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); |
00e4bc4e1
|
292 |
this.$store.dispatch("Role", null); |
6c05a9f84
|
293 294 |
} }); |
8bb178441
|
295 |
} |
db0c39244
|
296 297 298 299 300 301 302 303 304 305 306 307 |
// eventSources() { // const self = this; // return [ // { // events(start, end, timezone, callback) { // setTimeout(() => { // callback(self.events.filter(() => Math.random() > 0.5)); // }, 1000); // } // } // ]; // } |
8bb178441
|
308 309 310 |
} }; </script> |
687e0b929
|
311 |
|
8bb178441
|
312 |
<style> |
a17c68a03
|
313 314 |
@import "fullcalendar/dist/fullcalendar.css"; .fc button { |
d8fcf9992
|
315 |
background: grey !important; |
a17c68a03
|
316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
border: none; border-radius: 4px; color: white; padding: 6px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 18px; margin: 8px 2px !important; cursor: pointer; -webkit-transition-duration: 0.4s; transition-duration: 0.4s; box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); } |
6c05a9f84
|
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
.iconCard { position: relative !important; border-radius: 4px; z-index: 1; } .agentIcon { position: relative !important; border-radius: 4px; z-index: 1; } .farmerIcon { position: relative !important; border-radius: 4px; z-index: 1; } .khasraIcon { position: relative !important; border-radius: 4px; z-index: 1; } .maleFarmerIcon { position: relative !important; border-radius: 4px; z-index: 1; } |
a17c68a03
|
355 |
</style> |