Blame view
src/pages/Dashboard/dashboard.vue
20.9 KB
a17c68a03
|
1 |
<template> |
68d742034
|
2 |
<v-app id="pages-dasboard"> |
01d009dde
|
3 |
<!-- ****** VIEW PROFIL NOTICE BOARD ****** --> |
68d742034
|
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 |
</v-flex> </v-layout> </v-flex> </v-layout> </v-container> </v-card-text> </v-card> |
68d742034
|
49 50 51 52 53 54 55 56 57 58 59 60 61 |
</v-dialog>--> <!-- <v-container fluid grid-list-xl> --> <v-layout wrap> <v-flex xs12> <v-layout wrap row> <!-- ***** Total Students ***** --> <v-flex xs12 sm12 md9> <v-container fluid grid-list-xl> <v-flex xs12 sm12 md12> <v-layout wrap class> <v-flex xs12 sm12 md3> <router-link :to="{ name:'Students' }"> <v-card class="card pink-bgcolor"> |
37996f3ca
|
62 |
<v-card-title primary-title class="titleCard white--text py-3">Students</v-card-title> |
7d0816758
|
63 |
<img src="/static/icon/student.png" class="ml-2" width="40" alt="icons" /> |
68d742034
|
64 65 66 67 68 69 70 71 |
<v-card-title class="headline py-1 white--text">{{ students.length }}</v-card-title> </v-card> </router-link> </v-flex> <!-- ***** Total Teachers***** --> <v-flex xs12 sm12 md3> <router-link :to="{ name:'Teachers' }"> <v-card flat class="card elevation-2 firozi-bgcolor"> |
37996f3ca
|
72 |
<v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title> |
7d0816758
|
73 |
<img src="/static/icon/teacher.png" class="ml-2" width="40" alt="icons" /> |
68d742034
|
74 75 76 77 78 79 80 81 82 |
<v-card-title class="headline py-1 white--text">{{ teachers.length }}</v-card-title> </v-card> </router-link> </v-flex> <!-- ***** Total Parents ***** --> <v-flex xs12 sm12 md3> <router-link :to="{ name:'Parents' }"> <v-card flat class="card yellow darken-3"> |
37996f3ca
|
83 |
<v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title> |
7d0816758
|
84 |
<img src="/static/icon/parents.png" class="ml-3" width="40px" alt="icons" /> |
68d742034
|
85 86 87 88 89 90 91 92 |
<v-card-title class="headline py-1 white--text">{{ parents.length }}</v-card-title> </v-card> </router-link> </v-flex> <!-- ***** Total Class***** --> <v-flex xs12 sm12 md3> <router-link :to="{ name:'Class' }"> <v-card flat class="card darkBlue-bgcolor"> |
37996f3ca
|
93 |
<v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title> |
7d0816758
|
94 |
<img src="/static/icon/class.png" width="40" alt="icons" class="ml-2" /> |
68d742034
|
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
<v-card-title class="headline py-1 white--text">{{ classes.length }}</v-card-title> </v-card> </router-link> </v-flex> </v-layout> </v-flex> <v-layout> <v-flex xs12> <v-card class="card mt-2 account-Card"> <h4> <b>Account</b> </h4> <v-layout wrap> <v-flex xs12 sm12 md3> <v-list two-line> <template> <v-list-tile> <v-list-tile-avatar> <v-icon class="account-circle darkBlue-color">panorama_fish_eye</v-icon> </v-list-tile-avatar> <v-list-tile-content> <v-list-tile-title class="mt-2"> <p class="subheading font-color">Fees</p> </v-list-tile-title> <v-list-tile-title>Rs 1000</v-list-tile-title> </v-list-tile-content> </v-list-tile> <v-list-tile> <v-list-tile-avatar> <v-icon class="account-circle yellowDark-color">panorama_fish_eye</v-icon> </v-list-tile-avatar> <v-list-tile-content> <v-list-tile-title class="mt-2"> <p class="subheading font-color">Collection</p> </v-list-tile-title> <v-list-tile-title>Rs 2000</v-list-tile-title> </v-list-tile-content> </v-list-tile> <v-list-tile> <v-list-tile-avatar> <v-icon class="account-circle pink-color">panorama_fish_eye</v-icon> </v-list-tile-avatar> <v-list-tile-content> <v-list-tile-title class="mt-2"> <p class="subheading font-color">Expences</p> </v-list-tile-title> |
65d5475b6
|
141 |
<v-list-tile-title>Rs. {{ expenseData.sum }}</v-list-tile-title> |
68d742034
|
142 143 144 145 146 |
</v-list-tile-content> </v-list-tile> </template> </v-list> </v-flex> |
68d600c97
|
147 148 |
<v-flex xs12 sm12 md9 lg9> <!-- <div id="chart"> --> |
68d742034
|
149 150 151 |
<apexchart type="bar" height="250" |
68d600c97
|
152 |
style="max-width: 800px !important" |
68d742034
|
153 154 155 |
:options="chartOptions" :series="series" ></apexchart> |
68d600c97
|
156 |
<!-- </div> --> |
68d742034
|
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
</v-flex> </v-layout> </v-card> </v-flex> </v-layout> <v-card class="mt-2 card"> <!-- <full-calendar ref="calendar" defaultView="month" droppable="false" :events="events" :config="config" ></full-calendar>--> <h4 class="pa-3"> <b>Notice</b> </h4> |
01d009dde
|
173 |
|
68d742034
|
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
<v-data-table :items="noticeData" class="elevation-0" flat hide-actions hide-headers style="border-spacing: 0 !important;" > <template slot="items" slot-scope="props" v-if="props.index < 5" style="border-spacing: 0 !important;" > <tr class="td-notice"> <td class="grey--text" style="width:18px">{{ props.index + 1}}</td> <td> <span class="grey--text caption">{{ date(props.item.created) }}</span> <br /> <span class="body-2">{{ props.item.title}}</span> </td> <td class="noticeDecritpion grey--text mt-2">{{ props.item.description}}</td> <td class="text-xs-center"> <span> <v-tooltip top> <img slot="activator" style="cursor:pointer; width:25px; height:25px; " @click="profile" |
aa310d61a
|
204 |
src="/static/icon/view.png" |
68d742034
|
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
/> <span>View</span> </v-tooltip> </span> </td> </tr> </template> </v-data-table> </v-card> </v-container> </v-flex> <v-flex xs12 sm12 md3> <v-card height="100%" class="elevation-0 mt-3 profileDasboard"> <v-card-text> <h4 class="text-xs-center py-3"> <b>Profile</b> </h4> <v-flex xs12 class="py-3"> |
67a276510
|
223 |
<v-layout wrap> |
68d742034
|
224 225 |
<v-flex xs12 sm12 md4> <img src="/static/icon/user.png" v-if="!userData.schoolLogoUrl" width="80" /> |
01d009dde
|
226 |
<img |
68d742034
|
227 228 229 |
:src="userData.schoolLogoUrl" v-else-if="userData.schoolLogoUrl" width="80" |
01d009dde
|
230 |
/> |
68d742034
|
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
</v-flex> <v-flex xs12 sm12 md6> <p class="mb-0 body-1"> <i>{{ userData.name }}</i> </p> <p class="mb-0 caption grey--text">{{ userData.email }}</p> <p class="mb-0 caption grey--text">{{ userData.mobile }}</p> <address class="caption grey--text mb-3">{{ userData.address }}</address> </v-flex> </v-layout> </v-flex> <hr /> <h4 class="text-xs-center py-3"> <b>Calender</b> </h4> <vue-event-calendar :events="demoEvents"></vue-event-calendar> </v-card-text> </v-card> </v-flex> </v-layout> </v-flex> </v-layout> |
a17c68a03
|
253 254 255 |
<v-dialog v-model="dialog" max-width="500"> <v-card color="grey lighten-4" flat> <v-toolbar dark color="fixcolors"> |
a17c68a03
|
256 257 258 259 260 261 262 263 264 |
<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
|
265 266 |
</v-list-tile-action> <v-list-tile-content> |
a17c68a03
|
267 |
<v-list-tile-title>{{ selected.title }}</v-list-tile-title> |
8bb178441
|
268 269 |
</v-list-tile-content> </v-list-tile> |
a17c68a03
|
270 271 272 273 274 275 |
<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
|
276 277 278 279 280 |
</v-list-tile-content> </v-list-tile> </v-flex> </v-card> </v-dialog> |
8bb178441
|
281 282 283 284 285 286 287 288 |
<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
|
289 |
import moment from "moment"; |
68d742034
|
290 |
// import { FunctionalCalendar } from "vue-functional-calendar"; |
8bb178441
|
291 292 |
export default { |
68d742034
|
293 294 295 |
components: { // FunctionalCalendar }, |
a17c68a03
|
296 297 |
data() { return { |
68d742034
|
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
// data: { // clieckedToday: false // }, // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"], // calendarData: {}, // calendar: {}, demoEvents: [ { date: "2020/01/10", // Required title: "Foo" // Required }, { date: "2020/01/12", title: "Bar", desc: "description", customClass: "disabled highlight" // Custom classes to an calendar cell } ], |
a17c68a03
|
316 |
showLoader: false, |
68d742034
|
317 |
calendarData: {}, |
a17c68a03
|
318 |
dialog: false, |
01d009dde
|
319 |
dialogNotice: false, |
b28a5f17d
|
320 321 |
HolidaysList: [], EventsList: [], |
ceb43037a
|
322 |
events: [], |
a17c68a03
|
323 324 325 326 |
config: { eventClick: event => { this.selected = event; this.dialog = true; |
8bb178441
|
327 328 |
} }, |
6c05a9f84
|
329 |
selected: {}, |
68d742034
|
330 |
// notice: {}, |
01d009dde
|
331 |
userData: {}, |
68d742034
|
332 333 334 |
dated: new Date(2018, 0, 9), userList: [], sectionList: [], |
6c05a9f84
|
335 336 337 |
students: "", parents: "", teachers: "", |
01d009dde
|
338 |
classes: "", |
68d742034
|
339 |
noticeData: [], |
65d5475b6
|
340 |
expenseData: [], |
68d742034
|
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
attrs: [ { key: "today", highlight: true, dates: new Date() } ], drawer: true, items: [ { title: "Home", icon: "dashboard" }, { title: "About", icon: "question_answer" } ], right: null, series: [ { name: "Total", data: [66, 44, 33] } ], chartOptions: { chart: { type: "bar", height: 150, |
68d600c97
|
365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
stacked: true // animations: { // enabled: true, // easing: "easeinout", // speed: 1200, // animateGradually: { // enabled: true, // delay: 450 // }, // dynamicAnimation: { // enabled: true, // speed: 450 // } // } |
68d742034
|
379 380 381 382 383 384 385 386 387 |
}, plotOptions: { bar: { horizontal: false, columnWidth: "25%", // endingShape: "rounded", distributed: true } }, |
68d600c97
|
388 389 390 391 392 393 394 395 396 397 398 399 |
responsive: [ { breakpoint: 480, options: { legend: { position: "bottom", offsetX: -10, offsetY: 0 } } } ], |
68d742034
|
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
legend: { show: false }, colors: ["#7852cc", "#f9a825", "#ff8a89"], dataLabels: { enabled: false }, stroke: { show: true, width: 2, colors: ["transparent"] }, xaxis: { categories: ["Fee", "Collections", "Expences"] }, yaxis: { title: { text: "" } }, fill: { opacity: 1 }, tooltip: { y: { formatter: function(val, opts) { // console.log("opts",opts.w.config.xaxis.categories) return "" + val + " "; } } } } |
a17c68a03
|
432 433 |
}; }, |
6c05a9f84
|
434 |
mounted() { |
8deade193
|
435 436 437 438 439 440 441 442 |
// = this.$store.state.schoolToken; // console.log("this.$store.state.role", this.token); if (this.$store.state.role === "ADMIN") { this.token = this.$store.state.token; } else if (this.$store.state.schoolRole === "SUPERADMIN") { this.token = this.$store.state.schoolToken; } // console.log("role", this.$store.state.schoolRole,"tt",this.$store.state.schoolToken); |
68d742034
|
443 |
// this.getData(); |
6c05a9f84
|
444 445 446 447 |
this.getStudents(); this.getTeachers(); this.getParents(); this.getClasses(); |
01d009dde
|
448 449 |
this.getNoticeData(); this.getUserData(); |
65d5475b6
|
450 |
this.getExpensesData(); |
68d742034
|
451 |
// this.getUsersList(); |
6c05a9f84
|
452 |
}, |
8bb178441
|
453 |
methods: { |
01d009dde
|
454 455 456 |
closeNotice() { this.dialogNotice = false; }, |
68d742034
|
457 |
profile() { |
01d009dde
|
458 |
// this.editedIndex = this.desserts.indexOf(item); |
68d742034
|
459 460 461 |
// this.notice = Object.assign({}, item); // this.dialogNotice = true; this.$router.push({ name: "NoticeBoard" }); |
01d009dde
|
462 |
}, |
a17c68a03
|
463 |
date: function(date) { |
68d742034
|
464 |
return moment(date).format("MMMM DD, YYYY HH:mm"); |
8bb178441
|
465 |
}, |
a17c68a03
|
466 467 468 469 470 471 472 473 474 |
refreshEvents() { this.$refs.calendar.$emit("refetch-events"); }, removeEvent() { this.$refs.calendar.$emit("remove-event", this.selected); this.selected = {}; }, eventSelected(event) { this.selected = event; |
db0c39244
|
475 |
console.log("this.selected", this.selected); |
a17c68a03
|
476 |
}, |
687e0b929
|
477 478 479 |
// eventDropStart: function(event) { // event.editable = false; // }, |
a17c68a03
|
480 481 |
eventCreated(...test) { console.log(test); |
8bb178441
|
482 |
}, |
6c05a9f84
|
483 484 |
getStudents() { http() |
7d0816758
|
485 |
.get("/getStudentsList", { |
8deade193
|
486 487 488 |
headers: { Authorization: "Bearer " + this.token } |
7d0816758
|
489 |
}) |
6c05a9f84
|
490 491 492 493 |
.then(response => { this.students = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
494 |
.catch(error => { |
6c05a9f84
|
495 496 |
// console.log("err====>", err); this.showLoader = false; |
8deade193
|
497 498 499 500 501 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
6c05a9f84
|
502 503 504 505 |
}); }, getParents() { http() |
25205ccca
|
506 |
.get("/getParentsList", { |
8deade193
|
507 508 509 |
headers: { Authorization: "Bearer " + this.token } |
25205ccca
|
510 |
}) |
6c05a9f84
|
511 512 513 514 |
.then(response => { this.parents = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
515 |
.catch(error => { |
6c05a9f84
|
516 517 |
// console.log("err====>", err); this.showLoader = false; |
8deade193
|
518 519 520 521 522 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
6c05a9f84
|
523 524 525 526 |
}); }, getTeachers() { http() |
7d0816758
|
527 |
.get("/getTeachersList", { |
8deade193
|
528 529 530 |
headers: { Authorization: "Bearer " + this.token } |
7d0816758
|
531 |
}) |
6c05a9f84
|
532 533 534 535 |
.then(response => { this.teachers = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
536 |
.catch(error => { |
6c05a9f84
|
537 538 |
// console.log("err====>", err); this.showLoader = false; |
8deade193
|
539 540 541 542 543 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
6c05a9f84
|
544 545 546 547 |
}); }, getClasses() { http() |
25205ccca
|
548 |
.get("/getClassesList", { |
8deade193
|
549 550 551 |
headers: { Authorization: "Bearer " + this.token } |
25205ccca
|
552 |
}) |
6c05a9f84
|
553 554 555 556 |
.then(response => { this.classes = response.data.data; this.showLoader = false; }) |
00e4bc4e1
|
557 |
.catch(error => { |
6c05a9f84
|
558 |
this.showLoader = false; |
8deade193
|
559 560 561 562 563 564 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // this.$store.dispatch("Role", null); // } |
6c05a9f84
|
565 |
}); |
01d009dde
|
566 567 568 569 |
}, getNoticeData() { this.showLoader = true; http() |
25205ccca
|
570 |
.get("/getEventsList", { |
8deade193
|
571 572 573 |
headers: { Authorization: "Bearer " + this.token } |
25205ccca
|
574 |
}) |
01d009dde
|
575 576 577 578 579 580 |
.then(response => { this.noticeData = response.data.data; this.showLoader = false; }) .catch(error => { this.showLoader = false; |
8deade193
|
581 582 583 584 585 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
01d009dde
|
586 587 588 |
}); }, getUserData() { |
68d742034
|
589 |
// this.showLoader = true; |
01d009dde
|
590 |
http() |
25205ccca
|
591 |
.get("/getParticularUserDetail", { |
8deade193
|
592 593 594 |
headers: { Authorization: "Bearer " + this.token } |
25205ccca
|
595 |
}) |
01d009dde
|
596 597 598 599 600 601 |
.then(response => { this.userData = response.data.data; this.showLoader = false; }) .catch(error => { this.showLoader = false; |
7d0816758
|
602 603 604 605 606 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
01d009dde
|
607 |
}); |
65d5475b6
|
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
}, getExpensesData() { http() .get("/getTotalExpenses", { headers: { Authorization: "Bearer " + this.token } }) .then(response => { this.expenseData = response.data.data; this.showLoader = false; }) .catch(error => { this.showLoader = false; }) |
8bb178441
|
623 |
} |
8bb178441
|
624 625 626 |
} }; </script> |
687e0b929
|
627 |
|
68d742034
|
628 |
<style scoped> |
a17c68a03
|
629 |
@import "fullcalendar/dist/fullcalendar.css"; |
a17c68a03
|
630 |
</style> |