Blame view
src/pages/Dashboard/dashboard.vue
16.5 KB
a17c68a03
|
1 |
<template> |
01d009dde
|
2 3 |
<v-app id="pages-dasboard" class="dashbaordBackground"> <!-- ****** VIEW PROFIL NOTICE BOARD ****** --> |
98ed84410
|
4 |
<v-dialog v-model="dialogNotice" max-width="940px" scrollable> |
01d009dde
|
5 6 7 8 9 10 11 12 13 14 15 16 |
<v-card> <v-toolbar color="grey lighten-2" flat> <v-spacer></v-spacer> <v-toolbar-title> <h3>Notice Board</h3> </v-toolbar-title> <v-spacer></v-spacer> <v-icon @click="closeNotice">close</v-icon> </v-toolbar> <v-card-text> <v-layout> <v-flex align-center justify-center layout text-xs-center class="mt-2"> |
088d91b5f
|
17 18 |
<img src="/static/icon/user.png" width="70px" v-if="!notice.eventImageUrl" /> <img :src="notice.eventImageUrl" width="280px" v-else-if="notice.eventImageUrl" /> |
01d009dde
|
19 20 21 22 23 24 25 26 27 28 29 30 |
</v-flex> </v-layout> <v-container grid-list-md> <v-layout wrap> <v-flex> <v-layout> <v-flex xs5 sm6> <h5 class="right my-1"> <b>Title:</b> </h5> </v-flex> <v-flex sm6 xs8> |
088d91b5f
|
31 |
<h5 class="my-1">{{ notice.title }}</h5> |
01d009dde
|
32 33 34 35 36 37 38 39 40 |
</v-flex> </v-layout> <v-layout> <v-flex xs5 sm6> <h5 class="right my-1"> <b>Description:</b> </h5> </v-flex> <v-flex sm6 xs8> |
088d91b5f
|
41 |
<h5 class="my-1">{{ notice.description }}</h5> |
01d009dde
|
42 43 44 45 46 47 48 49 |
</v-flex> </v-layout> </v-flex> </v-layout> </v-container> </v-card-text> </v-card> </v-dialog> |
6c05a9f84
|
50 |
<v-container fluid grid-list-xl> |
6c05a9f84
|
51 52 53 54 |
<v-layout row wrap class="pt-3"> <!-- ***** Total Students ***** --> <v-flex xs12 class="pt-2"> <v-layout row wrap> |
01d009dde
|
55 |
<v-flex xs12 sm12 lg3 md3> |
620fb0a0d
|
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
<router-link :to="{ name:'Students' }"> <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> </router-link> |
6c05a9f84
|
71 72 |
</v-flex> <!-- ***** Total Parents ***** --> |
01d009dde
|
73 |
<v-flex xs12 sm12 lg3 md3> |
620fb0a0d
|
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
<router-link :to="{ name:'parents' }"> <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> </router-link> |
6c05a9f84
|
89 90 |
</v-flex> <!-- ***** Total Teachers***** --> |
01d009dde
|
91 |
<v-flex xs12 sm12 lg3 md3> |
620fb0a0d
|
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
<router-link :to="{ name:'teachers' }"> <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> </router-link> |
6c05a9f84
|
107 108 |
</v-flex> <!-- ***** Total Class***** --> |
01d009dde
|
109 |
<v-flex xs12 sm12 lg3 md3> |
620fb0a0d
|
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
<router-link :to="{ name:'addclass' }"> <v-card width="90" height="90" class="ml-3 pa-1 white khasraIcon" dark> <img src="/static/schoolIcons/Class.png" width="80" class="iconOfDashboard" alt="class" /> </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> </router-link> |
6c05a9f84
|
125 126 127 128 |
</v-flex> </v-layout> </v-flex> </v-layout> |
01d009dde
|
129 130 |
<v-layout wrap> <v-flex xs12 sm12 md4> |
80012c476
|
131 |
<v-card > |
01d009dde
|
132 133 |
<v-flex xs12 class="text-xs-center"> <v-avatar size="60px" class="mx-auto" style="margin: auto;display:block;"> |
088d91b5f
|
134 135 |
<img src="/static/icon/user.png" v-if="!userData.schoolLogoUrl" /> <img :src="userData.schoolLogoUrl" v-else-if="userData.schoolLogoUrl" /> |
01d009dde
|
136 137 138 139 140 141 |
</v-avatar> <h5 class="pt-1"> <i>{{ userData.name }}</i> </h5> <!-- <p class="grey--text">Student</p> --> </v-flex> |
80012c476
|
142 |
<table class="feeTypeTable tableRsponsive" height="192px"> |
01d009dde
|
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
<tr> <td> <v-icon>person</v-icon> </td> <td class="fixedSize">Username</td> <td>{{ userData.name }}</td> </tr> <tr> <td> <v-icon>mail</v-icon> </td> <td class="fixedSize">Email</td> <td>{{ userData.email }}</td> </tr> <tr> <td> <v-icon>call</v-icon> </td> <td class="fixedSize">Phone</td> <td>{{ userData.mobile }}</td> </tr> <tr> <td> <v-icon>home</v-icon> </td> <td class="fixedSize">Address</td> <td>{{ userData.address }}</td> </tr> </table> </v-card> </v-flex> <v-flex xs12 sm12 md8> <v-card> <v-card-title class="subheading">Notice</v-card-title> <v-data-table :items="noticeData" class="elevation-1" hide-actions hide-headers> <template slot="items" slot-scope="props" v-if="props.index < 5"> <td>{{ props.index + 1}}</td> <td>{{ props.item.title}}</td> |
98ed84410
|
181 |
<td class="noticeDecritpion">{{ props.item.description}}</td> |
01d009dde
|
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
<td class="text-xs-center"> <span> <v-tooltip top> <img slot="activator" style="cursor:pointer; width:25px; height:18px; " @click="profile(props.item)" src="/static/icon/eye1.png" /> <span>View</span> </v-tooltip> </span> </td> </template> </v-data-table> </v-card> </v-flex> </v-layout> |
6c05a9f84
|
201 202 203 204 205 206 207 208 209 210 |
<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
|
211 212 213 |
<v-dialog v-model="dialog" max-width="500"> <v-card color="grey lighten-4" flat> <v-toolbar dark color="fixcolors"> |
a17c68a03
|
214 215 216 217 218 219 220 221 222 |
<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
|
223 224 |
</v-list-tile-action> <v-list-tile-content> |
a17c68a03
|
225 |
<v-list-tile-title>{{ selected.title }}</v-list-tile-title> |
8bb178441
|
226 227 |
</v-list-tile-content> </v-list-tile> |
a17c68a03
|
228 229 230 231 232 233 |
<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> |
a17c68a03
|
234 235 236 237 238 |
</v-list-tile-content> </v-list-tile> </v-flex> </v-card> </v-dialog> |
8bb178441
|
239 240 241 242 243 244 245 246 |
<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"; |
a17c68a03
|
247 |
import moment from "moment"; |
8bb178441
|
248 249 |
export default { |
a17c68a03
|
250 251 252 253 |
data() { return { showLoader: false, dialog: false, |
01d009dde
|
254 |
dialogNotice: false, |
b28a5f17d
|
255 256 |
HolidaysList: [], EventsList: [], |
ceb43037a
|
257 |
events: [], |
a17c68a03
|
258 259 260 261 |
config: { eventClick: event => { this.selected = event; this.dialog = true; |
8bb178441
|
262 263 |
} }, |
6c05a9f84
|
264 |
selected: {}, |
088d91b5f
|
265 |
notice: {}, |
01d009dde
|
266 |
userData: {}, |
6c05a9f84
|
267 268 269 |
students: "", parents: "", teachers: "", |
01d009dde
|
270 271 |
classes: "", noticeData: [] |
a17c68a03
|
272 273 |
}; }, |
6c05a9f84
|
274 275 276 277 278 279 280 |
mounted() { this.token = this.$store.state.token; this.getData(); this.getStudents(); this.getTeachers(); this.getParents(); this.getClasses(); |
01d009dde
|
281 282 |
this.getNoticeData(); this.getUserData(); |
6c05a9f84
|
283 |
}, |
8bb178441
|
284 |
methods: { |
01d009dde
|
285 286 287 288 289 |
closeNotice() { this.dialogNotice = false; }, profile(item) { // this.editedIndex = this.desserts.indexOf(item); |
088d91b5f
|
290 |
this.notice = Object.assign({}, item); |
01d009dde
|
291 292 |
this.dialogNotice = true; }, |
a17c68a03
|
293 294 |
date: function(date) { return moment(date).format("MMMM DD, YYYY HH:mm:ss"); |
8bb178441
|
295 |
}, |
a17c68a03
|
296 297 298 299 300 301 302 303 304 |
refreshEvents() { this.$refs.calendar.$emit("refetch-events"); }, removeEvent() { this.$refs.calendar.$emit("remove-event", this.selected); this.selected = {}; }, eventSelected(event) { this.selected = event; |
db0c39244
|
305 |
console.log("this.selected", this.selected); |
a17c68a03
|
306 |
}, |
687e0b929
|
307 308 309 |
// eventDropStart: function(event) { // event.editable = false; // }, |
a17c68a03
|
310 311 |
eventCreated(...test) { console.log(test); |
8bb178441
|
312 |
}, |
687e0b929
|
313 |
getData() { |
db0c39244
|
314 |
this.showLoader = true; |
db0c39244
|
315 |
http() |
01d009dde
|
316 |
.get("/getHolidaysList", {}) |
db0c39244
|
317 |
.then(response => { |
b28a5f17d
|
318 319 |
this.HolidaysList = response.data.data; // this.events = response.data.data; |
db0c39244
|
320 321 322 323 324 325 326 327 328 |
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
|
329 |
this.$store.dispatch("Role", null); |
db0c39244
|
330 331 |
} }); |
b28a5f17d
|
332 |
http() |
01d009dde
|
333 |
.get("/getSchoolEventsList") |
b28a5f17d
|
334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
.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
|
348 |
this.$store.dispatch("Role", null); |
b28a5f17d
|
349 350 |
} }); |
6c05a9f84
|
351 352 353 |
}, getStudents() { http() |
01d009dde
|
354 |
.get("/getStudentsList") |
6c05a9f84
|
355 356 357 358 |
.then(response => { this.students = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
359 |
.catch(error => { |
6c05a9f84
|
360 361 362 363 364 365 366 367 368 369 370 |
// 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() |
01d009dde
|
371 |
.get("/getParentsList") |
6c05a9f84
|
372 373 374 375 |
.then(response => { this.parents = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
376 |
.catch(error => { |
6c05a9f84
|
377 378 379 380 381 382 383 384 385 386 387 |
// 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() |
01d009dde
|
388 |
.get("/getTeachersList") |
6c05a9f84
|
389 390 391 392 |
.then(response => { this.teachers = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
393 |
.catch(error => { |
6c05a9f84
|
394 395 396 397 398 399 400 401 402 403 404 |
// 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() |
01d009dde
|
405 |
.get("/getClassesList") |
6c05a9f84
|
406 407 408 409 |
.then(response => { this.classes = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
410 |
.catch(error => { |
6c05a9f84
|
411 412 413 414 415 |
this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); |
00e4bc4e1
|
416 |
this.$store.dispatch("Role", null); |
6c05a9f84
|
417 418 |
} }); |
01d009dde
|
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
}, getNoticeData() { this.showLoader = true; http() .get("/getEventsList") .then(response => { this.noticeData = response.data.data; this.showLoader = false; }) .catch(error => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); }, getUserData() { this.showLoader = true; http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; this.showLoader = false; }) .catch(error => { this.showLoader = false; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); |
8bb178441
|
453 |
} |
db0c39244
|
454 455 456 457 458 459 460 461 462 463 464 465 |
// eventSources() { // const self = this; // return [ // { // events(start, end, timezone, callback) { // setTimeout(() => { // callback(self.events.filter(() => Math.random() > 0.5)); // }, 1000); // } // } // ]; // } |
8bb178441
|
466 467 468 |
} }; </script> |
687e0b929
|
469 |
|
8bb178441
|
470 |
<style> |
a17c68a03
|
471 |
@import "fullcalendar/dist/fullcalendar.css"; |
620fb0a0d
|
472 473 474 475 |
a { text-decoration: none !important; } |
a17c68a03
|
476 |
.fc button { |
d8fcf9992
|
477 |
background: grey !important; |
a17c68a03
|
478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
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
|
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
.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; } |
01d009dde
|
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
.dashbaordBackground { background: #f1f2f7 !important; } table { border-collapse: collapse; border: 1px solid #e2e7eb; } tr { border: 1px solid #e2e7eb; /* text-align: center; */ } td { padding: 6px; } .fixedSize { padding: 6px 20px !important; } table.feeTypeTable { table-layout: auto !important; width: 100% !important; } @media screen and (max-width: 380px) { .tableRsponsive { display: block; position: relative; overflow: scroll; } } |
a17c68a03
|
546 |
</style> |