Commit 898c80f271a011522a5c0385b45f275857237c7f
1 parent
29ad14d96b
Exists in
master
and in
1 other branch
added heading
Showing
3 changed files
with
28 additions
and
1 deletions
Show diff stats
src/pages/Authentication/Login.vue
... | ... | @@ -194,6 +194,7 @@ export default { |
194 | 194 | /* if zero element of false students list is > 0 then make first student as defalut selected */ |
195 | 195 | if (indexStatusFalse[0] > 0) { |
196 | 196 | this.selectedStudent = response.data.data.students[0]._id; |
197 | + this.$store.dispatch("SET_ACTIVE_STUDENT",response.data.data.students[0]) | |
197 | 198 | } |
198 | 199 | // console.log("indexStatusFalse - ", indexStatusFalse); |
199 | 200 | /* if false student is the first one in the list then see if the next is also false */ |
... | ... | @@ -226,6 +227,7 @@ export default { |
226 | 227 | } else { |
227 | 228 | this.selectedStudent = |
228 | 229 | response.data.data.students[counter]._id; |
230 | + this.$store.dispatch("SET_ACTIVE_STUDENT",response.data.data.students[counter]) | |
229 | 231 | var studentName = response.data.data.students[counter].name; |
230 | 232 | localStorage.setItem("studentName", studentName); |
231 | 233 | localStorage.setItem( | ... | ... |
src/pages/Dashboard/dashboard.vue
... | ... | @@ -411,6 +411,7 @@ |
411 | 411 | <!-- apex charts - Male Female data --> |
412 | 412 | <v-flex> |
413 | 413 | <v-card> |
414 | + <v-card-title class="justify-center title font-weight-bold" >Students</v-card-title> | |
414 | 415 | <div id="chart"> |
415 | 416 | <apexcharts |
416 | 417 | type="donut" |
... | ... | @@ -632,6 +633,15 @@ |
632 | 633 | </v-container> |
633 | 634 | </v-card> |
634 | 635 | </v-flex> |
636 | + | |
637 | + <!-- <v-flex xs12> | |
638 | + <v-card> | |
639 | + <v-card-title class="justify-center title font-weight-bold">Students</v-card-title> | |
640 | + <v-card-text> | |
641 | + | |
642 | + </v-card-text> | |
643 | + </v-card> | |
644 | + </v-flex> --> | |
635 | 645 | <!-- ONLINE USER , IF ROLE == PARENT --> |
636 | 646 | <!-- <v-flex xs6> |
637 | 647 | <v-card class="card"> |
... | ... | @@ -846,7 +856,7 @@ export default { |
846 | 856 | mixins: [AllApiCalls], |
847 | 857 | data() { |
848 | 858 | return { |
849 | - today: new Date(), | |
859 | + studentsData: [], | |
850 | 860 | // data: { |
851 | 861 | // clieckedToday: false |
852 | 862 | // }, |
... | ... | @@ -934,6 +944,7 @@ export default { |
934 | 944 | collectionData: [], |
935 | 945 | courseData: [], |
936 | 946 | studentsData: [], |
947 | + activeStudent: {}, | |
937 | 948 | annoucementData: [], |
938 | 949 | role: "", |
939 | 950 | attrs: [ |
... | ... | @@ -1430,6 +1441,7 @@ export default { |
1430 | 1441 | // console.log("students data - ", this.studentsData); |
1431 | 1442 | await this.getCourses(); |
1432 | 1443 | await this.getAnnoucementes(); |
1444 | + this.activeStudent = this.$store.getters.GET_ACTIVE_STUDENT | |
1433 | 1445 | } |
1434 | 1446 | this.role = this.$store.state.role; |
1435 | 1447 | ... | ... |
src/store/store.js
... | ... | @@ -19,11 +19,16 @@ export default new Vuex.Store({ |
19 | 19 | schoolToken: null, |
20 | 20 | schoolRole: null, |
21 | 21 | studentsData: [], |
22 | + activeStudent: {}, | |
23 | + | |
22 | 24 | }, |
23 | 25 | getters: { |
24 | 26 | GET_STUDENTS_DATA: state => { |
25 | 27 | return state.studentsData |
26 | 28 | }, |
29 | + GET_ACTIVE_STUDENT: state => { | |
30 | + return state.activeStudent | |
31 | + }, | |
27 | 32 | GET_TOKEN: state => { |
28 | 33 | return state.token |
29 | 34 | }, |
... | ... | @@ -69,6 +74,9 @@ export default new Vuex.Store({ |
69 | 74 | SET_STUDENTS_DATA(state, data) { |
70 | 75 | state.studentsData = data |
71 | 76 | }, |
77 | + SET_ACTIVE_STUDENT(state, data) { | |
78 | + state.activeStudent = data | |
79 | + }, | |
72 | 80 | // SchoolId(state, schoolId) { |
73 | 81 | // state.schoolId = schoolId |
74 | 82 | // } |
... | ... | @@ -100,6 +108,11 @@ export default new Vuex.Store({ |
100 | 108 | }, data) { |
101 | 109 | commit('SET_STUDENTS_DATA', data) |
102 | 110 | }, |
111 | + SET_ACTIVE_STUDENT({ | |
112 | + commit | |
113 | + }, data) { | |
114 | + commit('SET_ACTIVE_STUDENT', data) | |
115 | + }, | |
103 | 116 | Id({ |
104 | 117 | commit |
105 | 118 | }, id) { | ... | ... |