Commit 37150e7c188034358ce05c0f05dfc15ee8b22147
1 parent
ec5677f432
Exists in
master
and in
3 other branches
implement school functionality with role
Showing
12 changed files
with
1456 additions
and
161 deletions
Show diff stats
src/Services/http.js
1 | import axios from 'axios' | 1 | import axios from 'axios' |
2 | import store from '@/store/store' | 2 | import store from '@/store/store' |
3 | 3 | ||
4 | export default () => { | 4 | export default () => { |
5 | return axios.create({ | 5 | return axios.create({ |
6 | // baseURL: 'http://192.168.0.101:3002/v1', | 6 | // baseURL: 'http://192.168.2.221:3002/v1', |
7 | baseURL: 'http://13.234.251.173:8001/v1', | 7 | baseURL: 'http://13.234.251.173:8001/v1', |
8 | headers: { | 8 | headers: { |
9 | Authorization: `Bearer ${store.state.token}` | 9 | Authorization: `Bearer ${store.state.token}` |
10 | } | 10 | } |
11 | }) | 11 | }) |
12 | } | 12 | } |
src/api/menu.js
1 | const Menu = [ | 1 | const adminMenu = [ |
2 | // { header: 'Apps' }, | 2 | // { header: 'Apps' }, |
3 | { | 3 | { |
4 | title: 'Dashboard', | 4 | title: 'Dashboard', |
5 | // group: 'apps', | 5 | // group: 'apps', |
6 | path: '/dashboard', | 6 | path: '/dashboard', |
7 | icon: '/static/schoolIcons/Dashboard.png', | 7 | icon: '/static/schoolIcons/Dashboard.png', |
8 | }, | 8 | }, |
9 | { | 9 | { |
10 | title: 'Class', | 10 | title: 'Class', |
11 | // group: 'apps', | 11 | // group: 'apps', |
12 | path: '/addclass', | 12 | path: '/addclass', |
13 | icon: '/static/schoolIcons/Class.png', | 13 | icon: '/static/schoolIcons/Class.png', |
14 | }, | 14 | }, |
15 | { | 15 | { |
16 | title: 'Section', | 16 | title: 'Section', |
17 | // group: 'apps', | 17 | // group: 'apps', |
18 | path: '/section', | 18 | path: '/section', |
19 | icon: '/static/schoolIcons/Section.png', | 19 | icon: '/static/schoolIcons/Section.png', |
20 | }, | 20 | }, |
21 | { | 21 | { |
22 | title: 'Subjects', | 22 | title: 'Subjects', |
23 | path: '/subject', | 23 | path: '/subject', |
24 | icon: '/static/schoolIcons/Subjects.png', | 24 | icon: '/static/schoolIcons/Subjects.png', |
25 | }, | 25 | }, |
26 | { | 26 | { |
27 | title: 'Parents', | 27 | title: 'Parents', |
28 | // group: 'apps', | 28 | // group: 'apps', |
29 | path: '/parents', | 29 | path: '/parents', |
30 | icon: '/static/schoolIcons/Parents.png', | 30 | icon: '/static/schoolIcons/Parents.png', |
31 | }, | 31 | }, |
32 | { | 32 | { |
33 | title: 'Teachers', | 33 | title: 'Teachers', |
34 | // group: '', | 34 | // group: '', |
35 | path: 'teachers', | 35 | path: 'teachers', |
36 | icon: '/static/schoolIcons/Teachers.png', | 36 | icon: '/static/schoolIcons/Teachers.png', |
37 | }, | 37 | }, |
38 | { | 38 | { |
39 | title: 'Students', | 39 | title: 'Students', |
40 | // group: 'apps', | 40 | // group: 'apps', |
41 | path: '/Students', | 41 | path: '/Students', |
42 | icon: '/static/schoolIcons/Students.png', | 42 | icon: '/static/schoolIcons/Students.png', |
43 | }, | 43 | }, |
44 | { | 44 | { |
45 | title: 'User', | 45 | title: 'User', |
46 | path: '/User', | 46 | path: '/User', |
47 | icon: '/static/schoolIcons/User.png', | 47 | icon: '/static/schoolIcons/User.png', |
48 | }, | 48 | }, |
49 | { | 49 | { |
50 | title: 'Attendance', | 50 | title: 'Attendance', |
51 | group: 'Attendance', | 51 | group: 'Attendance', |
52 | component: 'Attendance', | 52 | component: 'Attendance', |
53 | icon: '/static/schoolIcons/Attendance.png', | 53 | icon: '/static/schoolIcons/Attendance.png', |
54 | items: [ | 54 | items: [ |
55 | { name: 'studentAttendence', title: 'Student Attendance', component: 'studentAttendence', action: '', }, | 55 | { name: 'studentAttendence', title: 'Student Attendance', component: 'studentAttendence', action: '', }, |
56 | // { name: 'teacherAttendence', title: 'Teacher Attendance', component: 'teacherAttendence', action: '', }, | 56 | // { name: 'teacherAttendence', title: 'Teacher Attendance', component: 'teacherAttendence', action: '', }, |
57 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, | 57 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, |
58 | ] | 58 | ] |
59 | }, | 59 | }, |
60 | { | 60 | { |
61 | title: 'Exam', | 61 | title: 'Exam', |
62 | group: 'Exam', | 62 | group: 'Exam', |
63 | component: 'Exam', | 63 | component: 'Exam', |
64 | icon: '/static/schoolIcons/exam.png', | 64 | icon: '/static/schoolIcons/exam.png', |
65 | items: [ | 65 | items: [ |
66 | { name: 'Exam', title: 'Exam', component: 'Exam', action: '', }, | 66 | { name: 'Exam', title: 'Exam', component: 'Exam', action: '', }, |
67 | { name: 'ExamSchedule', title: 'Exam Schedule', component: 'ExamSchedule', action: '', }, | 67 | { name: 'ExamSchedule', title: 'Exam Schedule', component: 'ExamSchedule', action: '', }, |
68 | { name: 'Grade', title: 'Grade', component: 'Grade', action: '', }, | 68 | { name: 'Grade', title: 'Grade', component: 'Grade', action: '', }, |
69 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, | 69 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, |
70 | ] | 70 | ] |
71 | }, | 71 | }, |
72 | { | 72 | { |
73 | title: 'Mark', | 73 | title: 'Mark', |
74 | group: 'Mark', | 74 | group: 'Mark', |
75 | component: 'Mark', | 75 | component: 'Mark', |
76 | icon: '/static/schoolIcons/marks.png', | 76 | icon: '/static/schoolIcons/marks.png', |
77 | items: [ | 77 | items: [ |
78 | { name: 'Mark', title: 'Mark', component: 'Mark', action: '', }, | 78 | { name: 'Mark', title: 'Mark', component: 'Mark', action: '', }, |
79 | { name: 'markDistribution', title: 'Mark Distribution', component: 'markDistribution', action: '', }, | 79 | { name: 'markDistribution', title: 'Mark Distribution', component: 'markDistribution', action: '', }, |
80 | { name: 'Promotion', title: 'promotion', component: 'Promotion', action: '', }, | 80 | { name: 'Promotion', title: 'promotion', component: 'Promotion', action: '', }, |
81 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, | 81 | // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, |
82 | ] | 82 | ] |
83 | }, | 83 | }, |
84 | { | 84 | { |
85 | title: 'Administrator', | 85 | title: 'Administrator', |
86 | group: 'Administrator', | 86 | group: 'Administrator', |
87 | component: 'Administrator', | 87 | component: 'Administrator', |
88 | icon: '/static/schoolIcons/administrator.png', | 88 | icon: '/static/schoolIcons/administrator.png', |
89 | items: [ | 89 | items: [ |
90 | { name: 'academicYear', title: 'Academic Year', component: 'academicYear', action: '', }, | 90 | { name: 'academicYear', title: 'Academic Year', component: 'academicYear', action: '', }, |
91 | { name: 'systemAdmin', title: 'System Admin', component: 'systemAdmin', action: '', }, | 91 | { name: 'systemAdmin', title: 'System Admin', component: 'systemAdmin', action: '', }, |
92 | { name: 'resetPassword', title: 'Reset Password', component: 'resetPassword', action: '', }, | 92 | { name: 'resetPassword', title: 'Reset Password', component: 'resetPassword', action: '', }, |
93 | { name: 'Role', title: 'Role', component: 'Role', action: '', }, | 93 | { name: 'Role', title: 'Role', component: 'Role', action: '', }, |
94 | ] | 94 | ] |
95 | }, | 95 | }, |
96 | { | 96 | { |
97 | title: 'Notice Board', | 97 | title: 'Notice Board', |
98 | path: '/NoticeBoard', | 98 | path: '/NoticeBoard', |
99 | icon: '/static/schoolIcons/Notice_board.png', | 99 | icon: '/static/schoolIcons/Notice_board.png', |
100 | }, | 100 | }, |
101 | { | 101 | { |
102 | title: 'News', | 102 | title: 'News', |
103 | path: '/news', | 103 | path: '/news', |
104 | icon: '/static/schoolIcons/News.png', | 104 | icon: '/static/schoolIcons/News.png', |
105 | }, | 105 | }, |
106 | // { | 106 | // { |
107 | // title: 'Reminder', | 107 | // title: 'Reminder', |
108 | // name: 'reminder', | 108 | // name: 'reminder', |
109 | // icon: 'alarm_add', | 109 | // icon: 'alarm_add', |
110 | // }, | 110 | // }, |
111 | { | 111 | { |
112 | title: 'Time Table', | 112 | title: 'Time Table', |
113 | path: '/timeTable', | 113 | path: '/timeTable', |
114 | icon: '/static/schoolIcons/Time_table.png', | 114 | icon: '/static/schoolIcons/Time_table.png', |
115 | }, | 115 | }, |
116 | { | 116 | { |
117 | title: 'Library', | 117 | title: 'Library', |
118 | group: 'Library', | 118 | group: 'Library', |
119 | component: 'Library', | 119 | component: 'Library', |
120 | icon: '/static/schoolIcons/Library.png', | 120 | icon: '/static/schoolIcons/Library.png', |
121 | items: [ | 121 | items: [ |
122 | { name: 'libraryMember', title: ' Library Member', component: 'libraryMember', action: '', }, | 122 | { name: 'libraryMember', title: ' Library Member', component: 'libraryMember', action: '', }, |
123 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, | 123 | { name: 'Books', title: 'Books', component: 'Books', action: '', }, |
124 | { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, | 124 | { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, |
125 | { name: 'eBooks', title: 'E-Books', component: 'eBooks', action: '', } | 125 | { name: 'eBooks', title: 'E-Books', component: 'eBooks', action: '', } |
126 | 126 | ||
127 | ] | 127 | ] |
128 | }, | 128 | }, |
129 | { | 129 | { |
130 | title: 'Report', | 130 | title: 'Report', |
131 | group: 'Report', | 131 | group: 'Report', |
132 | component: 'Report', | 132 | component: 'Report', |
133 | icon: '/static/schoolIcons/reports.png', | 133 | icon: '/static/schoolIcons/reports.png', |
134 | items: [ | 134 | items: [ |
135 | { name: 'studentReport', title: 'Student Report', component: 'studentReport', action: '', }, | 135 | { name: 'studentReport', title: 'Student Report', component: 'studentReport', action: '', }, |
136 | { name: 'progressCardReport', title: 'Progress Card Report', component: 'progressCardReport', action: '', } | 136 | { name: 'progressCardReport', title: 'Progress Card Report', component: 'progressCardReport', action: '', } |
137 | ] | 137 | ] |
138 | }, | 138 | }, |
139 | { | 139 | { |
140 | title: 'Notification', | 140 | title: 'Notification', |
141 | path: '/notification', | 141 | path: '/notification', |
142 | icon: '/static/schoolIcons/Notification.png', | 142 | icon: '/static/schoolIcons/Notification.png', |
143 | }, | 143 | }, |
144 | { | 144 | { |
145 | title: 'Social Media', | 145 | title: 'Social Media', |
146 | path: '/SocialMedia', | 146 | path: '/SocialMedia', |
147 | icon: '/static/schoolIcons/Social_Media.png', | 147 | icon: '/static/schoolIcons/Social_Media.png', |
148 | }, | 148 | }, |
149 | { | 149 | { |
150 | title: 'Gallery', | 150 | title: 'Gallery', |
151 | path: '/Gallery', | 151 | path: '/Gallery', |
152 | icon: '/static/schoolIcons/Gallery.png', | 152 | icon: '/static/schoolIcons/Gallery.png', |
153 | }, | 153 | }, |
154 | { | 154 | { |
155 | title: 'Event', | 155 | title: 'Event', |
156 | path: '/Event', | 156 | path: '/Event', |
157 | icon: '/static/schoolIcons/Events.png', | 157 | icon: '/static/schoolIcons/Events.png', |
158 | }, | 158 | }, |
159 | { | 159 | { |
160 | title: 'Account', | 160 | title: 'Account', |
161 | group: 'Account', | 161 | group: 'Account', |
162 | component: 'Account', | 162 | component: 'Account', |
163 | icon: '/static/schoolIcons/Account.png', | 163 | icon: '/static/schoolIcons/Account.png', |
164 | items: [ | 164 | items: [ |
165 | { name: 'feeTypes', title: 'Fee Types', component: 'feeTypes', action: '', }, | 165 | { name: 'feeTypes', title: 'Fee Types', component: 'feeTypes', action: '', }, |
166 | { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, | 166 | { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, |
167 | { name: 'paymentHistory', title: 'Payment History', component: 'paymentHistory', action: '', }, | 167 | { name: 'paymentHistory', title: 'Payment History', component: 'paymentHistory', action: '', }, |
168 | { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, | 168 | { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, |
169 | { name: 'Income', title: 'Income', component: 'Income', action: '', }, | 169 | { name: 'Income', title: 'Income', component: 'Income', action: '', }, |
170 | ] | 170 | ] |
171 | }, | 171 | }, |
172 | { | 172 | { |
173 | title: 'Holiday', | 173 | title: 'Holiday', |
174 | path: '/Holiday', | 174 | path: '/Holiday', |
175 | icon: '/static/schoolIcons/Holidays.png', | 175 | icon: '/static/schoolIcons/Holidays.png', |
176 | }, | 176 | }, |
177 | { | 177 | { |
178 | title: 'General Setting', | 178 | title: 'General Setting', |
179 | path: '/generalSetting', | 179 | path: '/generalSetting', |
180 | icon: '/static/schoolIcons/settings.png', | 180 | icon: '/static/schoolIcons/settings.png', |
181 | } | 181 | } |
182 | ]; | 182 | ]; |
183 | 183 | ||
184 | const schoolMenu = [ | ||
185 | // { header: 'Apps' }, | ||
186 | { | ||
187 | title: 'School', | ||
188 | // group: 'apps', | ||
189 | path: '/school', | ||
190 | icon: '/static/schoolIcons/Dashboard.png', | ||
191 | }, | ||
192 | ]; | ||
184 | 193 | ||
185 | // reorder menu | 194 | // reorder menu |
186 | Menu.forEach((item) => { | 195 | // Menu.forEach((item) => { |
187 | // if (item.items) { | 196 | // if (item.items) { |
188 | // item.items.sort((x, y) => { | 197 | // item.items.sort((x, y) => { |
189 | // let textA = x.title.toUpperCase(); | 198 | // let textA = x.title.toUpperCase(); |
190 | // let textB = y.title.toUpperCase(); | 199 | // let textB = y.title.toUpperCase(); |
191 | // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; | 200 | // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; |
192 | // }); | 201 | // }); |
193 | // } | 202 | // } |
194 | }); | 203 | // }); |
195 | 204 | ||
196 | export default Menu; |
src/components/pageHeader/AppDrawer.vue
1 | <template> | 1 | <template> |
2 | <v-navigation-drawer | 2 | <v-navigation-drawer |
3 | id="appDrawer" | 3 | id="appDrawer" |
4 | :mini-variant.sync="mini" | 4 | :mini-variant.sync="mini" |
5 | fixed | 5 | fixed |
6 | :dark="$vuetify.dark" | 6 | :dark="$vuetify.dark" |
7 | app | 7 | app |
8 | v-model="drawer" | 8 | v-model="drawer" |
9 | width="260" | 9 | width="260" |
10 | > | 10 | > |
11 | <v-toolbar class="fixcolors"> | 11 | <v-toolbar class="fixcolors"> |
12 | <img v-bind:src="computeLogo" height="40" width="150" class="imgLogo" alt="ana" /> | 12 | <img v-bind:src="computeLogo" height="40" width="150" class="imgLogo" alt="ana" /> |
13 | <v-toolbar-title class="ml-0 pl-3"></v-toolbar-title> | 13 | <v-toolbar-title class="ml-0 pl-3"></v-toolbar-title> |
14 | </v-toolbar> | 14 | </v-toolbar> |
15 | <vue-perfect-scrollbar class="drawer-menu--scroll" :settings="scrollSettings"> | 15 | <vue-perfect-scrollbar class="drawer-menu--scroll" :settings="scrollSettings"> |
16 | <v-list dense expand> | 16 | <v-list dense expand> |
17 | <template v-for="(item, i) in menus"> | 17 | <template v-for="(item, i) in menus"> |
18 | <!--group with subitems--> | 18 | <!--group with subitems--> |
19 | <v-list-group | 19 | <v-list-group |
20 | v-if="item.items" | 20 | v-if="item.items" |
21 | :key="item.name" | 21 | :key="item.name" |
22 | :group="item.group" | 22 | :group="item.group" |
23 | no-action="no-action" | 23 | no-action="no-action" |
24 | > | 24 | > |
25 | <v-list-tile slot="activator" ripple="ripple"> | 25 | <v-list-tile slot="activator" ripple="ripple"> |
26 | <v-list-tile-action v-if="item.icon" class="pr-3"> | 26 | <v-list-tile-action v-if="item.icon" class="pr-3"> |
27 | <img :src="item.icon" width="40" alt="icons" /> | 27 | <img :src="item.icon" width="40" alt="icons" /> |
28 | </v-list-tile-action> | 28 | </v-list-tile-action> |
29 | <v-list-tile-content> | 29 | <v-list-tile-content> |
30 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 30 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
31 | </v-list-tile-content> | 31 | </v-list-tile-content> |
32 | </v-list-tile> | 32 | </v-list-tile> |
33 | <template v-for="(subItem, i) in item.items"> | 33 | <template v-for="(subItem, i) in item.items"> |
34 | <!--sub group--> | 34 | <!--sub group--> |
35 | <v-list-group | 35 | <v-list-group |
36 | v-if="subItem.items" | 36 | v-if="subItem.items" |
37 | :key="subItem.name" | 37 | :key="subItem.name" |
38 | :group="subItem.group" | 38 | :group="subItem.group" |
39 | sub-group="sub-group" | 39 | sub-group="sub-group" |
40 | > | 40 | > |
41 | <v-list-tile slot="activator" ripple="ripple"> | 41 | <v-list-tile slot="activator" ripple="ripple"> |
42 | <v-list-tile-content> | 42 | <v-list-tile-content> |
43 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 43 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
44 | </v-list-tile-content> | 44 | </v-list-tile-content> |
45 | </v-list-tile> | 45 | </v-list-tile> |
46 | <v-list-tile | 46 | <v-list-tile |
47 | v-for="(grand, i) in subItem.children" | 47 | v-for="(grand, i) in subItem.children" |
48 | :key="i" | 48 | :key="i" |
49 | :to="genChildTarget(item, grand)" | 49 | :to="genChildTarget(item, grand)" |
50 | :href="grand.href" | 50 | :href="grand.href" |
51 | ripple="ripple" | 51 | ripple="ripple" |
52 | > | 52 | > |
53 | <v-list-tile-content> | 53 | <v-list-tile-content> |
54 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 54 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
55 | </v-list-tile-content> | 55 | </v-list-tile-content> |
56 | </v-list-tile> | 56 | </v-list-tile> |
57 | </v-list-group> | 57 | </v-list-group> |
58 | <!--child item--> | 58 | <!--child item--> |
59 | <v-list-tile | 59 | <v-list-tile |
60 | v-else | 60 | v-else |
61 | :key="i" | 61 | :key="i" |
62 | :to="genChildTarget(item, subItem)" | 62 | :to="genChildTarget(item, subItem)" |
63 | :href="subItem.href" | 63 | :href="subItem.href" |
64 | :disabled="subItem.disabled" | 64 | :disabled="subItem.disabled" |
65 | :target="subItem.target" | 65 | :target="subItem.target" |
66 | ripple="ripple" | 66 | ripple="ripple" |
67 | > | 67 | > |
68 | <v-list-tile-action v-if="subItem.action"> | 68 | <v-list-tile-action v-if="subItem.action"> |
69 | <img | 69 | <img |
70 | width="30" | 70 | width="30" |
71 | :src="subItem.action" | 71 | :src="subItem.action" |
72 | :class="[subItem.actionClass || 'success--text']" | 72 | :class="[subItem.actionClass || 'success--text']" |
73 | /> | 73 | /> |
74 | </v-list-tile-action> | 74 | </v-list-tile-action> |
75 | <v-list-tile-content> | 75 | <v-list-tile-content> |
76 | <v-list-tile-title class="body-2"> | 76 | <v-list-tile-title class="body-2"> |
77 | <span>{{ subItem.title }}</span> | 77 | <span>{{ subItem.title }}</span> |
78 | </v-list-tile-title> | 78 | </v-list-tile-title> |
79 | </v-list-tile-content> | 79 | </v-list-tile-content> |
80 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 80 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
81 | </v-list-tile> | 81 | </v-list-tile> |
82 | </template> | 82 | </template> |
83 | </v-list-group> | 83 | </v-list-group> |
84 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 84 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
85 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 85 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
86 | <!--top-level link--> | 86 | <!--top-level link--> |
87 | <v-list-tile | 87 | <v-list-tile |
88 | v-else | 88 | v-else |
89 | ripple="ripple" | 89 | ripple="ripple" |
90 | :disabled="item.disabled" | 90 | :disabled="item.disabled" |
91 | :target="item.target" | 91 | :target="item.target" |
92 | rel="noopener" | 92 | rel="noopener" |
93 | :key="item.path" | 93 | :key="item.path" |
94 | > | 94 | > |
95 | <a :href="item.path"> | 95 | <a :href="item.path"> |
96 | <v-list-tile-action v-if="item.icon"> | 96 | <v-list-tile-action v-if="item.icon"> |
97 | <img :src="item.icon" width="40" alt="icons" /> | 97 | <img :src="item.icon" width="40" alt="icons" /> |
98 | </v-list-tile-action> | 98 | </v-list-tile-action> |
99 | <v-list-tile-content class="pl-3 mt-2"> | 99 | <v-list-tile-content class="pl-3 mt-2"> |
100 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 100 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
101 | </v-list-tile-content> | 101 | </v-list-tile-content> |
102 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 102 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
103 | <v-list-tile-action v-if="item.subAction"> | 103 | <v-list-tile-action v-if="item.subAction"> |
104 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 104 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
105 | <img :src="item.icon" width="40" alt="icons" /> | 105 | <img :src="item.icon" width="40" alt="icons" /> |
106 | </v-list-tile-action> | 106 | </v-list-tile-action> |
107 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 107 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
108 | </a> | 108 | </a> |
109 | </v-list-tile> | 109 | </v-list-tile> |
110 | </template> | 110 | </template> |
111 | </v-list> | 111 | </v-list> |
112 | </vue-perfect-scrollbar> | 112 | </vue-perfect-scrollbar> |
113 | </v-navigation-drawer> | 113 | </v-navigation-drawer> |
114 | </template> | 114 | </template> |
115 | <script> | 115 | <script> |
116 | import menu from "@/api/menu"; | 116 | import menu from "@/api/menu"; |
117 | import VuePerfectScrollbar from "vue-perfect-scrollbar"; | 117 | import VuePerfectScrollbar from "vue-perfect-scrollbar"; |
118 | export default { | 118 | export default { |
119 | name: "app-drawer", | 119 | name: "app-drawer", |
120 | components: { | 120 | components: { |
121 | VuePerfectScrollbar | 121 | VuePerfectScrollbar |
122 | }, | 122 | }, |
123 | props: { | 123 | props: { |
124 | expanded: { | 124 | expanded: { |
125 | type: Boolean, | 125 | type: Boolean, |
126 | default: true | 126 | default: true |
127 | } | 127 | } |
128 | }, | 128 | }, |
129 | data: () => ({ | 129 | data: () => ({ |
130 | mini: false, | 130 | mini: false, |
131 | drawer: true, | 131 | drawer: true, |
132 | menus: menu, | 132 | menus: [], |
133 | scrollSettings: { | 133 | scrollSettings: { |
134 | maxScrollbarLength: 160 | 134 | maxScrollbarLength: 160 |
135 | } | 135 | } |
136 | }), | 136 | }), |
137 | computed: { | 137 | computed: { |
138 | computeGroupActive() { | 138 | computeGroupActive() { |
139 | return true; | 139 | return true; |
140 | }, | 140 | }, |
141 | computeLogo() { | 141 | computeLogo() { |
142 | return "/static/logoIntrack.png"; | 142 | return "/static/logoIntrack.png"; |
143 | }, | 143 | }, |
144 | 144 | ||
145 | sideToolbarColor() { | 145 | sideToolbarColor() { |
146 | return this.$vuetify.options.extra.sideNav; | 146 | return this.$vuetify.options.extra.sideNav; |
147 | } | 147 | } |
148 | }, | 148 | }, |
149 | created() { | 149 | created() { |
150 | if (this.$store.state.role === "ADMIN") { | ||
151 | this.menus = menu.adminMenu; | ||
152 | } else if (this.$store.state.role === "SUPERADMIN") { | ||
153 | this.menus = menu.schoolMenu; | ||
154 | } | ||
150 | window.getApp.$on("APP_DRAWER_TOGGLED", () => { | 155 | window.getApp.$on("APP_DRAWER_TOGGLED", () => { |
151 | this.drawer = !this.drawer; | 156 | this.drawer = !this.drawer; |
152 | }); | 157 | }); |
153 | }, | 158 | }, |
154 | 159 | ||
155 | methods: { | 160 | methods: { |
156 | genChildTarget(item, subItem) { | 161 | genChildTarget(item, subItem) { |
157 | if (subItem.href) return; | 162 | if (subItem.href) return; |
158 | if (subItem.component) { | 163 | if (subItem.component) { |
159 | return { | 164 | return { |
160 | name: subItem.component | 165 | name: subItem.component |
161 | }; | 166 | }; |
162 | } | 167 | } |
163 | return { name: `${item.group}/${subItem.name}` }; | 168 | return { name: `${item.group}/${subItem.name}` }; |
164 | } | 169 | } |
165 | } | 170 | } |
166 | }; | 171 | }; |
167 | </script> | 172 | </script> |
168 | 173 | ||
169 | 174 | ||
170 | <style lang="stylus"> | 175 | <style lang="stylus"> |
171 | // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl'; | 176 | // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl'; |
172 | #appDrawer { | 177 | #appDrawer { |
173 | overflow: hidden; | 178 | overflow: hidden; |
174 | 179 | ||
175 | .drawer-menu--scroll { | 180 | .drawer-menu--scroll { |
176 | height: calc(100vh - 48px); | 181 | height: calc(100vh - 48px); |
177 | overflow: auto; | 182 | overflow: auto; |
178 | } | 183 | } |
179 | } | 184 | } |
185 | |||
180 | .v-list__group__items--no-action .v-list__tile { | 186 | .v-list__group__items--no-action .v-list__tile { |
181 | padding-left: 72px !important; | 187 | padding-left: 72px !important; |
182 | } | 188 | } |
189 | |||
183 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { | 190 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
184 | height: 60px; | 191 | height: 60px; |
185 | font-size: 17px; | 192 | font-size: 17px; |
186 | } | 193 | } |
187 | 194 | ||
188 | .v-list__tile__action { | 195 | .v-list__tile__action { |
189 | min-width: 36px; | 196 | min-width: 36px; |
190 | } | 197 | } |
191 | 198 | ||
192 | .v-list__tile.primary--text a { | 199 | .v-list__tile.primary--text a { |
193 | color: black !important; | 200 | color: black !important; |
194 | border-left: 4px solid black; | 201 | border-left: 4px solid black; |
195 | border-radius: 4px; | 202 | border-radius: 4px; |
196 | } | 203 | } |
197 | 204 | ||
198 | @media screen and (max-width: 420px) { | 205 | @media screen and (max-width: 420px) { |
199 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { | 206 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
200 | font-size: 14px; | 207 | font-size: 14px; |
201 | } | 208 | } |
202 | 209 | ||
203 | .imgLogo { | 210 | .imgLogo { |
204 | height: 32px; | 211 | height: 32px; |
205 | width: 120px; | 212 | width: 120px; |
206 | } | 213 | } |
207 | } | 214 | } |
208 | </style> | 215 | </style> |
209 | 216 | ||
210 | 217 | ||
211 | <style scoped> | 218 | <style scoped> |
212 | .theme--light .v-icon, | 219 | .theme--light .v-icon, |
213 | .application .theme--light.v-icon { | 220 | .application .theme--light.v-icon { |
214 | color: #39b982; | 221 | color: #39b982; |
215 | } | 222 | } |
216 | a { | 223 | a { |
217 | text-decoration: none; | 224 | text-decoration: none; |
218 | display: inherit; | 225 | display: inherit; |
219 | color: black; | 226 | color: black; |
220 | } | 227 | } |
221 | a:hover { | 228 | a:hover { |
222 | color: gray !important; | 229 | color: gray !important; |
223 | /* border-left: 4px solid black; */ | 230 | /* border-left: 4px solid black; */ |
224 | /* border-radius: 4px; */ | 231 | /* border-radius: 4px; */ |
225 | } | 232 | } |
226 | /* a:active { | 233 | /* a:active { |
227 | color: red !important; | 234 | color: red !important; |
228 | } */ | 235 | } */ |
229 | /* a:visited { | 236 | /* a:visited { |
230 | border-left: 4px solid black; | 237 | border-left: 4px solid black; |
231 | border-radius: 4px; | 238 | border-radius: 4px; |
232 | } */ | 239 | } */ |
233 | /* visited link */ | 240 | /* visited link */ |
234 | /* a:visited { | 241 | /* a:visited { |
235 | color: black !important; | 242 | color: black !important; |
236 | border-left: 4px solid black; | 243 | border-left: 4px solid black; |
237 | border-radius: 4px; | 244 | border-radius: 4px; |
238 | } | 245 | } |
239 | a:active { | 246 | a:active { |
240 | color: black !important; | 247 | color: black !important; |
241 | border-left: 4px solid black; | 248 | border-left: 4px solid black; |
242 | border-radius: 4px; | 249 | border-radius: 4px; |
243 | } */ | 250 | } */ |
244 | </style> | 251 | </style> |
245 | 252 | ||
246 | 253 |
src/event.js
1 | export default [ | 1 | export default [{ |
2 | { | 2 | name: 'APP_LOGIN_SUCCESS', |
3 | name: 'APP_LOGIN_SUCCESS', | 3 | callback: function(e) { |
4 | callback: function (e) { | 4 | this.$router.push({ path: 'dashboard' }); |
5 | this.$router.push({ path: 'dashboard' }); | 5 | } |
6 | } | 6 | }, |
7 | }, | 7 | { |
8 | { | 8 | name: 'APP_LOGOUT', |
9 | name: 'APP_LOGOUT', | 9 | callback: function(e) { |
10 | callback: function (e) { | 10 | this.snackbar = { |
11 | this.snackbar = { | 11 | show: true, |
12 | show: true, | 12 | color: 'green', |
13 | color: 'green', | 13 | text: 'Logout successfully.' |
14 | text: 'Logout successfully.' | 14 | }; |
15 | }; | 15 | this.$store.dispatch('setToken', null) |
16 | this.$store.dispatch('setToken', null) | 16 | this.$store.dispatch('Id', null) |
17 | this.$store.dispatch('Id', null) | 17 | this.$store.dispatch('Role', null) |
18 | this.$router.replace({ path: '/' }); | 18 | this.$router.replace({ path: '/' }); |
19 | } | 19 | } |
20 | }, | 20 | }, |
21 | { | 21 | { |
22 | name: 'APP_CHANGE', | 22 | name: 'APP_CHANGE', |
23 | callback: function (e) { | 23 | callback: function(e) { |
24 | this.snackbar = { | 24 | this.snackbar = { |
25 | show: true, | 25 | show: true, |
26 | color: 'green', | 26 | color: 'green', |
27 | text: 'Logout successfully.' | 27 | text: 'Logout successfully.' |
28 | }; | 28 | }; |
29 | this.$router.replace({ | 29 | this.$router.replace({ |
30 | path: '/' | 30 | path: '/' |
31 | }); | 31 | }); |
32 | } | 32 | } |
33 | }, | 33 | }, |
34 | { | 34 | { |
35 | name: 'APP_PAGE_LOADED', | 35 | name: 'APP_PAGE_LOADED', |
36 | callback: function (e) { | 36 | callback: function(e) {} |
37 | } | 37 | }, |
38 | }, | 38 | { |
39 | { | 39 | name: 'APP_AUTH_FAILED', |
40 | name: 'APP_AUTH_FAILED', | 40 | callback: function(e) { |
41 | callback: function (e) { | 41 | this.$router.push('/login'); |
42 | this.$router.push('/login'); | 42 | this.$message.error('Token has expired'); |
43 | this.$message.error('Token has expired'); | 43 | } |
44 | } | 44 | }, |
45 | }, | 45 | { |
46 | { | 46 | name: 'APP_BAD_REQUEST', |
47 | name: 'APP_BAD_REQUEST', | 47 | // @error api response data |
48 | // @error api response data | 48 | callback: function(msg) { |
49 | callback: function (msg) { | 49 | this.$message.error(msg); |
50 | this.$message.error(msg); | 50 | } |
51 | } | 51 | }, |
52 | }, | 52 | { |
53 | { | 53 | name: 'APP_ACCESS_DENIED', |
54 | name: 'APP_ACCESS_DENIED', | 54 | // @error api response data |
55 | // @error api response data | 55 | callback: function(msg) { |
56 | callback: function (msg) { | 56 | this.$message.error(msg); |
57 | this.$message.error(msg); | 57 | this.$router.push('/forbidden'); |
58 | this.$router.push('/forbidden'); | 58 | } |
59 | } | 59 | }, |
60 | }, | 60 | { |
61 | { | 61 | name: 'APP_RESOURCE_DELETED', |
62 | name: 'APP_RESOURCE_DELETED', | 62 | // @error api response data |
63 | // @error api response data | 63 | callback: function(msg) { |
64 | callback: function (msg) { | 64 | this.$message.success(msg); |
65 | this.$message.success(msg); | 65 | } |
66 | } | 66 | }, |
67 | }, | 67 | { |
68 | { | 68 | name: 'APP_RESOURCE_UPDATED', |
69 | name: 'APP_RESOURCE_UPDATED', | 69 | // @error api response data |
70 | // @error api response data | 70 | callback: function(msg) { |
71 | callback: function (msg) { | 71 | this.$message.success(msg); |
72 | this.$message.success(msg); | 72 | } |
73 | } | 73 | }, |
74 | }, | ||
75 | 74 | ||
76 | ]; | 75 | ]; |
76 |
src/pages/Attendence/viewStudentsAttendence.vue
1 | <template> | 1 | <template> |
2 | <v-container fluid grid-list-md> | 2 | <v-container fluid grid-list-md> |
3 | <div v-show="hideData"> | 3 | <div v-show="hideData"> |
4 | <v-layout row> | 4 | <v-layout row> |
5 | <v-btn color="grey" @click="exportPdf" class="right" dark> | 5 | <v-btn color="grey" @click="exportPdf" class="right" dark> |
6 | Export Pdf | 6 | Export Pdf |
7 | <v-icon dark right size="20">save_alt</v-icon> | 7 | <v-icon dark right size="20">save_alt</v-icon> |
8 | </v-btn> | 8 | </v-btn> |
9 | <v-dialog v-model="dialogExport" max-width="500px"> | 9 | <v-dialog v-model="dialogExport" max-width="500px"> |
10 | <v-btn slot="activator" color="grey" class="right" dark> | 10 | <v-btn slot="activator" color="grey" class="right" dark> |
11 | Export csv | 11 | Export csv |
12 | <v-icon dark right size="20">save_alt</v-icon> | 12 | <v-icon dark right size="20">save_alt</v-icon> |
13 | </v-btn> | 13 | </v-btn> |
14 | <v-card> | 14 | <v-card> |
15 | <h3 class="text-xs-center py-2 grey lighten-1 white--text">Export</h3> | 15 | <h3 class="text-xs-center py-2 grey lighten-1 white--text">Export</h3> |
16 | <v-card-text> | 16 | <v-card-text> |
17 | <v-container grid-list-md> | 17 | <v-container grid-list-md> |
18 | <v-layout wrap> | 18 | <v-layout wrap> |
19 | <v-flex xs12> | 19 | <v-flex xs12> |
20 | <v-menu | 20 | <v-menu |
21 | ref="menuStartDate" | 21 | ref="menuStartDate" |
22 | :close-on-content-click="false" | 22 | :close-on-content-click="false" |
23 | v-model="menuStartDate" | 23 | v-model="menuStartDate" |
24 | :nudge-right="40" | 24 | :nudge-right="40" |
25 | :return-value.sync="startDate" | 25 | :return-value.sync="startDate" |
26 | lazy | 26 | lazy |
27 | transition="scale-transition" | 27 | transition="scale-transition" |
28 | offset-y | 28 | offset-y |
29 | full-width | 29 | full-width |
30 | min-width="290px" | 30 | min-width="290px" |
31 | > | 31 | > |
32 | <v-text-field | 32 | <v-text-field |
33 | slot="activator" | 33 | slot="activator" |
34 | v-model="startDate" | 34 | v-model="startDate" |
35 | label="Select Start Date" | 35 | label="Select Start Date" |
36 | prepend-icon="event" | 36 | prepend-icon="event" |
37 | readonly | 37 | readonly |
38 | ></v-text-field> | 38 | ></v-text-field> |
39 | <v-date-picker | 39 | <v-date-picker |
40 | v-model="startDate" | 40 | v-model="startDate" |
41 | @input="$refs.menuStartDate.save(startDate)" | 41 | @input="$refs.menuStartDate.save(startDate)" |
42 | ></v-date-picker> | 42 | ></v-date-picker> |
43 | </v-menu> | 43 | </v-menu> |
44 | </v-flex> | 44 | </v-flex> |
45 | <v-flex xs12> | 45 | <v-flex xs12> |
46 | <v-menu | 46 | <v-menu |
47 | ref="menuEndDate" | 47 | ref="menuEndDate" |
48 | :close-on-content-click="false" | 48 | :close-on-content-click="false" |
49 | v-model="menuEndDate" | 49 | v-model="menuEndDate" |
50 | :nudge-right="40" | 50 | :nudge-right="40" |
51 | :return-value.sync="endDate" | 51 | :return-value.sync="endDate" |
52 | lazy | 52 | lazy |
53 | transition="scale-transition" | 53 | transition="scale-transition" |
54 | offset-y | 54 | offset-y |
55 | full-width | 55 | full-width |
56 | min-width="290px" | 56 | min-width="290px" |
57 | > | 57 | > |
58 | <v-text-field | 58 | <v-text-field |
59 | slot="activator" | 59 | slot="activator" |
60 | v-model="endDate" | 60 | v-model="endDate" |
61 | label="Select End Date" | 61 | label="Select End Date" |
62 | prepend-icon="event" | 62 | prepend-icon="event" |
63 | readonly | 63 | readonly |
64 | ></v-text-field> | 64 | ></v-text-field> |
65 | <v-date-picker v-model="endDate" @input="$refs.menuEndDate.save(endDate)"></v-date-picker> | 65 | <v-date-picker v-model="endDate" @input="$refs.menuEndDate.save(endDate)"></v-date-picker> |
66 | </v-menu> | 66 | </v-menu> |
67 | </v-flex> | 67 | </v-flex> |
68 | </v-layout> | 68 | </v-layout> |
69 | </v-container> | 69 | </v-container> |
70 | </v-card-text> | 70 | </v-card-text> |
71 | <v-card-actions> | 71 | <v-card-actions> |
72 | <v-spacer></v-spacer> | 72 | <v-spacer></v-spacer> |
73 | <v-btn color="blue darken-1" flat @click.native="dialogExport = false">Close</v-btn> | 73 | <v-btn color="blue darken-1" flat @click.native="dialogExport = false">Close</v-btn> |
74 | <download-csv :data="json_data"> | 74 | <download-csv :data="json_data"> |
75 | <v-btn color="blue darken-1" flat @click.native="exportData">Export</v-btn> | 75 | <v-btn color="blue darken-1" flat @click.native="exportData">Export</v-btn> |
76 | </download-csv> | 76 | </download-csv> |
77 | </v-card-actions> | 77 | </v-card-actions> |
78 | </v-card> | 78 | </v-card> |
79 | </v-dialog> | 79 | </v-dialog> |
80 | </v-layout> | 80 | </v-layout> |
81 | <v-layout wrap> | 81 | <v-layout wrap> |
82 | <v-flex xs12 sm12 md4> | 82 | <v-flex xs12 sm12 md4> |
83 | <v-card flat> | 83 | <v-card flat> |
84 | <h3 class="text-xs-center py-2 grey lighten-1 white--text">Profile</h3> | 84 | <h3 class="text-xs-center py-2 grey lighten-1 white--text">Profile</h3> |
85 | <v-card-text> | 85 | <v-card-text> |
86 | <v-container> | 86 | <v-container> |
87 | <v-layout wrap> | 87 | <v-layout wrap> |
88 | <v-flex xs12> | 88 | <v-flex xs12> |
89 | <v-layout> | 89 | <v-layout> |
90 | <v-flex | 90 | <v-flex |
91 | xs12 | 91 | xs12 |
92 | class="text-xs-center text-sm-center text-md-center text-lg-center" | 92 | class="text-xs-center text-sm-center text-md-center text-lg-center" |
93 | > | 93 | > |
94 | <v-avatar size="160px"> | 94 | <v-avatar size="160px"> |
95 | <img src="/static/icon/user.png" v-if="!studentData.profilePicUrl" /> | 95 | <img src="/static/icon/user.png" v-if="!studentData.profilePicUrl" /> |
96 | <img | 96 | <img |
97 | :src="studentData.profilePicUrl" | 97 | :src="studentData.profilePicUrl" |
98 | v-else-if="studentData.profilePicUrl" | 98 | v-else-if="studentData.profilePicUrl" |
99 | /> | 99 | /> |
100 | </v-avatar> | 100 | </v-avatar> |
101 | </v-flex> | 101 | </v-flex> |
102 | </v-layout> | 102 | </v-layout> |
103 | <v-layout> | 103 | <v-layout> |
104 | <v-flex xs12 sm12> | 104 | <v-flex xs12 sm12> |
105 | <h3 class="text-xs-center"> | 105 | <h3 class="text-xs-center"> |
106 | <b>{{ studentData.name }}</b> | 106 | <b>{{ studentData.name }}</b> |
107 | </h3> | 107 | </h3> |
108 | <p class="text-xs-center grey--text">Student</p> | 108 | <p class="text-xs-center grey--text">Student</p> |
109 | </v-flex> | 109 | </v-flex> |
110 | </v-layout> | 110 | </v-layout> |
111 | <v-layout style="border: 1px solid lightgrey;"> | 111 | <v-layout style="border: 1px solid lightgrey;"> |
112 | <v-flex xs6 sm6 class="pa-0"> | 112 | <v-flex xs6 sm6 class="pa-0"> |
113 | <h4 class="right"> | 113 | <h4 class="right"> |
114 | <b>Roll No :</b> | 114 | <b>Roll No :</b> |
115 | </h4> | 115 | </h4> |
116 | </v-flex> | 116 | </v-flex> |
117 | <v-flex sm6 xs6 class="pa-0"> | 117 | <v-flex sm6 xs6 class="pa-0"> |
118 | <h4>{{ studentData.rollNo }}</h4> | 118 | <h4>{{ studentData.rollNo }}</h4> |
119 | </v-flex> | 119 | </v-flex> |
120 | </v-layout> | 120 | </v-layout> |
121 | <v-layout style="border: 1px solid lightgrey;"> | 121 | <v-layout style="border: 1px solid lightgrey;"> |
122 | <v-flex xs6 sm6 class="pa-0"> | 122 | <v-flex xs6 sm6 class="pa-0"> |
123 | <h4 class="right"> | 123 | <h4 class="right"> |
124 | <b>Class :</b> | 124 | <b>Class :</b> |
125 | </h4> | 125 | </h4> |
126 | </v-flex> | 126 | </v-flex> |
127 | <v-flex sm6 xs6 class="right pa-0"> | 127 | <v-flex sm6 xs6 class="right pa-0"> |
128 | <h4>{{ studentData.classId.classNum }}</h4> | 128 | <h4>{{ studentData.classId.classNum }}</h4> |
129 | </v-flex> | 129 | </v-flex> |
130 | </v-layout> | 130 | </v-layout> |
131 | <v-layout style="border: 1px solid lightgrey;"> | 131 | <v-layout style="border: 1px solid lightgrey;"> |
132 | <v-flex xs6 sm6 class="right pa-0"> | 132 | <v-flex xs6 sm6 class="right pa-0"> |
133 | <h4 class="right"> | 133 | <h4 class="right"> |
134 | <b>Section :</b> | 134 | <b>Section :</b> |
135 | </h4> | 135 | </h4> |
136 | </v-flex> | 136 | </v-flex> |
137 | <v-flex sm6 xs6 class="right pa-0"> | 137 | <v-flex sm6 xs6 class="right pa-0"> |
138 | <h4>{{ studentData.sectionId.name}}</h4> | 138 | <h4>{{ studentData.sectionId.name}}</h4> |
139 | </v-flex> | 139 | </v-flex> |
140 | </v-layout> | 140 | </v-layout> |
141 | </v-flex> | 141 | </v-flex> |
142 | </v-layout> | 142 | </v-layout> |
143 | </v-container> | 143 | </v-container> |
144 | </v-card-text> | 144 | </v-card-text> |
145 | </v-card> | 145 | </v-card> |
146 | </v-flex> | 146 | </v-flex> |
147 | <v-flex xs12 sm12 md8> | 147 | <v-flex xs12 sm12 md8> |
148 | <v-card flat> | 148 | <v-card flat> |
149 | <h3 class="py-2 text-xs-center grey lighten-1 white--text"> | 149 | <h3 class="py-2 text-xs-center grey lighten-1 white--text"> |
150 | Attendence | 150 | Attendence |
151 | <span class="ml-4"> | 151 | <span class="ml-4"> |
152 | <v-avatar class="green caption" size="12"></v-avatar> | 152 | <v-avatar class="green caption" size="12"></v-avatar> |
153 | <span class="subheading">Present</span> | 153 | <span class="subheading">Present</span> |
154 | </span> | 154 | </span> |
155 | <span class="ml-4"> | 155 | <span class="ml-4"> |
156 | <v-avatar color="red caption" size="12" class></v-avatar> | 156 | <v-avatar color="red caption" size="12" class></v-avatar> |
157 | <span class="subheading">Absent</span> | 157 | <span class="subheading">Absent</span> |
158 | </span> | 158 | </span> |
159 | </h3> | 159 | </h3> |
160 | <YearCalendar | 160 | <YearCalendar |
161 | v-model="year" | 161 | v-model="year" |
162 | :activeDates="activeDates" | 162 | :activeDates="activeDates" |
163 | prefixClass="your_customized_wrapper_class" | 163 | prefixClass="your_customized_wrapper_class" |
164 | :activeClass="activeClass" | 164 | :activeClass="activeClass" |
165 | ></YearCalendar> | 165 | ></YearCalendar> |
166 | </v-card> | 166 | </v-card> |
167 | </v-flex> | 167 | </v-flex> |
168 | </v-layout> | 168 | </v-layout> |
169 | </div> | 169 | </div> |
170 | <v-layout v-show="showPdfData"> | 170 | <v-layout v-show="showPdfData"> |
171 | <v-container> | 171 | <v-container> |
172 | <v-flex xs12 sm12 md8 offset-sm2> | 172 | <v-flex xs12 sm12 md8 offset-sm2> |
173 | <v-btn | 173 | <v-btn |
174 | color="grey" | 174 | color="grey" |
175 | @click="generatePDF2Canvas()" | 175 | @click="generatePDF2Canvas()" |
176 | :loading="loadingPdf" | 176 | :loading="loadingPdf" |
177 | class="right" | 177 | class="right" |
178 | dark | 178 | dark |
179 | > | 179 | > |
180 | Download | 180 | Download |
181 | <v-icon dark right size="20">save_alt</v-icon> | 181 | <v-icon dark right size="20">save_alt</v-icon> |
182 | </v-btn> | 182 | </v-btn> |
183 | </v-flex> | 183 | </v-flex> |
184 | </v-container> | 184 | </v-container> |
185 | </v-layout> | 185 | </v-layout> |
186 | <v-layout v-show="showPdfData"> | 186 | <v-layout v-show="showPdfData"> |
187 | <v-container> | 187 | <v-container> |
188 | <v-layout v-show="showPdfData"> | 188 | <v-layout v-show="showPdfData"> |
189 | <v-flex xs12 sm12 md8 offset-sm2> | 189 | <v-flex xs12 sm12 md8 offset-sm2> |
190 | <div ref="printMe"> | 190 | <div ref="printMe"> |
191 | <v-flex xs12 class="pl-3"> | 191 | <v-flex xs12 class="pl-3"> |
192 | <v-layout> | 192 | <v-layout> |
193 | <v-flex xs6 sm2 class="pa-0 mb-1"> | 193 | <v-flex xs6 sm2 class="pa-0 mb-1"> |
194 | <h4> | 194 | <h4> |
195 | <b>Name</b> | 195 | <b>Name</b> |
196 | </h4> | 196 | </h4> |
197 | </v-flex> | 197 | </v-flex> |
198 | <v-flex sm10 xs6 class="pa-0"> | 198 | <v-flex sm10 xs6 class="pa-0"> |
199 | <h4>: {{ studentData.name }}</h4> | 199 | <h4>: {{ studentData.name }}</h4> |
200 | </v-flex> | 200 | </v-flex> |
201 | </v-layout> | 201 | </v-layout> |
202 | <v-layout> | 202 | <v-layout> |
203 | <v-flex xs6 sm2 class="pa-0 mb-1"> | 203 | <v-flex xs6 sm2 class="pa-0 mb-1"> |
204 | <h4> | 204 | <h4> |
205 | <b>Type</b> | 205 | <b>Type</b> |
206 | </h4> | 206 | </h4> |
207 | </v-flex> | 207 | </v-flex> |
208 | <v-flex sm10 xs6 class="pa-0 mb-1"> | 208 | <v-flex sm10 xs6 class="pa-0 mb-1"> |
209 | <h4>: Student</h4> | 209 | <h4>: Student</h4> |
210 | </v-flex> | 210 | </v-flex> |
211 | </v-layout> | 211 | </v-layout> |
212 | <v-layout> | 212 | <v-layout> |
213 | <v-flex xs6 sm2 class="pa-0 mb-1"> | 213 | <v-flex xs6 sm2 class="pa-0 mb-1"> |
214 | <h4> | 214 | <h4> |
215 | <b>Roll No</b> | 215 | <b>Roll No</b> |
216 | </h4> | 216 | </h4> |
217 | </v-flex> | 217 | </v-flex> |
218 | <v-flex sm10 xs6 class="pa-0 mb-1"> | 218 | <v-flex sm10 xs6 class="pa-0 mb-1"> |
219 | <h4>: {{ studentData.rollNo }}</h4> | 219 | <h4>: {{ studentData.rollNo }}</h4> |
220 | </v-flex> | 220 | </v-flex> |
221 | </v-layout> | 221 | </v-layout> |
222 | <v-layout> | 222 | <v-layout> |
223 | <v-flex xs6 sm2 class="pa-0 mb-1"> | 223 | <v-flex xs6 sm2 class="pa-0 mb-1"> |
224 | <h4> | 224 | <h4> |
225 | <b>Class</b> | 225 | <b>Class</b> |
226 | </h4> | 226 | </h4> |
227 | </v-flex> | 227 | </v-flex> |
228 | <v-flex sm10 xs6 class="pa-0 mb-1"> | 228 | <v-flex sm10 xs6 class="pa-0 mb-1"> |
229 | <h4>: {{ studentData.classId.classNum }}</h4> | 229 | <h4>: {{ studentData.classId.classNum }}</h4> |
230 | </v-flex> | 230 | </v-flex> |
231 | </v-layout> | 231 | </v-layout> |
232 | <v-layout> | 232 | <v-layout> |
233 | <v-flex xs6 sm2 class="pa-0 mb-1"> | 233 | <v-flex xs6 sm2 class="pa-0 mb-1"> |
234 | <h4> | 234 | <h4> |
235 | <b>Section</b> | 235 | <b>Section</b> |
236 | </h4> | 236 | </h4> |
237 | </v-flex> | 237 | </v-flex> |
238 | <v-flex sm10 xs6 class="pa-0 mb-3"> | 238 | <v-flex sm10 xs6 class="pa-0 mb-3"> |
239 | <h4>: {{ studentData.sectionId.name}}</h4> | 239 | <h4>: {{ studentData.sectionId.name}}</h4> |
240 | </v-flex> | 240 | </v-flex> |
241 | </v-layout> | 241 | </v-layout> |
242 | </v-flex> | 242 | </v-flex> |
243 | <v-card flat> | 243 | <v-card flat> |
244 | <h3 class="py-2 text-xs-center grey lighten-1 white--text"> | 244 | <h3 class="py-2 text-xs-center grey lighten-1 white--text"> |
245 | Attendence | 245 | Attendence |
246 | <span class="ml-4"> | 246 | <span class="ml-4"> |
247 | <v-avatar class="green caption" size="12"></v-avatar> | 247 | <v-avatar class="green caption" size="12"></v-avatar> |
248 | <span class="subheading">Present</span> | 248 | <span class="subheading">Present</span> |
249 | </span> | 249 | </span> |
250 | <span class="ml-4"> | 250 | <span class="ml-4"> |
251 | <v-avatar color="red caption" size="12" class></v-avatar> | 251 | <v-avatar color="red caption" size="12" class></v-avatar> |
252 | <span class="subheading">Absent</span> | 252 | <span class="subheading">Absent</span> |
253 | </span> | 253 | </span> |
254 | </h3> | 254 | </h3> |
255 | <YearCalendar | 255 | <YearCalendar |
256 | v-model="year" | 256 | v-model="year" |
257 | :activeDates="activeDates" | 257 | :activeDates="activeDates" |
258 | prefixClass="your_customized_wrapper_class" | 258 | prefixClass="your_customized_wrapper_class" |
259 | :activeClass="activeClass" | 259 | :activeClass="activeClass" |
260 | ></YearCalendar> | 260 | ></YearCalendar> |
261 | </v-card> | 261 | </v-card> |
262 | </div> | 262 | </div> |
263 | </v-flex> | 263 | </v-flex> |
264 | </v-layout> | 264 | </v-layout> |
265 | </v-container> | 265 | </v-container> |
266 | </v-layout> | 266 | </v-layout> |
267 | <img :src="output" v-show="false"/> | 267 | <img :src="output" v-show="false"/> |
268 | <div class="loader" v-if="showLoader"> | 268 | <div class="loader" v-if="showLoader"> |
269 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 269 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
270 | </div> | 270 | </div> |
271 | </v-container> | 271 | </v-container> |
272 | </template> | 272 | </template> |
273 | 273 | ||
274 | <script lang="js"> | 274 | <script lang="js"> |
275 | import moment from "moment"; | 275 | import moment from "moment"; |
276 | import http from "@/Services/http.js"; | 276 | import http from "@/Services/http.js"; |
277 | import YearCalendar from "vue-material-year-calendar"; | 277 | import YearCalendar from "vue-material-year-calendar"; |
278 | import jsPDF from 'jspdf'; | 278 | import jsPDF from 'jspdf'; |
279 | // eslint-disable-next-line | 279 | // eslint-disable-next-line |
280 | import autoTable from 'jspdf-autotable'; | 280 | import autoTable from 'jspdf-autotable'; |
281 | 281 | ||
282 | export default { | 282 | export default { |
283 | components: { YearCalendar }, | 283 | components: { YearCalendar }, |
284 | data() { | 284 | data() { |
285 | return { | 285 | return { |
286 | showPdfData:false, | 286 | showPdfData:false, |
287 | hideData:true, | 287 | hideData:true, |
288 | loadingPdf:false, | 288 | loadingPdf:false, |
289 | output:null, | 289 | output:null, |
290 | studentsList: [], | 290 | studentsList: [], |
291 | json_data: [], | 291 | json_data: [], |
292 | dialogExport: false, | 292 | dialogExport: false, |
293 | startDate: "", | 293 | startDate: "", |
294 | endDate: "", | 294 | endDate: "", |
295 | menuEndDate: false, | 295 | menuEndDate: false, |
296 | menuStartDate: false, | 296 | menuStartDate: false, |
297 | showLoader: false, | 297 | showLoader: false, |
298 | token: "", | 298 | token: "", |
299 | year: new Date().getFullYear(), | 299 | year: new Date().getFullYear(), |
300 | activeDates: [], | 300 | activeDates: [], |
301 | activeClass: "", | 301 | activeClass: "", |
302 | studentData: {} | 302 | studentData: {} |
303 | }; | 303 | }; |
304 | }, | 304 | }, |
305 | mounted() { | 305 | mounted() { |
306 | this.token = this.$store.state.token; | 306 | this.token = this.$store.state.token; |
307 | this.getStudentAttendence(); | 307 | this.getStudentAttendence(); |
308 | this.getStudentData(); | 308 | this.getStudentData(); |
309 | }, | 309 | }, |
310 | methods: { | 310 | methods: { |
311 | dates: function(date) { | 311 | dates: function(date) { |
312 | return moment(date).format("MMMM DD, YYYY"); | 312 | return moment(date).format("MMMM DD, YYYY"); |
313 | }, | 313 | }, |
314 | getStudentAttendence() { | 314 | getStudentAttendence() { |
315 | this.showLoader = true; | 315 | this.showLoader = true; |
316 | http() | 316 | http() |
317 | .get( | 317 | .get( |
318 | "/studentAttendance", | 318 | "/studentAttendance", |
319 | { params: { studentId: this.$route.params.id } }, | 319 | { params: { studentId: this.$route.params.id } }, |
320 | { | 320 | { |
321 | headers: { Authorization: "Bearer " + this.token } | 321 | headers: { Authorization: "Bearer " + this.token } |
322 | } | 322 | } |
323 | ) | 323 | ) |
324 | .then(response => { | 324 | .then(response => { |
325 | this.showLoader = false; | 325 | this.showLoader = false; |
326 | let array = []; | 326 | let array = []; |
327 | for (let i = 0; i < response.data.data.length; i++) { | 327 | for (let i = 0; i < response.data.data.length; i++) { |
328 | if (response.data.data[i].students[0].isPresent == true) { | 328 | if (response.data.data[i].students[0].isPresent == true) { |
329 | array.push({ | 329 | array.push({ |
330 | date: response.data.data[i].date, | 330 | date: response.data.data[i].date, |
331 | className: "green" | 331 | className: "green" |
332 | }); | 332 | }); |
333 | } else if (response.data.data[i].students[0].isPresent == false) { | 333 | } else if (response.data.data[i].students[0].isPresent == false) { |
334 | array.push({ | 334 | array.push({ |
335 | date: response.data.data[i].date, | 335 | date: response.data.data[i].date, |
336 | className: "red" | 336 | className: "red" |
337 | }); | 337 | }); |
338 | } | 338 | } |
339 | } | 339 | } |
340 | this.activeDates = array; | 340 | this.activeDates = array; |
341 | }) | 341 | }) |
342 | .catch(error => { | 342 | .catch(error => { |
343 | console.log("err====>", err); | 343 | console.log("err====>", err); |
344 | this.showLoader = false; | 344 | this.showLoader = false; |
345 | if (error.response.status === 401) { | 345 | if (error.response.status === 401) { |
346 | this.$router.replace({ path: "/" }); | 346 | this.$router.replace({ path: "/" }); |
347 | this.$store.dispatch("setToken", null); | 347 | this.$store.dispatch("setToken", null); |
348 | this.$store.dispatch("Id", null); | 348 | this.$store.dispatch("Id", null); |
349 | } | 349 | } |
350 | }); | 350 | }); |
351 | }, | 351 | }, |
352 | getStudentData() { | 352 | getStudentData() { |
353 | http() | 353 | http() |
354 | .get( | 354 | .get( |
355 | "/getParticularStudentDetail", | 355 | "/getParticularStudentDetail", |
356 | { params: { studentId: this.$route.params.id } }, | 356 | { params: { studentId: this.$route.params.id } }, |
357 | { | 357 | { |
358 | headers: { Authorization: "Bearer " + this.token } | 358 | headers: { Authorization: "Bearer " + this.token } |
359 | } | 359 | } |
360 | ) | 360 | ) |
361 | .then(response => { | 361 | .then(response => { |
362 | this.studentData = response.data.data; | 362 | this.studentData = response.data.data; |
363 | }) | 363 | }) |
364 | .catch(err => { | 364 | .catch(err => { |
365 | console.log("err====>", err); | 365 | console.log("err====>", err); |
366 | // this.$router.replace({ path: '/' }); | 366 | // this.$router.replace({ path: '/' }); |
367 | }); | 367 | }); |
368 | }, | 368 | }, |
369 | exportData() { | 369 | exportData() { |
370 | http() | 370 | http() |
371 | .get( | 371 | .get( |
372 | "/studentAttendanceByMonth", | 372 | "/studentAttendanceByMonth", |
373 | { | 373 | { |
374 | params: { | 374 | params: { |
375 | studentId: this.$route.params.id, | 375 | studentId: this.$route.params.id, |
376 | startDate: this.startDate, | 376 | startDate: this.startDate, |
377 | endDate: this.endDate | 377 | endDate: this.endDate |
378 | } | 378 | } |
379 | }, | 379 | }, |
380 | { | 380 | { |
381 | headers: { Authorization: "Bearer " + this.token } | 381 | headers: { Authorization: "Bearer " + this.token } |
382 | } | 382 | } |
383 | ) | 383 | ) |
384 | .then(response => { | 384 | .then(response => { |
385 | this.json_data = response.data.data; | 385 | this.json_data = response.data.data; |
386 | this.dialogExport = true; | 386 | this.dialogExport = true; |
387 | }) | 387 | }) |
388 | .catch(err => { | 388 | .catch(err => { |
389 | console.log("err====>", err); | 389 | console.log("err====>", err); |
390 | // this.$router.replace({ path: '/' }); | 390 | // this.$router.replace({ path: '/' }); |
391 | }); | 391 | }); |
392 | }, | 392 | }, |
393 | exportPdf(){ | 393 | exportPdf(){ |
394 | this.hideData = false; | 394 | this.hideData = false; |
395 | this.showPdfData = true | 395 | this.showPdfData = true |
396 | }, | 396 | }, |
397 | async generatePDF2Canvas(){ | 397 | async generatePDF2Canvas(){ |
398 | this.loadingPdf = true | 398 | this.loadingPdf = true |
399 | const el = this.$refs.printMe; | 399 | const el = this.$refs.printMe; |
400 | // add option type to get the image version | 400 | // add option type to get the image version |
401 | // if not provided the promise will return | 401 | // if not provided the promise will return |
402 | // the canvas. | 402 | // the canvas. |
403 | const options = { | 403 | const options = { |
404 | type: 'dataURL' | 404 | type: 'dataURL' |
405 | } | 405 | } |
406 | this.output = await this.$html2canvas(el, options); | 406 | this.output = await this.$html2canvas(el, options); |
407 | console.log(this.output); | 407 | console.log(this.output); |
408 | if(this.output) { | 408 | if(this.output) { |
409 | this.loadingPdf = false | 409 | this.loadingPdf = false |
410 | } | 410 | } |
411 | let doc = new jsPDF(); | 411 | let doc = new jsPDF(); |
412 | doc.addImage(this.output, 'JPEG', 5, 10, 200, 280); | 412 | doc.addImage(this.output, 'JPEG', 5, 10, 200, 280); |
413 | doc.save("export.pdf"); | 413 | doc.save("Attendance.pdf"); |
414 | } | 414 | } |
415 | } | 415 | } |
416 | }; | 416 | }; |
417 | </script> | 417 | </script> |
418 | 418 | ||
419 | <style lang="stylus"> | 419 | <style lang="stylus"> |
420 | .your_customized_wrapper_class { | 420 | .your_customized_wrapper_class { |
421 | background-color: #0aa; | 421 | background-color: #0aa; |
422 | color: white; | 422 | color: white; |
423 | 423 | ||
424 | &.red { | 424 | &.red { |
425 | background-color: red; | 425 | background-color: red; |
426 | color: white; | 426 | color: white; |
427 | 427 | ||
428 | &:after { | 428 | &:after { |
429 | background-size: 100% 100%; | 429 | background-size: 100% 100%; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | &.blue { | 433 | &.blue { |
434 | background-color: #0000aa; | 434 | background-color: #0000aa; |
435 | color: white; | 435 | color: white; |
436 | } | 436 | } |
437 | 437 | ||
438 | &.your_customized_classname { | 438 | &.your_customized_classname { |
439 | background-color: yellow; | 439 | background-color: yellow; |
440 | color: black; | 440 | color: black; |
441 | } | 441 | } |
442 | } | 442 | } |
443 | </style> | 443 | </style> |
src/pages/Authentication/Login.vue
1 | <template> | 1 | <template> |
2 | <v-app id="login"> | 2 | <v-app id="login"> |
3 | <v-toolbar class="fixcolors"> | 3 | <v-toolbar class="fixcolors"> |
4 | <v-toolbar-items> | 4 | <v-toolbar-items> |
5 | <img src="/static/logoIntrack.png" height="40" width="140" alt="logo" /> | 5 | <img src="/static/logoIntrack.png" height="40" width="140" alt="logo" /> |
6 | <!-- <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> --> | 6 | <!-- <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> --> |
7 | </v-toolbar-items> | 7 | </v-toolbar-items> |
8 | </v-toolbar> | 8 | </v-toolbar> |
9 | <v-content> | 9 | <v-content> |
10 | <v-container fluid fill-height> | 10 | <v-container fluid fill-height> |
11 | <v-snackbar | 11 | <v-snackbar |
12 | :timeout="timeout" | 12 | :timeout="timeout" |
13 | :top="y === 'top'" | 13 | :top="y === 'top'" |
14 | :right="x === 'right'" | 14 | :right="x === 'right'" |
15 | :vertical="mode === 'vertical'" | 15 | :vertical="mode === 'vertical'" |
16 | v-model="snackbar" | 16 | v-model="snackbar" |
17 | :color="color" | 17 | :color="color" |
18 | >{{ text }}</v-snackbar> | 18 | >{{ text }}</v-snackbar> |
19 | <v-layout align-center justify-center> | 19 | <v-layout align-center justify-center> |
20 | <v-flex xs12 sm10 md6 lg4> | 20 | <v-flex xs12 sm10 md6 lg4> |
21 | <v-toolbar class="fixcolors" dark> | 21 | <v-toolbar class="fixcolors" dark> |
22 | <v-spacer></v-spacer> | 22 | <v-spacer></v-spacer> |
23 | <v-toolbar-title>School Login</v-toolbar-title> | 23 | <v-toolbar-title>School Login</v-toolbar-title> |
24 | <v-spacer></v-spacer> | 24 | <v-spacer></v-spacer> |
25 | </v-toolbar> | 25 | </v-toolbar> |
26 | 26 | ||
27 | <v-card class="elevation-1 pa-1"> | 27 | <v-card class="elevation-1 pa-1"> |
28 | <v-card-text> | 28 | <v-card-text> |
29 | <v-flex xs12 sm12 md12 lg12> | 29 | <v-flex xs12 sm12 md12 lg12> |
30 | <v-form ref="form" v-model="valid" lazy-validation> | 30 | <v-form ref="form" v-model="valid" lazy-validation> |
31 | <v-text-field | 31 | <v-text-field |
32 | v-model="userLogincredentials.email" | 32 | v-model="userLogincredentials.email" |
33 | :rules="nameRules" | 33 | :rules="nameRules" |
34 | label="Username" | 34 | label="Username" |
35 | required | 35 | required |
36 | ></v-text-field> | 36 | ></v-text-field> |
37 | <v-text-field | 37 | <v-text-field |
38 | :rules="[rules.required]" | 38 | :rules="[rules.required]" |
39 | v-model="userLogincredentials.password" | 39 | v-model="userLogincredentials.password" |
40 | :append-icon="e1 ? 'visibility_off' : 'visibility'" | 40 | :append-icon="e1 ? 'visibility_off' : 'visibility'" |
41 | :append-icon-cb="() => (e1 = !e1)" | 41 | :append-icon-cb="() => (e1 = !e1)" |
42 | :type="e1 ? 'password' : 'text'" | 42 | :type="e1 ? 'password' : 'text'" |
43 | name="input-10-1" | 43 | name="input-10-1" |
44 | label="Password" | 44 | label="Password" |
45 | @keyup.enter="login" | 45 | @keyup.enter="login" |
46 | counter | 46 | counter |
47 | ></v-text-field> | 47 | ></v-text-field> |
48 | </v-form> | 48 | </v-form> |
49 | <v-layout row wrap> | 49 | <v-layout row wrap> |
50 | <v-flex xs6> | 50 | <v-flex xs6> |
51 | <!-- <v-checkbox :label="`Remember me`" v-model="remember"></v-checkbox> --> | 51 | <!-- <v-checkbox :label="`Remember me`" v-model="remember"></v-checkbox> --> |
52 | </v-flex> | 52 | </v-flex> |
53 | <v-flex xs6> | 53 | <v-flex xs6> |
54 | <h5 class="right mt-4"> | 54 | <h5 class="right mt-4"> |
55 | <router-link | 55 | <router-link |
56 | class="link" | 56 | class="link" |
57 | to="/forgetpassword" | 57 | to="/forgetpassword" |
58 | style="border-bottom: 2px solid #aaa;" | 58 | style="border-bottom: 2px solid #aaa;" |
59 | >Forgot Password</router-link> | 59 | >Forgot Password</router-link> |
60 | </h5> | 60 | </h5> |
61 | </v-flex> | 61 | </v-flex> |
62 | </v-layout> | 62 | </v-layout> |
63 | </v-flex> | 63 | </v-flex> |
64 | </v-card-text> | 64 | </v-card-text> |
65 | <v-layout> | 65 | <v-layout> |
66 | <v-flex sm12 class="my-3"> | 66 | <v-flex sm12 class="my-3"> |
67 | <v-btn | 67 | <v-btn |
68 | style="margin: auto;display: block;b" | 68 | style="margin: auto;display: block;b" |
69 | class="fixcolors" | 69 | class="fixcolors" |
70 | round | 70 | round |
71 | dark | 71 | dark |
72 | large | 72 | large |
73 | @click="login" | 73 | @click="login" |
74 | :loading="loading" | 74 | :loading="loading" |
75 | >Login</v-btn> | 75 | >Login</v-btn> |
76 | </v-flex> | 76 | </v-flex> |
77 | </v-layout> | 77 | </v-layout> |
78 | <v-layout></v-layout> | 78 | <v-layout></v-layout> |
79 | </v-card> | 79 | </v-card> |
80 | </v-flex> | 80 | </v-flex> |
81 | </v-layout> | 81 | </v-layout> |
82 | </v-container> | 82 | </v-container> |
83 | </v-content> | 83 | </v-content> |
84 | <v-footer class="pa-4 fixcolors"></v-footer> | 84 | <v-footer class="pa-4 fixcolors"></v-footer> |
85 | </v-app> | 85 | </v-app> |
86 | </template> | 86 | </template> |
87 | 87 | ||
88 | <script> | 88 | <script> |
89 | import http from "@/Services/http.js"; | 89 | import http from "@/Services/http.js"; |
90 | export default { | 90 | export default { |
91 | data() { | 91 | data() { |
92 | return { | 92 | return { |
93 | snackbar: false, | 93 | snackbar: false, |
94 | y: "top", | 94 | y: "top", |
95 | x: "right", | 95 | x: "right", |
96 | mode: "", | 96 | mode: "", |
97 | timeout: 3000, | 97 | timeout: 3000, |
98 | text: "", | 98 | text: "", |
99 | e1: true, | 99 | e1: true, |
100 | loading: false, | 100 | loading: false, |
101 | remember: false, | 101 | remember: false, |
102 | valid: false, | 102 | valid: false, |
103 | userLogincredentials: {}, | 103 | userLogincredentials: {}, |
104 | nameRules: [v => !!v || "Username is required"], | 104 | nameRules: [v => !!v || "Username is required"], |
105 | password: "", | 105 | password: "", |
106 | email: "", | 106 | email: "", |
107 | rules: { | 107 | rules: { |
108 | required: value => !!value || "password is Required." | 108 | required: value => !!value || "password is Required." |
109 | } | 109 | } |
110 | }; | 110 | }; |
111 | }, | 111 | }, |
112 | methods: { | 112 | methods: { |
113 | login() { | 113 | login() { |
114 | this.loading = true; | 114 | this.loading = true; |
115 | var userdata = { | 115 | var userdata = { |
116 | email: this.userLogincredentials.email, | 116 | email: this.userLogincredentials.email, |
117 | password: this.userLogincredentials.password, | 117 | password: this.userLogincredentials.password, |
118 | role: "ADMIN" | 118 | role: "ADMIN" |
119 | }; | 119 | }; |
120 | http() | 120 | http() |
121 | .post("/schoolLogin", userdata) | 121 | .post("/schoolLogin", userdata) |
122 | .then(response => { | 122 | .then(response => { |
123 | this.$store.dispatch("setToken", response.data.data.token); | 123 | this.$store.dispatch("setToken", response.data.data.token); |
124 | this.$store.dispatch("Id", response.data.data.id); | 124 | this.$store.dispatch("Id", response.data.data.id); |
125 | this.$store.dispatch("Role", response.data.data.role); | ||
125 | this.loading = false; | 126 | this.loading = false; |
126 | this.$router.push("/dashboard"); | 127 | // console.log("{this.$store.state.state.role}",this.$store.state.role) |
128 | if (this.$store.state.role === "ADMIN") { | ||
129 | this.$router.push("/dashboard"); | ||
130 | } else if (this.$store.state.role === "SUPERADMIN") { | ||
131 | this.$router.push("/school"); | ||
132 | } | ||
127 | }) | 133 | }) |
128 | .catch(error => { | 134 | .catch(error => { |
129 | if (error) { | 135 | if (error) { |
130 | this.text = "Server appears to be offline"; | 136 | this.text = "Server appears to be offline"; |
131 | this.snackbar = true; | 137 | this.snackbar = true; |
132 | this.loading = false; | 138 | this.loading = false; |
133 | } | 139 | } |
134 | if (error.response.data.message) { | 140 | if (error.response.data.message) { |
135 | this.text = error.response.data.message; | 141 | this.text = error.response.data.message; |
136 | this.snackbar = true; | 142 | this.snackbar = true; |
137 | } | 143 | } |
138 | this.loading = false; | 144 | this.loading = false; |
139 | }); | 145 | }); |
140 | } | 146 | } |
141 | }, | 147 | }, |
142 | mounted() { | 148 | mounted() { |
143 | if (this.$store.state.isUserLoggedIn == true) { | 149 | if (this.$store.state.isUserLoggedIn == true) { |
144 | this.$router.push("/dashboard"); | 150 | this.$router.push("/dashboard"); |
145 | } | 151 | } |
146 | }, | 152 | }, |
147 | computed: { | 153 | computed: { |
148 | color() { | 154 | color() { |
149 | return this.loading ? "success" : "error"; | 155 | return this.loading ? "success" : "error"; |
150 | } | 156 | } |
151 | } | 157 | } |
152 | }; | 158 | }; |
153 | </script> | 159 | </script> |
154 | 160 | ||
155 | <style scoped lang="css"> | 161 | <style scoped lang="css"> |
156 | #login { | 162 | #login { |
157 | width: 100%; | 163 | width: 100%; |
158 | position: absolute; | 164 | position: absolute; |
159 | top: 0; | 165 | top: 0; |
160 | left: 0; | 166 | left: 0; |
161 | content: ""; | 167 | content: ""; |
162 | z-index: 0; | 168 | z-index: 0; |
163 | } | 169 | } |
164 | </style> | 170 | </style> |
165 | <style scoped> | 171 | <style scoped> |
166 | img { | 172 | img { |
167 | position: absolute; | 173 | position: absolute; |
168 | top: 13px; | 174 | top: 13px; |
169 | left: 8px; | 175 | left: 8px; |
170 | } | 176 | } |
171 | .v-btn--large { | 177 | .v-btn--large { |
172 | padding: 0px 84px; | 178 | padding: 0px 84px; |
173 | } | 179 | } |
174 | .link { | 180 | .link { |
175 | text-decoration: none; | 181 | text-decoration: none; |
176 | } | 182 | } |
177 | a { | 183 | a { |
178 | color: #696969; | 184 | color: #696969; |
179 | } | 185 | } |
180 | .forget { | 186 | .forget { |
181 | margin-top: 20px; | 187 | margin-top: 20px; |
182 | } | 188 | } |
183 | .mt-4 { | 189 | .mt-4 { |
184 | margin-top: 21px !important; | 190 | margin-top: 21px !important; |
185 | } | 191 | } |
186 | @media screen and (max-width: 600px) { | 192 | @media screen and (max-width: 600px) { |
187 | .forget { | 193 | .forget { |
188 | margin-top: none; | 194 | margin-top: none; |
189 | margin-left: 18px; | 195 | margin-left: 18px; |
190 | } | 196 | } |
191 | img { | 197 | img { |
192 | left: 10px; | 198 | left: 10px; |
193 | height: 34px; | 199 | height: 34px; |
194 | width: 120px; | 200 | width: 120px; |
195 | } | 201 | } |
196 | .logoSchool { | 202 | .logoSchool { |
197 | font-size: 18px; | 203 | font-size: 18px; |
198 | margin-top: 20px !important; | 204 | margin-top: 20px !important; |
199 | } | 205 | } |
200 | h5 { | 206 | h5 { |
201 | font-size: 14px !important; | 207 | font-size: 14px !important; |
202 | } | 208 | } |
203 | } | 209 | } |
204 | </style> | 210 | </style> |
src/pages/Mark/viewMark.vue
1 | <template> | 1 | <template> |
2 | <v-app id="pages-dasboard"> | 2 | <v-app id="pages-dasboard"> |
3 | <!-- ****** PROFILE MARK ****** --> | 3 | <!-- ****** PROFILE MARK ****** --> |
4 | <v-container fluid grid-list-md> | 4 | <v-container fluid grid-list-md> |
5 | <v-layout> | 5 | <v-layout> |
6 | <v-flex xs12 sm12> | 6 | <v-flex xs12 sm12> |
7 | <v-btn class="grey" dark @click="print()"> | 7 | <v-btn class="grey" dark @click="print()"> |
8 | 8 | ||
9 | <v-icon right dark>print</v-icon> | 9 | <v-icon right dark>print</v-icon> |
10 | </v-btn> | 10 | </v-btn> |
11 | </v-flex> | 11 | </v-flex> |
12 | </v-layout> | 12 | </v-layout> |
13 | <v-flex xs12 sm12 id="printMe"> | 13 | <v-flex xs12 sm12 id="printMe"> |
14 | <v-layout wrap> | 14 | <v-layout wrap> |
15 | <v-flex xs12 sm12 md3> | 15 | <v-flex xs12 sm12 md3> |
16 | <v-card class="fixcolors white--text" flat> | 16 | <v-card class="fixcolors white--text" flat> |
17 | <v-card-actions class="pa-0"> | 17 | <v-card-actions class="pa-0"> |
18 | <v-spacer></v-spacer> | 18 | <v-spacer></v-spacer> |
19 | <v-card-title class="pa-2"> | 19 | <v-card-title class="pa-2"> |
20 | <h3>Profile</h3> | 20 | <h3>Profile</h3> |
21 | </v-card-title> | 21 | </v-card-title> |
22 | <v-spacer></v-spacer> | 22 | <v-spacer></v-spacer> |
23 | </v-card-actions> | 23 | </v-card-actions> |
24 | </v-card> | 24 | </v-card> |
25 | <v-card flat> | 25 | <v-card flat> |
26 | <v-layout | 26 | <v-layout |
27 | wrap | 27 | wrap |
28 | v-for="(value, id, index) in filterData" | 28 | v-for="(value, id, index) in filterData" |
29 | v-if="index == 0" | 29 | v-if="index == 0" |
30 | :key="index" | 30 | :key="index" |
31 | > | 31 | > |
32 | <v-flex xs12 style="margin:16px;"> | 32 | <v-flex xs12 style="margin:16px;"> |
33 | <v-layout> | 33 | <v-layout> |
34 | <v-flex xs12> | 34 | <v-flex xs12> |
35 | <v-avatar | 35 | <v-avatar |
36 | size="100px" | 36 | size="100px" |
37 | class="mx-auto" | 37 | class="mx-auto" |
38 | style="margin: auto;display:block;margin-bottom:10px !important" | 38 | style="margin: auto;display:block;margin-bottom:10px !important" |
39 | > | 39 | > |
40 | <img src="/static/icon/user.png" v-if="!value[0].studentId.profilePicUrl" /> | 40 | <img src="/static/icon/user.png" v-if="!value[0].studentId.profilePicUrl" /> |
41 | <img | 41 | <img |
42 | :src="value[0].studentId.profilePicUrl" | 42 | :src="value[0].studentId.profilePicUrl" |
43 | v-else-if="value[0].studentId.profilePicUrl" | 43 | v-else-if="value[0].studentId.profilePicUrl" |
44 | /> | 44 | /> |
45 | </v-avatar> | 45 | </v-avatar> |
46 | </v-flex> | 46 | </v-flex> |
47 | </v-layout> | 47 | </v-layout> |
48 | <v-layout> | 48 | <v-layout> |
49 | <v-flex xs12 style="text-align:center;"> | 49 | <v-flex xs12 style="text-align:center;"> |
50 | <h3> | 50 | <h3> |
51 | <b>{{ value[0].studentId.name }}</b> | 51 | <b>{{ value[0].studentId.name }}</b> |
52 | </h3> | 52 | </h3> |
53 | <p class="grey--text">Student</p> | 53 | <p class="grey--text">Student</p> |
54 | </v-flex> | 54 | </v-flex> |
55 | </v-layout> | 55 | </v-layout> |
56 | <v-layout | 56 | <v-layout |
57 | style="border: 1px solid lightgrey;padding: 4px;border-top-right-radius: 4px; | 57 | style="border: 1px solid lightgrey;padding: 4px;border-top-right-radius: 4px; |
58 | border-top-left-radius: 4px;" | 58 | border-top-left-radius: 4px;" |
59 | > | 59 | > |
60 | <v-flex xs6 sm3 class="py-1"> | 60 | <v-flex xs6 sm3 class="py-1"> |
61 | <h4> | 61 | <h4> |
62 | <b>RollNo</b> | 62 | <b>RollNo</b> |
63 | </h4> | 63 | </h4> |
64 | </v-flex> | 64 | </v-flex> |
65 | <v-flex sm9 xs7 class="py-1"> | 65 | <v-flex sm9 xs7 class="py-1"> |
66 | <h4>: {{ value[0].studentId.rollNo }}</h4> | 66 | <h4>: {{ value[0].studentId.rollNo }}</h4> |
67 | </v-flex> | 67 | </v-flex> |
68 | </v-layout> | 68 | </v-layout> |
69 | <v-layout style="border: 1px solid lightgrey;padding: 4px;"> | 69 | <v-layout style="border: 1px solid lightgrey;padding: 4px;"> |
70 | <v-flex xs6 sm3 class="py-1"> | 70 | <v-flex xs6 sm3 class="py-1"> |
71 | <h4> | 71 | <h4> |
72 | <b>Class</b> | 72 | <b>Class</b> |
73 | </h4> | 73 | </h4> |
74 | </v-flex> | 74 | </v-flex> |
75 | <v-flex sm9 xs8 class="py-1"> | 75 | <v-flex sm9 xs8 class="py-1"> |
76 | <h4>: {{value[0].classId.classNum }}</h4> | 76 | <h4>: {{value[0].classId.classNum }}</h4> |
77 | </v-flex> | 77 | </v-flex> |
78 | </v-layout> | 78 | </v-layout> |
79 | <v-layout | 79 | <v-layout |
80 | style="border: 1px solid lightgrey;padding: 4px;border-bottom-right-radius: 4px; | 80 | style="border: 1px solid lightgrey;padding: 4px;border-bottom-right-radius: 4px; |
81 | border-bottom-left-radius: 4px;" | 81 | border-bottom-left-radius: 4px;" |
82 | > | 82 | > |
83 | <v-flex xs6 sm3 class> | 83 | <v-flex xs6 sm3 class> |
84 | <h4> | 84 | <h4> |
85 | <b>Section</b> | 85 | <b>Section</b> |
86 | </h4> | 86 | </h4> |
87 | </v-flex> | 87 | </v-flex> |
88 | <v-flex sm9 xs6 class> | 88 | <v-flex sm9 xs6 class> |
89 | <h4>: {{ value[0].sectionId.name}}</h4> | 89 | <h4>: {{ value[0].sectionId.name}}</h4> |
90 | </v-flex> | 90 | </v-flex> |
91 | </v-layout> | 91 | </v-layout> |
92 | </v-flex> | 92 | </v-flex> |
93 | </v-layout> | 93 | </v-layout> |
94 | <v-layout v-if="filterData"> | ||
95 | <v-flex xs12> | ||
96 | <h5 class="text-xs-center pa-3">No Data Found</h5> | ||
97 | </v-flex> | ||
98 | </v-layout> | ||
94 | </v-card> | 99 | </v-card> |
95 | </v-flex> | 100 | </v-flex> |
96 | 101 | ||
97 | <!-- ****** TABLE DATA MARK ****** --> | 102 | <!-- ****** TABLE DATA MARK ****** --> |
98 | 103 | ||
99 | <v-flex xs12 sm12 md9> | 104 | <v-flex xs12 sm12 md9> |
100 | <v-card class="fixcolors white--text" flat> | 105 | <v-card class="fixcolors white--text" flat> |
101 | <v-card-actions class="pa-0"> | 106 | <v-card-actions class="pa-0"> |
102 | <v-spacer></v-spacer> | 107 | <v-spacer></v-spacer> |
103 | <v-card-title class="pa-2"> | 108 | <v-card-title class="pa-2"> |
104 | <h3>Mark</h3> | 109 | <h3>Mark</h3> |
105 | </v-card-title> | 110 | </v-card-title> |
106 | <v-spacer></v-spacer> | 111 | <v-spacer></v-spacer> |
107 | </v-card-actions> | 112 | </v-card-actions> |
108 | </v-card> | 113 | </v-card> |
109 | <v-card | 114 | <v-card |
110 | v-for="(value, id, index) in filterData" | 115 | v-for="(value, id, index) in filterData" |
111 | :key="index" | 116 | :key="index" |
112 | flat | 117 | flat |
113 | style="border: 1px solid lightgrey;margin-bottom:14px;" | 118 | style="border: 1px solid lightgrey;margin-bottom:14px;" |
114 | > | 119 | > |
115 | <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> | 120 | <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> |
116 | <table | 121 | <table |
117 | class="mb-5 tableRsponsive feeTypeTable" | 122 | class="mb-5 tableRsponsive feeTypeTable" |
118 | style="border: 1px solid lightgrey; | 123 | style="border: 1px solid lightgrey; |
119 | border-collapse: collapse;!important | 124 | border-collapse: collapse;!important |
120 | table-layout: auto !important; | 125 | table-layout: auto !important; |
121 | width: 100% !important;" | 126 | width: 100% !important;" |
122 | > | 127 | > |
123 | <thead style="border: 1px solid lightgrey !important;"> | 128 | <thead style="border: 1px solid lightgrey !important;"> |
124 | <tr | 129 | <tr |
125 | class="info white--text" | 130 | class="info white--text" |
126 | style="border: 1px solid lightgrey !important;padding:4px;" | 131 | style="border: 1px solid lightgrey !important;padding:4px;" |
127 | > | 132 | > |
128 | <td | 133 | <td |
129 | rowspan="2" | 134 | rowspan="2" |
130 | style="border: 1px solid lightgrey !important;padding: 10px;" | 135 | style="border: 1px solid lightgrey !important;padding: 10px;" |
131 | >Subject</td> | 136 | >Subject</td> |
132 | <td | 137 | <td |
133 | colspan="2" | 138 | colspan="2" |
134 | v-for="exam in value[index].studentsMarks" | 139 | v-for="exam in value[index].studentsMarks" |
135 | style="border: 1px solid lightgrey !important;padding: 10px;" | 140 | style="border: 1px solid lightgrey !important;padding: 10px;" |
136 | >{{exam.markDistributionId.distributionType}}</td> | 141 | >{{exam.markDistributionId.distributionType}}</td> |
137 | <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> | 142 | <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> |
138 | </tr> | 143 | </tr> |
139 | <tr | 144 | <tr |
140 | v-for="(subject, ind) in value" | 145 | v-for="(subject, ind) in value" |
141 | v-if="ind == 0" | 146 | v-if="ind == 0" |
142 | style="border: 1px solid lightgrey !important;" | 147 | style="border: 1px solid lightgrey !important;" |
143 | > | 148 | > |
144 | <template v-for="(exam, i) in subject.studentsMarks"> | 149 | <template v-for="(exam, i) in subject.studentsMarks"> |
145 | <td | 150 | <td |
146 | class="bg-sky white--text" | 151 | class="bg-sky white--text" |
147 | style="border: 1px solid lightgrey !important;padding: 10px;" | 152 | style="border: 1px solid lightgrey !important;padding: 10px;" |
148 | >Mark</td> | 153 | >Mark</td> |
149 | <td | 154 | <td |
150 | class="bg-sky-light white--text" | 155 | class="bg-sky-light white--text" |
151 | style="border: 1px solid lightgrey !important;padding: 10px;" | 156 | style="border: 1px solid lightgrey !important;padding: 10px;" |
152 | >Highest Mark</td> | 157 | >Highest Mark</td> |
153 | </template> | 158 | </template> |
154 | <td | 159 | <td |
155 | class="bg-sky white--text" | 160 | class="bg-sky white--text" |
156 | style="border: 1px solid lightgrey !important;padding: 10px;" | 161 | style="border: 1px solid lightgrey !important;padding: 10px;" |
157 | >Mark</td> | 162 | >Mark</td> |
158 | </tr> | 163 | </tr> |
159 | </thead> | 164 | </thead> |
160 | <tbody style="border: 1px solid lightgrey !important;"> | 165 | <tbody style="border: 1px solid lightgrey !important;"> |
161 | <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> | 166 | <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> |
162 | <td | 167 | <td |
163 | style="border: 1px solid lightgrey !important;padding: 10px;" | 168 | style="border: 1px solid lightgrey !important;padding: 10px;" |
164 | >{{subject.subjectName}}</td> | 169 | >{{subject.subjectName}}</td> |
165 | <template v-for="(exam, i) in subject.studentsMarks"> | 170 | <template v-for="(exam, i) in subject.studentsMarks"> |
166 | <td | 171 | <td |
167 | style="border: 1px solid lightgrey !important;padding: 10px;" | 172 | style="border: 1px solid lightgrey !important;padding: 10px;" |
168 | >{{exam.marksScored}}</td> | 173 | >{{exam.marksScored}}</td> |
169 | <td | 174 | <td |
170 | style="border: 1px solid lightgrey !important;padding: 10px;" | 175 | style="border: 1px solid lightgrey !important;padding: 10px;" |
171 | >{{exam.markDistributionId.markValue}}</td> | 176 | >{{exam.markDistributionId.markValue}}</td> |
172 | </template> | 177 | </template> |
173 | <td | 178 | <td |
174 | style="border: 1px solid lightgrey !important;padding: 10px;" | 179 | style="border: 1px solid lightgrey !important;padding: 10px;" |
175 | >{{subject.totalMarks}}</td> | 180 | >{{subject.totalMarks}}</td> |
176 | </tr> | 181 | </tr> |
177 | </tbody> | 182 | </tbody> |
178 | </table> | 183 | </table> |
179 | </v-card> | 184 | </v-card> |
185 | <v-card v-if="filterData === []"> | ||
186 | <v-layout> | ||
187 | <v-flex xs12> | ||
188 | <h5 class="text-xs-center pa-3">No Data Found</h5> | ||
189 | </v-flex> | ||
190 | </v-layout> | ||
191 | </v-card> | ||
180 | </v-flex> | 192 | </v-flex> |
181 | </v-layout> | 193 | </v-layout> |
182 | </v-flex> | 194 | </v-flex> |
183 | </v-container> | 195 | </v-container> |
184 | <div class="loader" v-if="showLoader"> | 196 | <div class="loader" v-if="showLoader"> |
185 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 197 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
186 | </div> | 198 | </div> |
187 | </v-app> | 199 | </v-app> |
188 | </template> | 200 | </template> |
189 | 201 | ||
190 | <script> | 202 | <script> |
191 | import http from "@/Services/http.js"; | 203 | import http from "@/Services/http.js"; |
192 | import moment from "moment"; | 204 | import moment from "moment"; |
193 | import _ from "underscore"; | 205 | import _ from "underscore"; |
194 | 206 | ||
195 | export default { | 207 | export default { |
196 | data: () => ({ | 208 | data: () => ({ |
197 | showLoader: true, | 209 | showLoader: true, |
198 | nameShow: false, | 210 | nameShow: false, |
199 | markData: [], | 211 | markData: [], |
200 | token: "", | 212 | token: "", |
201 | markDistributions: [], | 213 | markDistributions: [], |
202 | markParticularDistributionData: [], | 214 | markParticularDistributionData: [], |
203 | filterData: [], | 215 | filterData: [], |
204 | output: null | 216 | output: null |
205 | }), | 217 | }), |
206 | mounted() { | 218 | mounted() { |
207 | this.token = this.$store.state.token; | 219 | this.token = this.$store.state.token; |
208 | this.getMarkList(); | 220 | this.getMarkList(); |
209 | }, | 221 | }, |
210 | methods: { | 222 | methods: { |
211 | getMarkList() { | 223 | getMarkList() { |
212 | this.showLoader = true; | 224 | this.showLoader = true; |
213 | http() | 225 | http() |
214 | .get("/getParticularMark", { | 226 | .get("/getParticularMark", { |
215 | params: { studentId: this.$route.params.markId }, | 227 | params: { studentId: this.$route.params.markId }, |
216 | headers: { Authorization: "Bearer " + this.token } | 228 | headers: { Authorization: "Bearer " + this.token } |
217 | }) | 229 | }) |
218 | .then(response => { | 230 | .then(response => { |
219 | let newData = response.data.data; | 231 | let newData = response.data.data; |
220 | for (var i = 0; i < newData.length; i++) { | 232 | for (var i = 0; i < newData.length; i++) { |
221 | newData[i].examination = newData[i].examId._id; | 233 | newData[i].examination = newData[i].examId._id; |
222 | } | 234 | } |
223 | this.filterData = _.groupBy(newData, ["examination"]); | 235 | this.filterData = _.groupBy(newData, ["examination"]); |
224 | console.log("check filtered data", this.filterData); | ||
225 | for (let data in this.filterData) { | 236 | for (let data in this.filterData) { |
226 | // console.log("this.filterData[data].length", this.filterData[data]); | ||
227 | for (let item in this.filterData[data]) { | 237 | for (let item in this.filterData[data]) { |
228 | // console.log("check", this.filterData[data][item].studentsMarks); | ||
229 | var totalMarks = 0; | 238 | var totalMarks = 0; |
230 | for ( | 239 | for ( |
231 | let i = 0; | 240 | let i = 0; |
232 | i < this.filterData[data][item].studentsMarks.length; | 241 | i < this.filterData[data][item].studentsMarks.length; |
233 | i++ | 242 | i++ |
234 | ) { | 243 | ) { |
235 | // console.log( | ||
236 | // "check data", | ||
237 | // this.filterData[data][item].studentsMarks[i] | ||
238 | // ); | ||
239 | totalMarks += this.filterData[data][item].studentsMarks[i] | 244 | totalMarks += this.filterData[data][item].studentsMarks[i] |
240 | .marksScored; | 245 | .marksScored; |
241 | } | 246 | } |
242 | this.filterData[data][item].totalMarks = totalMarks; | 247 | this.filterData[data][item].totalMarks = totalMarks; |
243 | } | 248 | } |
244 | } | 249 | } |
245 | // var aray = []; | 250 | // var aray = []; |
246 | // this.markData = response.data.data; | 251 | // this.markData = response.data.data; |
247 | // for (let i = 0; i < this.markData.length; i++) { | 252 | // for (let i = 0; i < this.markData.length; i++) { |
248 | // console.log(this.markData[i].examId.examName); | 253 | // console.log(this.markData[i].examId.examName); |
249 | // let index = -1; | 254 | // let index = -1; |
250 | |||
251 | // aray.forEach((dat_, k) => { | 255 | // aray.forEach((dat_, k) => { |
252 | // if (dat_.category == this.markData[i].examId.examName) { | 256 | // if (dat_.category == this.markData[i].examId.examName) { |
253 | // index = k; | 257 | // index = k; |
254 | // } | 258 | // } |
255 | // }); | 259 | // }); |
256 | // if (index == -1) { | 260 | // if (index == -1) { |
257 | // var obj = { | 261 | // var obj = { |
258 | // category: this.markData[i].examId.examName, | 262 | // category: this.markData[i].examId.examName, |
259 | // extraData: [] | 263 | // extraData: [] |
260 | // }; | 264 | // }; |
261 | // obj.extraData.push(this.markData[i]); | 265 | // obj.extraData.push(this.markData[i]); |
262 | // aray.push(obj); | 266 | // aray.push(obj); |
263 | // } else { | 267 | // } else { |
264 | // console.log("=o", this.markData[i]); | ||
265 | // // aray[index].extraData = | ||
266 | |||
267 | // aray[index].extraData.push(this.markData[i]); | 268 | // aray[index].extraData.push(this.markData[i]); |
268 | // } | 269 | // } |
269 | // console.log("aray-", aray); | ||
270 | |||
271 | // for (let j = 0; j < this.markData[i].studentsMarks.length; j++) { | ||
272 | // // console.log("this.studentsMarksSSSSSSSSSSSSS",this.markData[i].studentsMarks[j].marksObtained) | ||
273 | |||
274 | // this.markDistributions = this.markData[i].studentsMarks[ | ||
275 | // j | ||
276 | // ].marksObtained; | ||
277 | // for ( | ||
278 | // let k = 0; | ||
279 | // k < this.markData[i].studentsMarks[j].marksObtained.length; | ||
280 | // k++ | ||
281 | // ) { | ||
282 | // this.markParticularDistributionData.push( | ||
283 | // this.markData[i].studentsMarks[j].marksObtained[k].marksScored | ||
284 | // ); | ||
285 | // this.markParticularDistributionData.push( | ||
286 | // this.markData[i].studentsMarks[j].marksObtained[k] | ||
287 | // .markDistributionId.markValue | ||
288 | // ); | ||
289 | // // console.log( | ||
290 | // // "this.markParticularDistributionData", | ||
291 | // // this.markParticularDistributionData | ||
292 | // // ); | ||
293 | // } | ||
294 | // } | ||
295 | // } | ||
296 | // this.markData = aray; | ||
297 | // console.log("aray-2", aray); | ||
298 | this.showLoader = false; | 270 | this.showLoader = false; |
299 | }) | 271 | }) |
300 | .catch(error => { | 272 | .catch(error => { |
301 | // console.log("err====>", err); | 273 | // console.log("err====>", err); |
302 | this.showLoader = false; | 274 | this.showLoader = false; |
303 | this.snackbar = true; | 275 | this.snackbar = true; |
304 | this.text = error.response.data.message; | 276 | this.text = error.response.data.message; |
305 | if (error.response.status === 401) { | 277 | if (error.response.status === 401) { |
306 | this.$router.replace({ path: "/" }); | 278 | this.$router.replace({ path: "/" }); |
307 | this.$store.dispatch("setToken", null); | 279 | this.$store.dispatch("setToken", null); |
308 | this.$store.dispatch("Id", null); | 280 | this.$store.dispatch("Id", null); |
309 | } | 281 | } |
310 | }); | 282 | }); |
311 | }, | 283 | }, |
312 | print() { | 284 | print() { |
313 | // Pass the element id here | 285 | // Pass the element id here |
314 | this.$htmlToPaper("printMe"); | 286 | this.$htmlToPaper("printMe"); |
315 | } | 287 | } |
316 | } | 288 | } |
317 | }; | 289 | }; |
318 | </script> | 290 | </script> |
319 | 291 | ||
320 | <style scoped> | 292 | <style scoped> |
321 | table { | 293 | table { |
322 | border-collapse: collapse; | 294 | border-collapse: collapse; |
323 | border: 1px solid #e2e7eb; | 295 | border: 1px solid #e2e7eb; |
324 | } | 296 | } |
325 | tbody > tr > td, | ||
326 | .table-bordered { | ||
327 | border: 1px solid #ddd; | ||
328 | } | ||
329 | th, | 297 | th, |
330 | td { | 298 | td { |
331 | border: 1px solid #e2e7eb; | 299 | border: 1px solid #e2e7eb; |
332 | text-align: center; | 300 | text-align: center; |
333 | } | 301 | } |
334 | table.feeTypeTable { | 302 | table.feeTypeTable { |
335 | table-layout: auto !important; | 303 | table-layout: auto !important; |
336 | width: 100% !important; | 304 | width: 100% !important; |
337 | } | 305 | } |
338 | .bg-sky { | 306 | .bg-sky { |
339 | background-color: #98b2cc !important; | 307 | background-color: #98b2cc !important; |
340 | } | 308 | } |
341 | .bg-sky-light { | 309 | .bg-sky-light { |
342 | background-color: #89a0b8; | 310 | background-color: #89a0b8; |
343 | } | 311 | } |
344 | .bg-purple { | 312 | .bg-purple { |
345 | background-color: #9583ac; | 313 | background-color: #9583ac; |
346 | } | 314 | } |
347 | .bg-skyDark { | 315 | .bg-skyDark { |
348 | background-color: #956785; | 316 | background-color: #956785; |
349 | } | 317 | } |
350 | .loader { | 318 | .loader { |
351 | width: 100%; | 319 | width: 100%; |
352 | height: 100%; | 320 | height: 100%; |
353 | position: fixed; | 321 | position: fixed; |
354 | top: 0; | 322 | top: 0; |
355 | left: 0; | 323 | left: 0; |
356 | text-align: center; | 324 | text-align: center; |
357 | background-color: rgba(0, 0, 0, 0.5); | 325 | background-color: rgba(0, 0, 0, 0.5); |
358 | z-index: 999; | 326 | z-index: 999; |
359 | } | 327 | } |
360 | 328 | ||
361 | .loader > div { | 329 | .loader > div { |
362 | position: relative; | 330 | position: relative; |
363 | top: calc(50% - 16px); | 331 | top: calc(50% - 16px); |
364 | } | 332 | } |
365 | @media screen and (max-width: 380px) { | 333 | @media screen and (max-width: 380px) { |
366 | .tableRsponsive { | 334 | .tableRsponsive { |
367 | display: block; | 335 | display: block; |
368 | position: relative; | 336 | position: relative; |
369 | overflow: scroll; | 337 | overflow: scroll; |
370 | } | 338 | } |
371 | } | 339 | } |
372 | </style> | 340 | </style> |
373 | 341 | ||
374 | 342 | ||
375 | 343 | ||
376 | 344 | ||
377 | 345 | ||
378 | 346 |
src/pages/Report/progressCardReport.vue
1 | <template> | 1 | <template> |
2 | <v-app id="pages-dasboard"> | 2 | <v-app id="pages-dasboard"> |
3 | <!-- ****** Progress Card Report Table****** --> | 3 | <!-- ****** Progress Card Report Table****** --> |
4 | 4 | ||
5 | <v-card flat> | 5 | <v-card flat> |
6 | <v-card-actions> | 6 | <v-card-actions> |
7 | <v-layout> | 7 | <v-layout> |
8 | <h4 class="ml-2">Progress Card Report</h4> | 8 | <h4 class="ml-2">Progress Card Report</h4> |
9 | </v-layout> | 9 | </v-layout> |
10 | </v-card-actions> | 10 | </v-card-actions> |
11 | </v-card> | 11 | </v-card> |
12 | <v-card flat> | 12 | <v-card flat> |
13 | <v-form ref="form" v-model="valid" lazy-validation> | 13 | <v-form ref="form" v-model="valid" lazy-validation> |
14 | <v-flex xs12 sm12 lg12> | 14 | <v-flex xs12 sm12 lg12> |
15 | <v-layout wrap> | 15 | <v-layout wrap> |
16 | <v-flex xs12 sm12 lg3> | 16 | <v-flex xs12 sm12 lg3> |
17 | <v-layout> | 17 | <v-layout> |
18 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> | 18 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> |
19 | <label class="right">Class:</label> | 19 | <label class="right">Class:</label> |
20 | </v-flex> | 20 | </v-flex> |
21 | <v-flex xs9 sm6 lg8 class="ml-2"> | 21 | <v-flex xs9 sm6 lg8 class="ml-2"> |
22 | <v-select | 22 | <v-select |
23 | v-model="getReport.classId" | 23 | v-model="getReport.classId" |
24 | label="Select your class" | 24 | label="Select your class" |
25 | type="text" | 25 | type="text" |
26 | :items="classList" | 26 | :items="classList" |
27 | item-text="classNum" | 27 | item-text="classNum" |
28 | item-value="_id" | 28 | item-value="_id" |
29 | :rules="classRules" | 29 | :rules="classRules" |
30 | @change="getSections(getReport.classId)" | 30 | @change="getSections(getReport.classId)" |
31 | required | 31 | required |
32 | ></v-select> | 32 | ></v-select> |
33 | </v-flex> | 33 | </v-flex> |
34 | </v-layout> | 34 | </v-layout> |
35 | </v-flex> | 35 | </v-flex> |
36 | <v-flex xs12 sm12 lg3> | 36 | <v-flex xs12 sm12 lg3> |
37 | <v-layout> | 37 | <v-layout> |
38 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> | 38 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> |
39 | <label class="right">Section:</label> | 39 | <label class="right">Section:</label> |
40 | </v-flex> | 40 | </v-flex> |
41 | <v-flex xs9 sm6 lg8 class="ml-2"> | 41 | <v-flex xs9 sm6 lg8 class="ml-2"> |
42 | <v-select | 42 | <v-select |
43 | :items="addSection" | 43 | :items="addSection" |
44 | label="Select your Section" | 44 | label="Select your Section" |
45 | v-model="getReport.sectionId" | 45 | v-model="getReport.sectionId" |
46 | item-text="name" | 46 | item-text="name" |
47 | item-value="_id" | 47 | item-value="_id" |
48 | name="Select Section" | 48 | name="Select Section" |
49 | @change="getStudents" | 49 | @change="getStudents" |
50 | :rules="sectionRules" | 50 | :rules="sectionRules" |
51 | required | 51 | required |
52 | ></v-select> | 52 | ></v-select> |
53 | </v-flex> | 53 | </v-flex> |
54 | </v-layout> | 54 | </v-layout> |
55 | </v-flex> | 55 | </v-flex> |
56 | <v-flex xs12 sm12 lg3> | 56 | <v-flex xs12 sm12 lg3> |
57 | <v-layout> | 57 | <v-layout> |
58 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> | 58 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> |
59 | <label class="right">Student:</label> | 59 | <label class="right">Student:</label> |
60 | </v-flex> | 60 | </v-flex> |
61 | <v-flex xs9 sm6 lg8 class="ml-2"> | 61 | <v-flex xs9 sm6 lg8 class="ml-2"> |
62 | <v-select | 62 | <v-select |
63 | :items="getStudentsList" | 63 | :items="getStudentsList" |
64 | label="Select your student" | 64 | label="Select your student" |
65 | v-model="getReport.studentId" | 65 | v-model="getReport.studentId" |
66 | item-text="name" | 66 | item-text="name" |
67 | item-value="_id" | 67 | item-value="_id" |
68 | :rules="studentRules" | 68 | :rules="studentRules" |
69 | required | 69 | required |
70 | ></v-select> | 70 | ></v-select> |
71 | </v-flex> | 71 | </v-flex> |
72 | </v-layout> | 72 | </v-layout> |
73 | </v-flex> | 73 | </v-flex> |
74 | <v-flex xs12 sm12 lg3> | 74 | <v-flex xs12 sm12 lg3> |
75 | <v-btn | 75 | <v-btn |
76 | @click="getMarkReportList" | 76 | @click="getMarkReportList" |
77 | round | 77 | round |
78 | dark | 78 | dark |
79 | :loading="loading" | 79 | :loading="loading" |
80 | class="right mt-3" | 80 | class="right mt-3" |
81 | >Get Report</v-btn> | 81 | >Get Report</v-btn> |
82 | </v-flex> | 82 | </v-flex> |
83 | </v-layout> | 83 | </v-layout> |
84 | </v-flex> | 84 | </v-flex> |
85 | </v-form> | 85 | </v-form> |
86 | </v-card> | 86 | </v-card> |
87 | <!-- ****** PROFILE MARK ****** --> | 87 | <!-- ****** PROFILE MARK ****** --> |
88 | 88 | ||
89 | <v-container fluid grid-list-md v-show="showReport"> | 89 | <v-container fluid grid-list-md v-show="showReport"> |
90 | <v-layout> | 90 | <v-layout> |
91 | <v-flex xs12 sm12> | 91 | <v-flex xs12 sm12> |
92 | <v-btn class="grey" dark @click="print()"> | 92 | <v-btn class="grey" dark @click="print()"> |
93 | 93 | ||
94 | <v-icon right dark>print</v-icon> | 94 | <v-icon right dark>print</v-icon> |
95 | </v-btn> | 95 | </v-btn> |
96 | </v-flex> | 96 | </v-flex> |
97 | </v-layout> | 97 | </v-layout> |
98 | <v-flex xs12 sm12 id="printMe"> | 98 | <v-flex xs12 sm12 id="printMe"> |
99 | <!-- <v-container fluid grid-list-md> --> | ||
100 | <v-layout wrap> | 99 | <v-layout wrap> |
101 | <v-flex xs12 sm12 md3> | 100 | <v-flex xs12 sm12 md3> |
102 | <v-card class="fixcolors white--text" flat> | 101 | <v-card class="fixcolors white--text" flat> |
103 | <v-card-actions class="pa-0"> | 102 | <v-card-actions class="pa-0"> |
104 | <v-spacer></v-spacer> | 103 | <v-spacer></v-spacer> |
105 | <v-card-title class="pa-2"> | 104 | <v-card-title class="pa-2"> |
106 | <h3>Profile</h3> | 105 | <h3>Profile</h3> |
107 | </v-card-title> | 106 | </v-card-title> |
108 | <v-spacer></v-spacer> | 107 | <v-spacer></v-spacer> |
109 | </v-card-actions> | 108 | </v-card-actions> |
110 | </v-card> | 109 | </v-card> |
111 | <v-card flat> | 110 | <v-card flat> |
112 | <v-layout | 111 | <v-layout |
113 | wrap | 112 | wrap |
114 | v-for="(value, id, index) in filterData" | 113 | v-for="(value, id, index) in filterData" |
115 | v-if="index == 0" | 114 | v-if="index == 0" |
116 | :key="index" | 115 | :key="index" |
117 | > | 116 | > |
118 | <v-flex xs12 style="margin:16px;"> | 117 | <v-flex xs12 style="margin:16px;"> |
119 | <v-layout> | 118 | <v-layout> |
120 | <v-flex xs12> | 119 | <v-flex xs12> |
121 | <v-avatar | 120 | <v-avatar |
122 | size="100px" | 121 | size="100px" |
123 | class="mx-auto" | 122 | class="mx-auto" |
124 | style="margin: auto;display:block;margin-bottom:10px !important" | 123 | style="margin: auto;display:block;margin-bottom:10px !important" |
125 | > | 124 | > |
126 | <img src="/static/icon/user.png" v-if="!value[0].studentId.profilePicUrl" /> | 125 | <img src="/static/icon/user.png" v-if="!value[0].studentId.profilePicUrl" /> |
127 | <img | 126 | <img |
128 | :src="value[0].studentId.profilePicUrl" | 127 | :src="value[0].studentId.profilePicUrl" |
129 | v-else-if="value[0].studentId.profilePicUrl" | 128 | v-else-if="value[0].studentId.profilePicUrl" |
130 | /> | 129 | /> |
131 | </v-avatar> | 130 | </v-avatar> |
132 | </v-flex> | 131 | </v-flex> |
133 | </v-layout> | 132 | </v-layout> |
134 | <v-layout> | 133 | <v-layout> |
135 | <v-flex xs12 style="text-align:center;"> | 134 | <v-flex xs12 style="text-align:center;"> |
136 | <h3> | 135 | <h3> |
137 | <b>{{ value[0].studentId.name }}</b> | 136 | <b>{{ value[0].studentId.name }}</b> |
138 | </h3> | 137 | </h3> |
139 | <p class="grey--text">Student</p> | 138 | <p class="grey--text">Student</p> |
140 | </v-flex> | 139 | </v-flex> |
141 | </v-layout> | 140 | </v-layout> |
142 | <v-layout | 141 | <v-layout |
143 | style="border: 1px solid lightgrey;padding: 4px;border-top-right-radius: 4px; | 142 | style="border: 1px solid lightgrey;padding: 4px;border-top-right-radius: 4px; |
144 | border-top-left-radius: 4px;" | 143 | border-top-left-radius: 4px;" |
145 | > | 144 | > |
146 | <v-flex xs6 sm3 class="py-1"> | 145 | <v-flex xs6 sm3 class="py-1"> |
147 | <h4> | 146 | <h4> |
148 | <b>RollNo</b> | 147 | <b>RollNo</b> |
149 | </h4> | 148 | </h4> |
150 | </v-flex> | 149 | </v-flex> |
151 | <v-flex sm9 xs7 class="py-1"> | 150 | <v-flex sm9 xs7 class="py-1"> |
152 | <h4>: {{ value[0].studentId.rollNo }}</h4> | 151 | <h4>: {{ value[0].studentId.rollNo }}</h4> |
153 | </v-flex> | 152 | </v-flex> |
154 | </v-layout> | 153 | </v-layout> |
155 | <v-layout style="border: 1px solid lightgrey;padding: 4px;"> | 154 | <v-layout style="border: 1px solid lightgrey;padding: 4px;"> |
156 | <v-flex xs6 sm3 class="py-1"> | 155 | <v-flex xs6 sm3 class="py-1"> |
157 | <h4> | 156 | <h4> |
158 | <b>Class</b> | 157 | <b>Class</b> |
159 | </h4> | 158 | </h4> |
160 | </v-flex> | 159 | </v-flex> |
161 | <v-flex sm9 xs8 class="py-1"> | 160 | <v-flex sm9 xs8 class="py-1"> |
162 | <h4>: {{value[0].classId.classNum }}</h4> | 161 | <h4>: {{value[0].classId.classNum }}</h4> |
163 | </v-flex> | 162 | </v-flex> |
164 | </v-layout> | 163 | </v-layout> |
165 | <v-layout | 164 | <v-layout |
166 | style="border: 1px solid lightgrey;padding: 4px;border-bottom-right-radius: 4px; | 165 | style="border: 1px solid lightgrey;padding: 4px;border-bottom-right-radius: 4px; |
167 | border-bottom-left-radius: 4px;" | 166 | border-bottom-left-radius: 4px;" |
168 | > | 167 | > |
169 | <v-flex xs6 sm3 class> | 168 | <v-flex xs6 sm3 class> |
170 | <h4> | 169 | <h4> |
171 | <b>Section</b> | 170 | <b>Section</b> |
172 | </h4> | 171 | </h4> |
173 | </v-flex> | 172 | </v-flex> |
174 | <v-flex sm9 xs6 class> | 173 | <v-flex sm9 xs6 class> |
175 | <h4>: {{ value[0].sectionId.name}}</h4> | 174 | <h4>: {{ value[0].sectionId.name}}</h4> |
176 | </v-flex> | 175 | </v-flex> |
177 | </v-layout> | 176 | </v-layout> |
178 | </v-flex> | 177 | </v-flex> |
179 | </v-layout> | 178 | </v-layout> |
180 | </v-card> | 179 | </v-card> |
181 | </v-flex> | 180 | </v-flex> |
182 | 181 | ||
183 | <!-- ****** TABLE DATA MARK ****** --> | 182 | <!-- ****** TABLE DATA MARK ****** --> |
184 | 183 | ||
185 | <v-flex xs12 sm12 md9> | 184 | <v-flex xs12 sm12 md9> |
186 | <v-card class="fixcolors white--text" flat> | 185 | <v-card class="fixcolors white--text" flat> |
187 | <v-card-actions class="pa-0"> | 186 | <v-card-actions class="pa-0"> |
188 | <v-spacer></v-spacer> | 187 | <v-spacer></v-spacer> |
189 | <v-card-title class="pa-2"> | 188 | <v-card-title class="pa-2"> |
190 | <h3>Mark</h3> | 189 | <h3>Mark</h3> |
191 | </v-card-title> | 190 | </v-card-title> |
192 | <v-spacer></v-spacer> | 191 | <v-spacer></v-spacer> |
193 | </v-card-actions> | 192 | </v-card-actions> |
194 | </v-card> | 193 | </v-card> |
195 | <v-card | 194 | <v-card |
196 | v-for="(value, id, index) in filterData" | 195 | v-for="(value, id, index) in filterData" |
197 | :key="index" | 196 | :key="index" |
198 | flat | 197 | flat |
199 | style="border: 1px solid lightgrey;margin-bottom:14px;" | 198 | style="border: 1px solid lightgrey;margin-bottom:14px;" |
200 | > | 199 | > |
201 | <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> | 200 | <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> |
202 | <table | 201 | <table |
203 | class="mb-5 tableRsponsive feeTypeTable" | 202 | class="mb-5 tableRsponsive feeTypeTable" |
204 | style="border: 1px solid lightgrey; | 203 | style="border: 1px solid lightgrey; |
205 | border-collapse: collapse;!important | 204 | border-collapse: collapse;!important |
206 | table-layout: auto !important; | 205 | table-layout: auto !important; |
207 | width: 100% !important;" | 206 | width: 100% !important;" |
208 | > | 207 | > |
209 | <thead style="border: 1px solid lightgrey !important;"> | 208 | <thead style="border: 1px solid lightgrey !important;"> |
210 | <tr | 209 | <tr |
211 | class="info white--text" | 210 | class="info white--text" |
212 | style="border: 1px solid lightgrey !important;padding:4px;" | 211 | style="border: 1px solid lightgrey !important;padding:4px;" |
213 | > | 212 | > |
214 | <td | 213 | <td |
215 | rowspan="2" | 214 | rowspan="2" |
216 | style="border: 1px solid lightgrey !important;padding: 10px;" | 215 | style="border: 1px solid lightgrey !important;padding: 10px;" |
217 | >Subject</td> | 216 | >Subject</td> |
218 | <td | 217 | <td |
219 | colspan="2" | 218 | colspan="2" |
220 | v-for="exam in value[index].studentsMarks" | 219 | v-for="exam in value[index].studentsMarks" |
221 | style="border: 1px solid lightgrey !important;padding: 10px;" | 220 | style="border: 1px solid lightgrey !important;padding: 10px;" |
222 | >{{exam.markDistributionId.distributionType}}</td> | 221 | >{{exam.markDistributionId.distributionType}}</td> |
223 | <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> | 222 | <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> |
224 | </tr> | 223 | </tr> |
225 | <tr | 224 | <tr |
226 | v-for="(subject, ind) in value" | 225 | v-for="(subject, ind) in value" |
227 | v-if="ind == 0" | 226 | v-if="ind == 0" |
228 | style="border: 1px solid lightgrey !important;" | 227 | style="border: 1px solid lightgrey !important;" |
229 | > | 228 | > |
230 | <template v-for="(exam, i) in subject.studentsMarks"> | 229 | <template v-for="(exam, i) in subject.studentsMarks"> |
231 | <td | 230 | <td |
232 | class="bg-sky white--text" | 231 | class="bg-sky white--text" |
233 | style="border: 1px solid lightgrey !important;padding: 10px;" | 232 | style="border: 1px solid lightgrey !important;padding: 10px;" |
234 | >Mark</td> | 233 | >Mark</td> |
235 | <td | 234 | <td |
236 | class="bg-sky-light white--text" | 235 | class="bg-sky-light white--text" |
237 | style="border: 1px solid lightgrey !important;padding: 10px;" | 236 | style="border: 1px solid lightgrey !important;padding: 10px;" |
238 | >Highest Mark</td> | 237 | >Highest Mark</td> |
239 | </template> | 238 | </template> |
240 | <td | 239 | <td |
241 | class="bg-sky white--text" | 240 | class="bg-sky white--text" |
242 | style="border: 1px solid lightgrey !important;padding: 10px;" | 241 | style="border: 1px solid lightgrey !important;padding: 10px;" |
243 | >Mark</td> | 242 | >Mark</td> |
244 | </tr> | 243 | </tr> |
245 | </thead> | 244 | </thead> |
246 | <tbody style="border: 1px solid lightgrey !important;"> | 245 | <tbody style="border: 1px solid lightgrey !important;"> |
247 | <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> | 246 | <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> |
248 | <td | 247 | <td |
249 | style="border: 1px solid lightgrey !important;padding: 10px;" | 248 | style="border: 1px solid lightgrey !important;padding: 10px;" |
250 | >{{subject.subjectName}}</td> | 249 | >{{subject.subjectName}}</td> |
251 | <template v-for="(exam, i) in subject.studentsMarks"> | 250 | <template v-for="(exam, i) in subject.studentsMarks"> |
252 | <td | 251 | <td |
253 | style="border: 1px solid lightgrey !important;padding: 10px;" | 252 | style="border: 1px solid lightgrey !important;padding: 10px;" |
254 | >{{exam.marksScored}}</td> | 253 | >{{exam.marksScored}}</td> |
255 | <td | 254 | <td |
256 | style="border: 1px solid lightgrey !important;padding: 10px;" | 255 | style="border: 1px solid lightgrey !important;padding: 10px;" |
257 | >{{exam.markDistributionId.markValue}}</td> | 256 | >{{exam.markDistributionId.markValue}}</td> |
258 | </template> | 257 | </template> |
259 | <td | 258 | <td |
260 | style="border: 1px solid lightgrey !important;padding: 10px;" | 259 | style="border: 1px solid lightgrey !important;padding: 10px;" |
261 | >{{subject.totalMarks}}</td> | 260 | >{{subject.totalMarks}}</td> |
262 | </tr> | 261 | </tr> |
263 | </tbody> | 262 | </tbody> |
264 | </table> | 263 | </table> |
265 | </v-card> | 264 | </v-card> |
266 | </v-flex> | 265 | </v-flex> |
267 | </v-layout> | 266 | </v-layout> |
268 | <!-- </v-container> --> | ||
269 | </v-flex> | 267 | </v-flex> |
270 | </v-container> | 268 | </v-container> |
271 | <div class="loader" v-if="showLoader"> | 269 | <div class="loader" v-if="showLoader"> |
272 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 270 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
273 | </div> | 271 | </div> |
274 | </v-app> | 272 | </v-app> |
275 | </template> | 273 | </template> |
276 | 274 | ||
277 | <script> | 275 | <script> |
278 | import http from "@/Services/http.js"; | 276 | import http from "@/Services/http.js"; |
279 | import moment from "moment"; | 277 | import moment from "moment"; |
280 | import _ from "underscore"; | 278 | import _ from "underscore"; |
281 | 279 | ||
282 | export default { | 280 | export default { |
283 | data: () => ({ | 281 | data: () => ({ |
284 | showLoader: false, | 282 | showLoader: false, |
285 | markData: [], | 283 | markData: [], |
286 | token: "", | 284 | token: "", |
287 | markDistributions: [], | 285 | markDistributions: [], |
288 | markParticularDistributionData: [], | 286 | markParticularDistributionData: [], |
289 | loading: false, | 287 | loading: false, |
290 | valid: true, | 288 | valid: true, |
291 | loading: false, | 289 | loading: false, |
292 | showReport: false, | 290 | showReport: false, |
293 | addSection: [], | 291 | addSection: [], |
294 | filterData: [], | 292 | filterData: [], |
295 | getStudentsList: [], | 293 | getStudentsList: [], |
296 | classRules: [v => !!v || "Class is required"], | 294 | classRules: [v => !!v || "Class is required"], |
297 | sectionRules: [v => !!v || "Class is required"], | 295 | sectionRules: [v => !!v || "Class is required"], |
298 | studentRules: [v => !!v || "Student is required"], | 296 | studentRules: [v => !!v || "Student is required"], |
299 | getReport: {}, | 297 | getReport: {}, |
300 | classList: [], | 298 | classList: [], |
301 | output: null | 299 | output: null |
302 | }), | 300 | }), |
303 | mounted() { | 301 | mounted() { |
304 | this.token = this.$store.state.token; | 302 | this.token = this.$store.state.token; |
305 | this.getClass(); | 303 | this.getClass(); |
306 | }, | 304 | }, |
307 | methods: { | 305 | methods: { |
308 | clear() { | 306 | clear() { |
309 | this.$refs.form.reset(); | 307 | this.$refs.form.reset(); |
310 | }, | 308 | }, |
311 | getClass() { | 309 | getClass() { |
312 | this.showLoader = true; | 310 | this.showLoader = true; |
313 | http() | 311 | http() |
314 | .get("/getClassesList", { | 312 | .get("/getClassesList", { |
315 | headers: { Authorization: "Bearer " + this.token } | 313 | headers: { Authorization: "Bearer " + this.token } |
316 | }) | 314 | }) |
317 | .then(response => { | 315 | .then(response => { |
318 | this.classList = response.data.data; | 316 | this.classList = response.data.data; |
319 | this.showLoader = false; | 317 | this.showLoader = false; |
320 | }) | 318 | }) |
321 | .catch(err => { | 319 | .catch(err => { |
322 | this.showLoader = false; | 320 | this.showLoader = false; |
323 | // console.log("err====>", err); | 321 | // console.log("err====>", err); |
324 | }); | 322 | }); |
325 | }, | 323 | }, |
326 | getSections(_id) { | 324 | getSections(_id) { |
327 | http() | 325 | http() |
328 | .get( | 326 | .get( |
329 | "/getSectionsList", | 327 | "/getSectionsList", |
330 | { params: { classId: _id } }, | 328 | { params: { classId: _id } }, |
331 | { | 329 | { |
332 | headers: { Authorization: "Bearer " + this.token } | 330 | headers: { Authorization: "Bearer " + this.token } |
333 | } | 331 | } |
334 | ) | 332 | ) |
335 | .then(response => { | 333 | .then(response => { |
336 | this.addSection = response.data.data; | 334 | this.addSection = response.data.data; |
337 | }) | 335 | }) |
338 | .catch(err => { | 336 | .catch(err => { |
339 | // console.log("err====>", err); | 337 | // console.log("err====>", err); |
340 | }); | 338 | }); |
341 | }, | 339 | }, |
342 | getStudents() { | 340 | getStudents() { |
343 | this.showLoader = true; | 341 | this.showLoader = true; |
344 | http() | 342 | http() |
345 | .get("/getStudentWithClass", { | 343 | .get("/getStudentWithClass", { |
346 | params: { | 344 | params: { |
347 | classId: this.getReport.classId, | 345 | classId: this.getReport.classId, |
348 | sectionId: this.getReport.sectionId | 346 | sectionId: this.getReport.sectionId |
349 | } | 347 | } |
350 | }) | 348 | }) |
351 | .then(response => { | 349 | .then(response => { |
352 | this.getStudentsList = response.data.data; | 350 | this.getStudentsList = response.data.data; |
353 | this.showLoader = false; | 351 | this.showLoader = false; |
354 | console.log("getSectionsList=====>", response.data.data); | 352 | console.log("getSectionsList=====>", response.data.data); |
355 | }) | 353 | }) |
356 | .catch(error => { | 354 | .catch(error => { |
357 | console.log("err====>", error); | 355 | console.log("err====>", error); |
358 | this.showLoader = false; | 356 | this.showLoader = false; |
359 | }); | 357 | }); |
360 | }, | 358 | }, |
361 | getMarkReportList() { | 359 | getMarkReportList() { |
362 | this.showLoader = true; | 360 | this.showLoader = true; |
363 | this.showReport = true; | 361 | this.showReport = true; |
364 | http() | 362 | http() |
365 | .get("/getParticularMark", { | 363 | .get("/getParticularMark", { |
366 | params: { studentId: this.getReport.studentId }, | 364 | params: { studentId: this.getReport.studentId }, |
367 | headers: { Authorization: "Bearer " + this.token } | 365 | headers: { Authorization: "Bearer " + this.token } |
368 | }) | 366 | }) |
369 | .then(response => { | 367 | .then(response => { |
370 | let newData = response.data.data; | 368 | let newData = response.data.data; |
371 | for (var i = 0; i < newData.length; i++) { | 369 | for (var i = 0; i < newData.length; i++) { |
372 | newData[i].examination = newData[i].examId._id; | 370 | newData[i].examination = newData[i].examId._id; |
373 | } | 371 | } |
374 | this.filterData = _.groupBy(newData, ["examination"]); | 372 | this.filterData = _.groupBy(newData, ["examination"]); |
375 | for (let data in this.filterData) { | 373 | for (let data in this.filterData) { |
376 | for (let item in this.filterData[data]) { | 374 | for (let item in this.filterData[data]) { |
377 | var totalMarks = 0; | 375 | var totalMarks = 0; |
378 | for ( | 376 | for ( |
379 | let i = 0; | 377 | let i = 0; |
380 | i < this.filterData[data][item].studentsMarks.length; | 378 | i < this.filterData[data][item].studentsMarks.length; |
381 | i++ | 379 | i++ |
382 | ) { | 380 | ) { |
383 | totalMarks += this.filterData[data][item].studentsMarks[i] | 381 | totalMarks += this.filterData[data][item].studentsMarks[i] |
384 | .marksScored; | 382 | .marksScored; |
385 | } | 383 | } |
386 | this.filterData[data][item].totalMarks = totalMarks; | 384 | this.filterData[data][item].totalMarks = totalMarks; |
387 | } | 385 | } |
388 | } | 386 | } |
389 | this.showLoader = false; | 387 | this.showLoader = false; |
390 | }) | 388 | }) |
391 | .catch(error => { | 389 | .catch(error => { |
392 | // console.log("err====>", err); | 390 | // console.log("err====>", err); |
393 | this.showLoader = false; | 391 | this.showLoader = false; |
394 | this.snackbar = true; | 392 | this.snackbar = true; |
395 | this.text = error.response.data.message; | 393 | this.text = error.response.data.message; |
396 | if (error.response.status === 401) { | 394 | if (error.response.status === 401) { |
397 | this.$router.replace({ path: "/" }); | 395 | this.$router.replace({ path: "/" }); |
398 | this.$store.dispatch("setToken", null); | 396 | this.$store.dispatch("setToken", null); |
399 | this.$store.dispatch("Id", null); | 397 | this.$store.dispatch("Id", null); |
400 | } | 398 | } |
401 | }); | 399 | }); |
402 | }, | 400 | }, |
403 | print() { | 401 | print() { |
404 | // Pass the element id here | 402 | // Pass the element id here |
405 | this.$htmlToPaper("printMe"); | 403 | this.$htmlToPaper("printMe"); |
406 | } | 404 | } |
407 | } | 405 | } |
408 | }; | 406 | }; |
409 | </script> | 407 | </script> |
410 | 408 | ||
411 | <style scoped> | 409 | <style scoped> |
412 | table { | 410 | table { |
413 | border-collapse: collapse; | 411 | border-collapse: collapse; |
414 | border: 1px solid #e2e7eb; | 412 | border: 1px solid #e2e7eb; |
415 | } | 413 | } |
416 | 414 | ||
417 | th, | 415 | th, |
418 | td { | 416 | td { |
419 | border: 1px solid #e2e7eb; | 417 | border: 1px solid #e2e7eb; |
420 | padding: 10px; | 418 | padding: 10px; |
421 | text-align: center; | 419 | text-align: center; |
422 | } | 420 | } |
423 | table.feeTypeTable { | 421 | table.feeTypeTable { |
424 | table-layout: auto !important; | 422 | table-layout: auto !important; |
425 | width: 100% !important; | 423 | width: 100% !important; |
426 | } | 424 | } |
427 | .bg-sky { | 425 | .bg-sky { |
428 | background-color: #98b2cc !important; | 426 | background-color: #98b2cc !important; |
429 | } | 427 | } |
430 | .bg-sky-light { | 428 | .bg-sky-light { |
431 | background-color: #89a0b8; | 429 | background-color: #89a0b8; |
432 | } | 430 | } |
433 | .bg-purple { | 431 | .bg-purple { |
434 | background-color: #9583ac; | 432 | background-color: #9583ac; |
435 | } | 433 | } |
436 | .bg-skyDark { | 434 | .bg-skyDark { |
437 | background-color: #956785; | 435 | background-color: #956785; |
438 | } | 436 | } |
439 | @media screen and (max-width: 380px) { | 437 | @media screen and (max-width: 380px) { |
440 | .tableRsponsive { | 438 | .tableRsponsive { |
441 | display: block; | 439 | display: block; |
442 | position: relative; | 440 | position: relative; |
443 | overflow: scroll; | 441 | overflow: scroll; |
444 | } | 442 | } |
445 | } | 443 | } |
446 | </style> s | 444 | </style> s |
src/pages/School/school.vue
File was created | 1 | <template> | |
2 | <div> | ||
3 | <v-tabs grow slider-color="gray"> | ||
4 | <v-tab | ||
5 | ripple | ||
6 | @click="activeTab('existing')" | ||
7 | v-bind:class="{ active: isActive }" | ||
8 | id="tab" | ||
9 | class="subheading" | ||
10 | >Existing School</v-tab> | ||
11 | <v-tab | ||
12 | ripple | ||
13 | @click="activeTab('new')" | ||
14 | v-bind:class="{ active: newActive }" | ||
15 | id="tab1" | ||
16 | User | ||
17 | class="subheading" | ||
18 | >Add New School</v-tab> | ||
19 | |||
20 | <!-- ****** EDITS STUDENTS DETAILS ****** --> | ||
21 | |||
22 | <v-tab-item> | ||
23 | <v-snackbar | ||
24 | :timeout="timeout" | ||
25 | :top="y === 'top'" | ||
26 | :right="x === 'right'" | ||
27 | :vertical="mode === 'vertical'" | ||
28 | v-model="snackbar" | ||
29 | color="success" | ||
30 | >{{ text }}</v-snackbar> | ||
31 | <v-dialog v-model="dialog" max-width="1500px" scrollable> | ||
32 | <v-card flat> | ||
33 | <v-toolbar color="grey lighten-2" flat> | ||
34 | <v-spacer></v-spacer> | ||
35 | <v-toolbar-title> | ||
36 | <h3>Edit School</h3> | ||
37 | </v-toolbar-title> | ||
38 | <v-spacer></v-spacer> | ||
39 | </v-toolbar> | ||
40 | <v-card-text style="height: 686px;"> | ||
41 | <v-form ref="form"> | ||
42 | <v-container fluid> | ||
43 | <v-layout> | ||
44 | <v-flex | ||
45 | xs12 | ||
46 | class="text-xs-center text-sm-center text-md-center text-lg-center" | ||
47 | > | ||
48 | <v-avatar size="160px"> | ||
49 | <img | ||
50 | src="/static/icon/user.png" | ||
51 | v-if="!editedItem.schoolLogoUrl && !imageUrl" | ||
52 | /> | ||
53 | <img | ||
54 | :src="editedItem.schoolLogoUrl" | ||
55 | v-else-if="editedItem.schoolLogoUrl && !imageUrl" | ||
56 | /> | ||
57 | <img | ||
58 | v-if="imageUrl" | ||
59 | :src="imageUrl" | ||
60 | height="150" | ||
61 | style="border-radius:50%; width:200px" | ||
62 | /> | ||
63 | </v-avatar> | ||
64 | <input | ||
65 | type="file" | ||
66 | style="display: none" | ||
67 | ref="image" | ||
68 | accept="image/*" | ||
69 | @change="onFilePicked" | ||
70 | /> | ||
71 | </v-flex> | ||
72 | </v-layout> | ||
73 | <v-layout> | ||
74 | <v-flex xs12 sm4> | ||
75 | <v-layout> | ||
76 | <v-flex xs4 class="pt-4 subheading"> | ||
77 | <label class="right hidden-xs-only hidden-sm-only">Full Name:</label> | ||
78 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label> | ||
79 | </v-flex> | ||
80 | <v-flex xs8 class="ml-3"> | ||
81 | <v-text-field v-model="editedItem.name" placeholder="fill your full Name"></v-text-field> | ||
82 | </v-flex> | ||
83 | </v-layout> | ||
84 | </v-flex> | ||
85 | <v-flex xs12 sm4> | ||
86 | <v-layout> | ||
87 | <v-flex xs4 class="pt-4 subheading"> | ||
88 | <label class="right hidden-xs-only hidden-sm-only">Email ID:</label> | ||
89 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">EmailID:</label> | ||
90 | </v-flex> | ||
91 | <v-flex xs8 class="ml-3"> | ||
92 | <v-text-field placeholder="fill your email" v-model="editedItem.email"></v-text-field> | ||
93 | </v-flex> | ||
94 | </v-layout> | ||
95 | </v-flex> | ||
96 | <v-flex xs12 sm4> | ||
97 | <v-layout> | ||
98 | <v-flex xs4 class="pt-4 subheading"> | ||
99 | <label>Society Name:</label> | ||
100 | </v-flex> | ||
101 | <v-flex xs8 class="ml-3"> | ||
102 | <v-text-field | ||
103 | placeholder="fill your Society Name" | ||
104 | v-model="editedItem.societyName" | ||
105 | ></v-text-field> | ||
106 | </v-flex> | ||
107 | </v-layout> | ||
108 | </v-flex> | ||
109 | </v-layout> | ||
110 | <v-layout> | ||
111 | <v-flex xs12 sm4> | ||
112 | <v-layout> | ||
113 | <v-flex xs4 class="pt-4 subheading"> | ||
114 | <label class="right">City:</label> | ||
115 | </v-flex> | ||
116 | <v-flex xs8 class="ml-3"> | ||
117 | <v-text-field v-model="editedItem.city" placeholder="fill your City Name"></v-text-field> | ||
118 | </v-flex> | ||
119 | </v-layout> | ||
120 | </v-flex> | ||
121 | <v-flex xs12 sm4> | ||
122 | <v-layout> | ||
123 | <v-flex xs4 class="pt-4 subheading"> | ||
124 | <label class="right">State:</label> | ||
125 | </v-flex> | ||
126 | <v-flex xs8 class="ml-3"> | ||
127 | <v-text-field | ||
128 | v-model="editedItem.state" | ||
129 | placeholder="fill your City Name" | ||
130 | ></v-text-field> | ||
131 | </v-flex> | ||
132 | </v-layout> | ||
133 | </v-flex> | ||
134 | <v-flex xs12 sm4> | ||
135 | <v-layout> | ||
136 | <v-flex xs4 class="pt-4 subheading"> | ||
137 | <label class="right">Pincode:</label> | ||
138 | </v-flex> | ||
139 | <v-flex xs8 class="ml-3"> | ||
140 | <v-text-field | ||
141 | v-model="editedItem.pinCode" | ||
142 | placeholder="fill your pincode" | ||
143 | type="number" | ||
144 | ></v-text-field> | ||
145 | </v-flex> | ||
146 | </v-layout> | ||
147 | </v-flex> | ||
148 | </v-layout> | ||
149 | <v-layout> | ||
150 | <v-flex xs12 sm4> | ||
151 | <v-layout> | ||
152 | <v-flex xs4 class="pt-4 subheading"> | ||
153 | <label class="right">Fax No:</label> | ||
154 | </v-flex> | ||
155 | <v-flex xs8 class="ml-3"> | ||
156 | <v-text-field v-model="editedItem.faxNo" placeholder="fill your fax No"></v-text-field> | ||
157 | </v-flex> | ||
158 | </v-layout> | ||
159 | </v-flex> | ||
160 | <v-flex xs12 sm4> | ||
161 | <v-layout> | ||
162 | <v-flex xs4 class="pt-4 subheading"> | ||
163 | <label class="right">Country:</label> | ||
164 | </v-flex> | ||
165 | <v-flex xs8 class="ml-3"> | ||
166 | <v-text-field | ||
167 | v-model="editedItem.country" | ||
168 | placeholder="fill your Country" | ||
169 | ></v-text-field> | ||
170 | </v-flex> | ||
171 | </v-layout> | ||
172 | </v-flex> | ||
173 | <v-flex xs12 sm4> | ||
174 | <v-layout> | ||
175 | <v-flex xs4 class="pt-4 subheading"> | ||
176 | <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label> | ||
177 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label> | ||
178 | </v-flex> | ||
179 | <v-flex xs8 class="ml-3"> | ||
180 | <v-text-field | ||
181 | v-model="editedItem.mobile" | ||
182 | placeholder="fill your MobileNo" | ||
183 | name="mobileNo" | ||
184 | ></v-text-field> | ||
185 | </v-flex> | ||
186 | </v-layout> | ||
187 | </v-flex> | ||
188 | </v-layout> | ||
189 | <v-layout> | ||
190 | <v-flex xs12 sm4> | ||
191 | <v-layout> | ||
192 | <v-flex xs4 class="pt-4 subheading"> | ||
193 | <label class="right hidden-xs-only hidden-sm-only">LandLine No:</label> | ||
194 | <label | ||
195 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
196 | >LandLineNo:</label> | ||
197 | </v-flex> | ||
198 | <v-flex xs8 class="ml-3"> | ||
199 | <v-text-field | ||
200 | v-model="editedItem.landLineNo" | ||
201 | placeholder="fill your LandLine No" | ||
202 | type="number" | ||
203 | ></v-text-field> | ||
204 | </v-flex> | ||
205 | </v-layout> | ||
206 | </v-flex> | ||
207 | <v-flex xs12 sm4> | ||
208 | <v-layout> | ||
209 | <v-flex xs4 class="pt-4 subheading"> | ||
210 | <label class="right hidden-xs-only hidden-sm-only">Registration No:</label> | ||
211 | <label | ||
212 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
213 | >Registration-No:</label> | ||
214 | </v-flex> | ||
215 | <v-flex xs8 class="ml-3"> | ||
216 | <v-text-field | ||
217 | v-model="editedItem.registrationNo" | ||
218 | placeholder="fill your Registration No" | ||
219 | type="number" | ||
220 | ></v-text-field> | ||
221 | </v-flex> | ||
222 | </v-layout> | ||
223 | </v-flex> | ||
224 | <v-flex xs12 sm4> | ||
225 | <v-layout> | ||
226 | <v-flex xs4 class="pt-4 subheading"> | ||
227 | <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> | ||
228 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod:</label> | ||
229 | </v-flex> | ||
230 | <v-flex xs8 class="ml-3"> | ||
231 | <v-text-field | ||
232 | label="Select Image" | ||
233 | @click="pickFile" | ||
234 | v-model="imageName" | ||
235 | append-icon="attach_file" | ||
236 | ></v-text-field> | ||
237 | </v-flex> | ||
238 | </v-layout> | ||
239 | </v-flex> | ||
240 | </v-layout> | ||
241 | <v-layout> | ||
242 | <v-flex xs12 sm4> | ||
243 | <v-layout> | ||
244 | <v-flex xs4 class="pt-4 subheading"> | ||
245 | <label class="right hidden-xs-only hidden-sm-only">School Details:</label> | ||
246 | <label | ||
247 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
248 | >SchoolDetail:</label> | ||
249 | </v-flex> | ||
250 | <v-flex xs8 class="ml-3"> | ||
251 | <v-text-field | ||
252 | v-model="editedItem.schoolDetails" | ||
253 | placeholder="fill your School Details" | ||
254 | ></v-text-field> | ||
255 | </v-flex> | ||
256 | </v-layout> | ||
257 | </v-flex> | ||
258 | <v-flex xs12 sm4> | ||
259 | <v-layout> | ||
260 | <v-flex xs4 class="pt-4 subheading"> | ||
261 | <label class="right hidden-xs-only hidden-sm-only">Academic Year:</label> | ||
262 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Year:</label> | ||
263 | </v-flex> | ||
264 | <v-flex xs8 class="ml-3"> | ||
265 | <v-text-field | ||
266 | v-model="editedItem.establishmentYear" | ||
267 | placeholder="fill your Academic Year" | ||
268 | ></v-text-field> | ||
269 | </v-flex> | ||
270 | </v-layout> | ||
271 | </v-flex> | ||
272 | <v-flex xs12 sm4> | ||
273 | <v-layout> | ||
274 | <v-flex xs4 class="pt-4 subheading"> | ||
275 | <label class="right hidden-xs-only hidden-sm-only">Web Site Url:</label> | ||
276 | <label | ||
277 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
278 | >WebSiteUrl:</label> | ||
279 | </v-flex> | ||
280 | <v-flex xs8 class="ml-3"> | ||
281 | <v-text-field | ||
282 | v-model="editedItem.websiteUrl" | ||
283 | placeholder="fill your MobileNo" | ||
284 | ></v-text-field> | ||
285 | </v-flex> | ||
286 | </v-layout> | ||
287 | </v-flex> | ||
288 | </v-layout> | ||
289 | <v-layout> | ||
290 | <v-flex xs12 sm4> | ||
291 | <v-layout> | ||
292 | <v-flex xs4 class="pt-4 subheading"> | ||
293 | <label class="right">Address:</label> | ||
294 | </v-flex> | ||
295 | <v-flex xs8 class="ml-3"> | ||
296 | <v-text-field | ||
297 | v-model="editedItem.address" | ||
298 | placeholder="Select your Address" | ||
299 | ></v-text-field> | ||
300 | </v-flex> | ||
301 | </v-layout> | ||
302 | </v-flex> | ||
303 | </v-layout> | ||
304 | <v-layout> | ||
305 | <v-flex xs12 sm12> | ||
306 | <v-layout> | ||
307 | <v-flex xs6> | ||
308 | <v-btn round dark @click.native="close">Cancel</v-btn> | ||
309 | </v-flex> | ||
310 | <v-flex xs6> | ||
311 | <v-btn @click="save" round dark :loading="loading" class="right">Save</v-btn> | ||
312 | </v-flex> | ||
313 | </v-layout> | ||
314 | </v-flex> | ||
315 | </v-layout> | ||
316 | </v-container> | ||
317 | </v-form> | ||
318 | </v-card-text> | ||
319 | </v-card> | ||
320 | </v-dialog> | ||
321 | |||
322 | <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** --> | ||
323 | |||
324 | <v-dialog v-model="dialog1" max-width="1100px" scrollable> | ||
325 | <v-card> | ||
326 | <v-toolbar color="grey lighten-2" flat> | ||
327 | <v-spacer></v-spacer> | ||
328 | <v-toolbar-title>School</v-toolbar-title> | ||
329 | <v-spacer></v-spacer> | ||
330 | <v-icon @click="close1">close</v-icon> | ||
331 | </v-toolbar> | ||
332 | <v-card-text style="height: 700px;"> | ||
333 | <v-flex align-center justify-center layout text-xs-center class="mt-3"> | ||
334 | <v-avatar size="160px"> | ||
335 | <img src="/static/icon/user.png" v-if="!editedItem.schoolLogoUrl" /> | ||
336 | <img :src="editedItem.schoolLogoUrl" v-else-if="editedItem.schoolLogoUrl" /> | ||
337 | </v-avatar> | ||
338 | </v-flex> | ||
339 | <v-container grid-list-md> | ||
340 | <v-layout wrap> | ||
341 | <v-flex xs12 sm6> | ||
342 | <v-layout> | ||
343 | <v-flex xs6 sm5> | ||
344 | <h5 class="right my-1"> | ||
345 | <b>Full Name:</b> | ||
346 | </h5> | ||
347 | </v-flex> | ||
348 | <v-flex sm7 xs6> | ||
349 | <h5 class="my-1 left">{{ editedItem.name }}</h5> | ||
350 | </v-flex> | ||
351 | </v-layout> | ||
352 | </v-flex> | ||
353 | <v-flex xs12 sm6> | ||
354 | <v-layout> | ||
355 | <v-flex xs6 sm4> | ||
356 | <h5 class="right my-1"> | ||
357 | <b>Email:</b> | ||
358 | </h5> | ||
359 | </v-flex> | ||
360 | <v-flex sm8 xs6> | ||
361 | <h5 class="my-1 left">{{ editedItem.email }}</h5> | ||
362 | </v-flex> | ||
363 | </v-layout> | ||
364 | </v-flex> | ||
365 | </v-layout> | ||
366 | <v-layout wrap> | ||
367 | <v-flex xs12 sm6> | ||
368 | <v-layout> | ||
369 | <v-flex xs6 sm5> | ||
370 | <b> | ||
371 | <h5 class="right my-1"> | ||
372 | <b>Create:</b> | ||
373 | </h5> | ||
374 | </b> | ||
375 | </v-flex> | ||
376 | <v-flex sm7 xs6> | ||
377 | <h5 class="my-1">{{ dates(editedItem.created) }}</h5> | ||
378 | </v-flex> | ||
379 | </v-layout> | ||
380 | </v-flex> | ||
381 | <v-flex xs12 sm6> | ||
382 | <v-layout> | ||
383 | <v-flex xs6 sm4> | ||
384 | <b> | ||
385 | <h5 class="right my-1"> | ||
386 | <b>City:</b> | ||
387 | </h5> | ||
388 | </b> | ||
389 | </v-flex> | ||
390 | <v-flex sm8 xs6> | ||
391 | <h5 class="my-1 left">{{ editedItem.city }}</h5> | ||
392 | </v-flex> | ||
393 | </v-layout> | ||
394 | </v-flex> | ||
395 | </v-layout> | ||
396 | <v-layout wrap> | ||
397 | <v-flex xs12 sm6> | ||
398 | <v-layout> | ||
399 | <v-flex xs6 sm5> | ||
400 | <b> | ||
401 | <h5 class="right my-1"> | ||
402 | <b>State:</b> | ||
403 | </h5> | ||
404 | </b> | ||
405 | </v-flex> | ||
406 | <v-flex sm7 xs6> | ||
407 | <h5 class="my-1 left">{{ editedItem.state }}</h5> | ||
408 | </v-flex> | ||
409 | </v-layout> | ||
410 | </v-flex> | ||
411 | <v-flex xs12 sm6> | ||
412 | <v-layout> | ||
413 | <v-flex xs6 sm4> | ||
414 | <b> | ||
415 | <h5 class="right my-1"> | ||
416 | <b>Pincode:</b> | ||
417 | </h5> | ||
418 | </b> | ||
419 | </v-flex> | ||
420 | <v-flex sm8 xs6> | ||
421 | <h5 class="my-1">{{ editedItem.pinCode }}</h5> | ||
422 | </v-flex> | ||
423 | </v-layout> | ||
424 | </v-flex> | ||
425 | </v-layout> | ||
426 | <v-layout wrap> | ||
427 | <v-flex xs12 sm6> | ||
428 | <v-layout> | ||
429 | <v-flex xs6 sm5> | ||
430 | <b> | ||
431 | <h5 class="right my-1"> | ||
432 | <b>Fax No:</b> | ||
433 | </h5> | ||
434 | </b> | ||
435 | </v-flex> | ||
436 | <v-flex sm7 xs6> | ||
437 | <h5 class="my-1 left">{{ editedItem.faxNo }}</h5> | ||
438 | </v-flex> | ||
439 | </v-layout> | ||
440 | </v-flex> | ||
441 | <v-flex xs12 sm6> | ||
442 | <v-layout> | ||
443 | <v-flex xs6 sm4> | ||
444 | <b> | ||
445 | <h5 class="right my-1"> | ||
446 | <b>Country:</b> | ||
447 | </h5> | ||
448 | </b> | ||
449 | </v-flex> | ||
450 | <v-flex sm8 xs6> | ||
451 | <h5 class="my-1">{{ editedItem.country }}</h5> | ||
452 | </v-flex> | ||
453 | </v-layout> | ||
454 | </v-flex> | ||
455 | </v-layout> | ||
456 | <v-layout wrap> | ||
457 | <v-flex xs12 sm6> | ||
458 | <v-layout> | ||
459 | <v-flex xs6 sm5> | ||
460 | <b> | ||
461 | <h5 class="right my-1"> | ||
462 | <b>Mobile No:</b> | ||
463 | </h5> | ||
464 | </b> | ||
465 | </v-flex> | ||
466 | <v-flex sm7 xs6> | ||
467 | <h5 class="my-1">{{ editedItem.mobile }}</h5> | ||
468 | </v-flex> | ||
469 | </v-layout> | ||
470 | </v-flex> | ||
471 | <v-flex xs12 sm5> | ||
472 | <v-layout> | ||
473 | <v-flex xs6 sm5> | ||
474 | <b> | ||
475 | <h5 class="right my-1"> | ||
476 | <b>Country:</b> | ||
477 | </h5> | ||
478 | </b> | ||
479 | </v-flex> | ||
480 | <v-flex sm7 xs6> | ||
481 | <h5 class="my-1">{{ editedItem.country }}</h5> | ||
482 | </v-flex> | ||
483 | </v-layout> | ||
484 | </v-flex> | ||
485 | </v-layout> | ||
486 | <v-layout wrap> | ||
487 | <v-flex xs12 sm6> | ||
488 | <v-layout> | ||
489 | <v-flex sm5 xs6> | ||
490 | <b> | ||
491 | <h5 class="right my-1"> | ||
492 | <b>LandLine No:</b> | ||
493 | </h5> | ||
494 | </b> | ||
495 | </v-flex> | ||
496 | <v-flex sm6 xs6> | ||
497 | <h5 class="my-1">{{ editedItem.landLineNo }}</h5> | ||
498 | </v-flex> | ||
499 | </v-layout> | ||
500 | </v-flex> | ||
501 | <v-flex xs12 sm6> | ||
502 | <v-layout> | ||
503 | <v-flex xs6 sm4 class="hidden-xs-only hidden-sm-only"> | ||
504 | <b> | ||
505 | <h5 class="right my-1"> | ||
506 | <b>Registration No:</b> | ||
507 | </h5> | ||
508 | </b> | ||
509 | </v-flex> | ||
510 | <v-flex xs6 sm4 class="hidden-lg-only hidden-md-only hidden-xl-only"> | ||
511 | <b> | ||
512 | <h5 class="right my-1"> | ||
513 | <b>RegistrationNo:</b> | ||
514 | </h5> | ||
515 | </b> | ||
516 | </v-flex> | ||
517 | <v-flex sm8 xs6> | ||
518 | <h5 class="my-1">{{ editedItem.registrationNo }}</h5> | ||
519 | </v-flex> | ||
520 | </v-layout> | ||
521 | </v-flex> | ||
522 | </v-layout> | ||
523 | <v-layout wrap> | ||
524 | <v-flex xs12 sm6> | ||
525 | <v-layout> | ||
526 | <v-flex xs6 sm5> | ||
527 | <b> | ||
528 | <h5 class="right my-1"> | ||
529 | <b>School Details:</b> | ||
530 | </h5> | ||
531 | </b> | ||
532 | </v-flex> | ||
533 | <v-flex sm7 xs6> | ||
534 | <h5 class="my-1">{{ editedItem.schoolDetails }}</h5> | ||
535 | </v-flex> | ||
536 | </v-layout> | ||
537 | </v-flex> | ||
538 | <v-flex xs12 sm6> | ||
539 | <v-layout> | ||
540 | <v-flex xs6 sm4> | ||
541 | <b> | ||
542 | <h5 class="right my-1"> | ||
543 | <b>Address:</b> | ||
544 | </h5> | ||
545 | </b> | ||
546 | </v-flex> | ||
547 | <v-flex sm8 xs6> | ||
548 | <h5 class="my-1">{{ editedItem.address }}</h5> | ||
549 | </v-flex> | ||
550 | </v-layout> | ||
551 | </v-flex> | ||
552 | </v-layout> | ||
553 | <v-layout wrap> | ||
554 | <v-flex xs12 sm5> | ||
555 | <v-layout> | ||
556 | <v-flex xs6 sm6 class="hidden-xs-only hidden-sm-only"> | ||
557 | <b> | ||
558 | <h5 class="right my-1"> | ||
559 | <b>Academic Year:</b> | ||
560 | </h5> | ||
561 | </b> | ||
562 | </v-flex> | ||
563 | <v-flex xs6 sm6 class="hidden-lg-only hidden-md-only hidden-xl-only"> | ||
564 | <b> | ||
565 | <h5 class="right my-1"> | ||
566 | <b>AcademicYear:</b> | ||
567 | </h5> | ||
568 | </b> | ||
569 | </v-flex> | ||
570 | <v-flex sm6 xs6> | ||
571 | <h5 class="my-1">{{ editedItem.establishmentYear }}</h5> | ||
572 | </v-flex> | ||
573 | </v-layout> | ||
574 | </v-flex> | ||
575 | </v-layout> | ||
576 | </v-container> | ||
577 | </v-card-text> | ||
578 | </v-card> | ||
579 | </v-dialog> | ||
580 | |||
581 | <v-snackbar | ||
582 | :timeout="timeout" | ||
583 | :top="y === 'top'" | ||
584 | :right="x === 'right'" | ||
585 | :vertical="mode === 'vertical'" | ||
586 | v-model="snackbar" | ||
587 | color="success" | ||
588 | >{{ text }}</v-snackbar> | ||
589 | |||
590 | <!-- ****** EXISTING-USERS STUDENTS TABLE ****** --> | ||
591 | <v-data-table | ||
592 | :headers="headers" | ||
593 | :items="schoolList" | ||
594 | :pagination.sync="pagination" | ||
595 | :search="search" | ||
596 | > | ||
597 | <template slot="items" slot-scope="props"> | ||
598 | <td id="td" class="text-xs-center">{{ props.index + 1}}</td> | ||
599 | <td id="td" class="text-xs-center"> | ||
600 | <v-avatar> | ||
601 | <img :src="props.item.schoolLogoUrl" v-if="props.item.schoolLogoUrl" /> | ||
602 | <img src="/static/icon/user.png" v-else-if="!props.item.schoolLogoUrl" /> | ||
603 | </v-avatar> | ||
604 | </td> | ||
605 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> | ||
606 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> | ||
607 | <td id="td" class="text-xs-center">{{ props.item.city }}</td> | ||
608 | <td id="td" class="text-xs-center">{{ props.item.state }}</td> | ||
609 | <td id="td" class="text-xs-center">{{ props.item.mobile}}</td> | ||
610 | <td class="text-xs-center"> | ||
611 | <span> | ||
612 | <v-tooltip top> | ||
613 | <img | ||
614 | slot="activator" | ||
615 | style="cursor:pointer; width:25px; height:18px; " | ||
616 | class="mr5" | ||
617 | @click="profile(props.item)" | ||
618 | src="/static/icon/eye1.png" | ||
619 | /> | ||
620 | <span>View</span> | ||
621 | </v-tooltip> | ||
622 | <v-tooltip top> | ||
623 | <img | ||
624 | slot="activator" | ||
625 | style="cursor:pointer; width:20px; height:18px; " | ||
626 | class="mr5" | ||
627 | @click="editItem(props.item)" | ||
628 | src="/static/icon/edit1.png" | ||
629 | /> | ||
630 | <span>Edit</span> | ||
631 | </v-tooltip> | ||
632 | <!-- <v-tooltip top> | ||
633 | <img | ||
634 | slot="activator" | ||
635 | style="cursor:pointer; width:20px; height:20px; " | ||
636 | class="mr5" | ||
637 | @click="deleteItem(props.item)" | ||
638 | src="/static/icon/delete1.png" | ||
639 | /> | ||
640 | <span>Delete</span> | ||
641 | </v-tooltip>--> | ||
642 | </span> | ||
643 | </td> | ||
644 | </template> | ||
645 | <v-alert | ||
646 | slot="no-results" | ||
647 | :value="true" | ||
648 | color="error" | ||
649 | icon="warning" | ||
650 | >Your search for "{{ search }}" found no results.</v-alert> | ||
651 | </v-data-table> | ||
652 | </v-tab-item> | ||
653 | |||
654 | <!-- ****** ADD STUDENTS DETAILS****** --> | ||
655 | <v-tab-item> | ||
656 | <v-container fluid> | ||
657 | <v-layout align-center justify-center fill-height> | ||
658 | <v-flex xs12 sm12 md10 lg11> | ||
659 | <!-- <v-container fluid> --> | ||
660 | <v-snackbar | ||
661 | :timeout="timeout" | ||
662 | :top="y === 'top'" | ||
663 | :right="x === 'right'" | ||
664 | :vertical="mode === 'vertical'" | ||
665 | v-model="snackbar" | ||
666 | color="success" | ||
667 | >{{ text }}</v-snackbar> | ||
668 | <v-flex xs12 sm12> | ||
669 | <v-form ref="form" v-model="valid" lazy-validation> | ||
670 | <!-- <v-container fluid> --> | ||
671 | <v-layout> | ||
672 | <v-flex | ||
673 | xs12 | ||
674 | class="text-xs-center text-sm-center text-md-center text-lg-center" | ||
675 | > | ||
676 | <v-avatar size="100px"> | ||
677 | <img src="/static/icon/user.png" v-if="!imageUrl" /> | ||
678 | </v-avatar> | ||
679 | <input | ||
680 | type="file" | ||
681 | style="display: none" | ||
682 | ref="image" | ||
683 | accept="image/*" | ||
684 | @change="onFilePicked" | ||
685 | /> | ||
686 | <img | ||
687 | :src="imageData.imageUrl" | ||
688 | height="150" | ||
689 | v-if="imageUrl" | ||
690 | style="border-radius:50%; width:200px" | ||
691 | /> | ||
692 | </v-flex> | ||
693 | </v-layout> | ||
694 | <v-layout wrap> | ||
695 | <v-flex xs12 sm6> | ||
696 | <v-layout> | ||
697 | <v-flex xs4 sm4 class="pt-4 subheading"> | ||
698 | <label class="right hidden-xs-only hidden-sm-only">Full Name:</label> | ||
699 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label> | ||
700 | </v-flex> | ||
701 | <v-flex xs8 sm8 class="ml-3"> | ||
702 | <v-text-field | ||
703 | v-model="addSchool.name" | ||
704 | placeholder="fill your full Name" | ||
705 | name="name" | ||
706 | type="text" | ||
707 | :rules="nameRules" | ||
708 | required | ||
709 | ></v-text-field> | ||
710 | </v-flex> | ||
711 | </v-layout> | ||
712 | </v-flex> | ||
713 | <v-flex xs12 sm6> | ||
714 | <v-layout> | ||
715 | <v-flex xs4 sm4 class="pt-4 subheading"> | ||
716 | <label class="right">Email ID:</label> | ||
717 | </v-flex> | ||
718 | <v-flex xs8 sm8 class="ml-3"> | ||
719 | <v-text-field | ||
720 | placeholder="fill your email" | ||
721 | :rules="emailRules" | ||
722 | v-model="addSchool.email" | ||
723 | type="text" | ||
724 | required | ||
725 | ></v-text-field> | ||
726 | </v-flex> | ||
727 | </v-layout> | ||
728 | </v-flex> | ||
729 | </v-layout> | ||
730 | <v-layout wrap> | ||
731 | <v-flex xs12 sm6> | ||
732 | <v-layout> | ||
733 | <v-flex xs4 sm4 class="pt-4 subheading"> | ||
734 | <label class="right hidden-sm-only hidden-xs-only">Society Name:</label> | ||
735 | <label | ||
736 | class="right hidden-lg-only hidden-xl-only hidden-md-only" | ||
737 | >SocietyName:</label> | ||
738 | </v-flex> | ||
739 | <v-flex xs8 sm8 class="ml-3"> | ||
740 | <v-text-field | ||
741 | v-model="addSchool.societyName" | ||
742 | placeholder="fill your Society Name" | ||
743 | :rules="cityRules" | ||
744 | required | ||
745 | ></v-text-field> | ||
746 | </v-flex> | ||
747 | </v-layout> | ||
748 | </v-flex> | ||
749 | <v-flex xs12 sm6> | ||
750 | <v-layout> | ||
751 | <v-flex xs4 class="pt-4 subheading"> | ||
752 | <label class="right">City:</label> | ||
753 | </v-flex> | ||
754 | <v-flex xs8 class="ml-3"> | ||
755 | <v-text-field | ||
756 | v-model="addSchool.city" | ||
757 | placeholder="fill your City Name" | ||
758 | name="City" | ||
759 | type="text" | ||
760 | :rules="cityRules" | ||
761 | required | ||
762 | ></v-text-field> | ||
763 | </v-flex> | ||
764 | </v-layout> | ||
765 | </v-flex> | ||
766 | </v-layout> | ||
767 | <v-layout wrap> | ||
768 | <v-flex xs12 sm6> | ||
769 | <v-layout> | ||
770 | <v-flex xs4 class="pt-4 subheading"> | ||
771 | <label class="right">State:</label> | ||
772 | </v-flex> | ||
773 | <v-flex xs8 class="ml-3"> | ||
774 | <v-text-field | ||
775 | v-model="addSchool.state" | ||
776 | placeholder="fill your State Name" | ||
777 | name="state" | ||
778 | type="text" | ||
779 | :rules="stateRules" | ||
780 | required | ||
781 | ></v-text-field> | ||
782 | </v-flex> | ||
783 | </v-layout> | ||
784 | </v-flex> | ||
785 | <v-flex xs12 sm6> | ||
786 | <v-layout> | ||
787 | <v-flex xs4 class="pt-4 subheading"> | ||
788 | <label class="right">Pincode:</label> | ||
789 | </v-flex> | ||
790 | <v-flex xs8 class="ml-3"> | ||
791 | <v-text-field | ||
792 | v-model="addSchool.pinCode" | ||
793 | placeholder="fill your pincode" | ||
794 | name="pincode" | ||
795 | type="number" | ||
796 | :rules="pincode" | ||
797 | required | ||
798 | ></v-text-field> | ||
799 | </v-flex> | ||
800 | </v-layout> | ||
801 | </v-flex> | ||
802 | </v-layout> | ||
803 | <v-layout wrap> | ||
804 | <v-flex xs12 sm6> | ||
805 | <v-layout> | ||
806 | <v-flex xs4 class="pt-4 subheading"> | ||
807 | <label class="right">Fax No:</label> | ||
808 | </v-flex> | ||
809 | <v-flex xs8 class="ml-3"> | ||
810 | <v-text-field v-model="addSchool.faxNo" label="fill your Fax No" required></v-text-field> | ||
811 | </v-flex> | ||
812 | </v-layout> | ||
813 | </v-flex> | ||
814 | <v-flex xs12 sm6> | ||
815 | <v-layout> | ||
816 | <v-flex xs4 class="pt-4 subheading"> | ||
817 | <label class="right hidden-xs-only hidden-sm-only">Country:</label> | ||
818 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Country:</label> | ||
819 | </v-flex> | ||
820 | <v-flex xs8 class="ml-3"> | ||
821 | <v-autocomplete | ||
822 | v-model="addSchool.country" | ||
823 | :items="countries" | ||
824 | :rules="country" | ||
825 | placeholder="Select Country Name" | ||
826 | required | ||
827 | ></v-autocomplete> | ||
828 | </v-flex> | ||
829 | </v-layout> | ||
830 | </v-flex> | ||
831 | </v-layout> | ||
832 | <v-layout wrap> | ||
833 | <v-flex xs12 sm6> | ||
834 | <v-layout> | ||
835 | <v-flex xs4 class="pt-4 subheading"> | ||
836 | <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label> | ||
837 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label> | ||
838 | </v-flex> | ||
839 | <v-flex xs8 class="ml-3"> | ||
840 | <v-text-field | ||
841 | v-model="addSchool.mobile" | ||
842 | placeholder="fill your MobileNo" | ||
843 | name="mobileNo" | ||
844 | type="number" | ||
845 | :rules="mobileNoRules" | ||
846 | required | ||
847 | ></v-text-field> | ||
848 | </v-flex> | ||
849 | </v-layout> | ||
850 | </v-flex> | ||
851 | <v-flex xs12 sm6> | ||
852 | <v-layout> | ||
853 | <v-flex xs4 class="pt-4 subheading"> | ||
854 | <label class="right hidden-xs-only hidden-sm-only">LandLine No:</label> | ||
855 | <label | ||
856 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
857 | >LandLineNo:</label> | ||
858 | </v-flex> | ||
859 | <v-flex xs8 class="ml-3"> | ||
860 | <v-text-field | ||
861 | v-model="addSchool.landLineNo" | ||
862 | :items="countries" | ||
863 | :rules="landlineNoRule" | ||
864 | placeholder="fill your LandLine No" | ||
865 | type="number" | ||
866 | required | ||
867 | ></v-text-field> | ||
868 | </v-flex> | ||
869 | </v-layout> | ||
870 | </v-flex> | ||
871 | </v-layout> | ||
872 | <v-layout wrap> | ||
873 | <v-flex xs12 sm6> | ||
874 | <v-layout> | ||
875 | <v-flex xs4 class="pt-4 subheading"> | ||
876 | <label class="right hidden-xs-only hidden-sm-only">Registration No:</label> | ||
877 | <label | ||
878 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
879 | >Registration-No:</label> | ||
880 | </v-flex> | ||
881 | <v-flex xs8 class="ml-3"> | ||
882 | <v-text-field | ||
883 | v-model="addSchool.registrationNo" | ||
884 | placeholder="Fill your Registration No" | ||
885 | required | ||
886 | ></v-text-field> | ||
887 | </v-flex> | ||
888 | </v-layout> | ||
889 | </v-flex> | ||
890 | <v-flex xs12 sm6> | ||
891 | <v-layout> | ||
892 | <v-flex xs4 class="pt-4 subheading"> | ||
893 | <label class="right hidden-xs-only hidden-sm-only">School Details:</label> | ||
894 | <label | ||
895 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
896 | >SchoolDetails:</label> | ||
897 | </v-flex> | ||
898 | <v-flex xs8 class="ml-3"> | ||
899 | <v-text-field | ||
900 | v-model="addSchool.schoolDetails" | ||
901 | placeholder="Fill your School Details" | ||
902 | :rules="schoolDetailRule" | ||
903 | required | ||
904 | ></v-text-field> | ||
905 | </v-flex> | ||
906 | </v-layout> | ||
907 | </v-flex> | ||
908 | </v-layout> | ||
909 | <v-layout wrap> | ||
910 | <v-flex xs12 sm6> | ||
911 | <v-layout> | ||
912 | <v-flex xs4 class="pt-4 subheading"> | ||
913 | <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> | ||
914 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod :</label> | ||
915 | </v-flex> | ||
916 | <v-flex xs8 class="ml-3"> | ||
917 | <v-text-field | ||
918 | label="Select Image" | ||
919 | @click="pickFile" | ||
920 | v-model="imageName" | ||
921 | append-icon="attach_file" | ||
922 | ></v-text-field> | ||
923 | </v-flex> | ||
924 | </v-layout> | ||
925 | </v-flex> | ||
926 | <v-flex xs12 sm6> | ||
927 | <v-layout> | ||
928 | <v-flex xs4 class="pt-4 subheading"> | ||
929 | <label class="right hidden-xs-only hidden-sm-only">Academic Year:</label> | ||
930 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Year:</label> | ||
931 | </v-flex> | ||
932 | <v-flex xs8 class="ml-3"> | ||
933 | <v-text-field | ||
934 | v-model="addSchool.establishmentYear" | ||
935 | placeholder="fill your Academic Year" | ||
936 | :rules="establishmentYearRules" | ||
937 | required | ||
938 | ></v-text-field> | ||
939 | </v-flex> | ||
940 | </v-layout> | ||
941 | </v-flex> | ||
942 | </v-layout> | ||
943 | <v-layout wrap> | ||
944 | <v-flex xs12 sm6> | ||
945 | <v-layout> | ||
946 | <v-flex xs4 sm4 class="pt-4 subheading"> | ||
947 | <label class="right hidden-xs-only hidden-sm-only">WebSite Url:</label> | ||
948 | <label | ||
949 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | ||
950 | >WebSiteUrl:</label> | ||
951 | </v-flex> | ||
952 | <v-flex xs8 sm8 class="ml-3"> | ||
953 | <v-text-field | ||
954 | name="input-4-3" | ||
955 | v-model="addSchool.websiteUrl" | ||
956 | :rules="presentAddress" | ||
957 | placeholder="fill Your Address" | ||
958 | required | ||
959 | ></v-text-field> | ||
960 | </v-flex> | ||
961 | </v-layout> | ||
962 | </v-flex> | ||
963 | <v-flex xs12 sm6> | ||
964 | <v-layout> | ||
965 | <v-flex xs4 sm4 class="pt-4 subheading"> | ||
966 | <label class="right">Address:</label> | ||
967 | </v-flex> | ||
968 | <v-flex xs8 sm8 class="ml-3"> | ||
969 | <v-text-field | ||
970 | name="input-4-3" | ||
971 | v-model="addSchool.address" | ||
972 | :rules="presentAddress" | ||
973 | placeholder="fill Your Address" | ||
974 | required | ||
975 | ></v-text-field> | ||
976 | </v-flex> | ||
977 | </v-layout> | ||
978 | </v-flex> | ||
979 | </v-layout> | ||
980 | <v-layout> | ||
981 | <v-flex xs12 sm11 offset-md1> | ||
982 | <v-layout> | ||
983 | <v-flex xs6> | ||
984 | <v-btn round dark @click="clear()">Clear</v-btn> | ||
985 | </v-flex> | ||
986 | <v-flex xs6> | ||
987 | <v-btn @click="submit" round dark :loading="loading" class="right">Add</v-btn> | ||
988 | </v-flex> | ||
989 | </v-layout> | ||
990 | </v-flex> | ||
991 | </v-layout> | ||
992 | </v-form> | ||
993 | </v-flex> | ||
994 | </v-flex> | ||
995 | </v-layout> | ||
996 | </v-container> | ||
997 | </v-tab-item> | ||
998 | </v-tabs> | ||
999 | <div class="loader" v-if="showLoader"> | ||
1000 | <v-progress-circular indeterminate color="white"></v-progress-circular> | ||
1001 | </div> | ||
1002 | </div> | ||
1003 | </template> | ||
1004 | |||
1005 | <script> | ||
1006 | import http from "@/Services/http.js"; | ||
1007 | import moment from "moment"; | ||
1008 | import countryList from "@/script/country.js"; | ||
1009 | |||
1010 | export default { | ||
1011 | data: () => ({ | ||
1012 | e2: 0, | ||
1013 | snackbar: false, | ||
1014 | y: "top", | ||
1015 | x: "right", | ||
1016 | mode: "", | ||
1017 | timeout: 3000, | ||
1018 | text: "", | ||
1019 | showLoader: false, | ||
1020 | loading: false, | ||
1021 | date: null, | ||
1022 | search: "", | ||
1023 | menu: false, | ||
1024 | menu1: false, | ||
1025 | dialog: false, | ||
1026 | dialog1: false, | ||
1027 | valid: true, | ||
1028 | isActive: true, | ||
1029 | newActive: false, | ||
1030 | pagination: { | ||
1031 | rowsPerPage: 15 | ||
1032 | }, | ||
1033 | imageData: {}, | ||
1034 | imageName: "", | ||
1035 | imageUrl: "", | ||
1036 | imageFile: "", | ||
1037 | nameRules: [v => !!v || " Full Name is required"], | ||
1038 | dateRules: [v => !!v || " DOB is required"], | ||
1039 | cityRules: [v => !!v || " City Name is required"], | ||
1040 | pincode: [v => !!v || " Pincode is required"], | ||
1041 | country: [v => !!v || " Country Name is required"], | ||
1042 | permanentAddress: [v => !!v || " Permanent Address is requiclearred"], | ||
1043 | presentAddress: [v => !!v || " Present Address is required"], | ||
1044 | landlineNoRule: [v => !!v || " Present Address is required"], | ||
1045 | mobileNoRules: [v => !!v || "Mobile Number is required"], | ||
1046 | stateRules: [v => !!v || "State Name is required"], | ||
1047 | schoolDetailRule: [v => !!v || "school Detail is required"], | ||
1048 | sectionRules: [v => !!v || " Section Name is required"], | ||
1049 | genderRules: [v => !!v || " Select Gender is required"], | ||
1050 | establishmentYearRules: [v => !!v || " Academic Year is required"], | ||
1051 | errorMessages: "", | ||
1052 | emailRules: [ | ||
1053 | v => !!v || "E-mail is required", | ||
1054 | v => | ||
1055 | /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || | ||
1056 | "E-mail must be valid" | ||
1057 | ], | ||
1058 | countries: [], | ||
1059 | headers: [ | ||
1060 | { | ||
1061 | text: "No.", | ||
1062 | align: "center", | ||
1063 | sortable: false, | ||
1064 | value: "rollNo" | ||
1065 | }, | ||
1066 | { | ||
1067 | text: "school Logo", | ||
1068 | value: "schoolLogoUrl", | ||
1069 | sortable: false, | ||
1070 | align: "center" | ||
1071 | }, | ||
1072 | { text: "Name", value: "name", sortable: false, align: "center" }, | ||
1073 | { text: "Email", value: "email", sortable: false, align: "center" }, | ||
1074 | { text: "City", value: "city", sortable: false, align: "center" }, | ||
1075 | { | ||
1076 | text: "State", | ||
1077 | value: "state", | ||
1078 | sortable: false, | ||
1079 | align: "center" | ||
1080 | }, | ||
1081 | { | ||
1082 | text: "Mobile", | ||
1083 | value: "mobile", | ||
1084 | sortable: false, | ||
1085 | align: "center" | ||
1086 | }, | ||
1087 | { text: "Action", value: "", sortable: false, align: "center" } | ||
1088 | ], | ||
1089 | schoolList: [], | ||
1090 | editedIndex: -1, | ||
1091 | addSchool: { | ||
1092 | role: "ADMIN" | ||
1093 | }, | ||
1094 | editedItem: {} | ||
1095 | }), | ||
1096 | // watch: { | ||
1097 | // menu(val) { | ||
1098 | // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); | ||
1099 | // }, | ||
1100 | // menu1(val) { | ||
1101 | // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); | ||
1102 | // } | ||
1103 | // }, | ||
1104 | methods: { | ||
1105 | getSchool() { | ||
1106 | this.showLoader = true; | ||
1107 | http() | ||
1108 | .get("/getSchoolList", { | ||
1109 | headers: { Authorization: "Bearer " + this.token } | ||
1110 | }) | ||
1111 | .then(response => { | ||
1112 | this.schoolList = response.data.data; | ||
1113 | this.showLoader = false; | ||
1114 | }) | ||
1115 | .catch(error => { | ||
1116 | console.log("err====>", err); | ||
1117 | this.showLoader = false; | ||
1118 | }); | ||
1119 | }, | ||
1120 | pickFile() { | ||
1121 | this.$refs.image.click(); | ||
1122 | }, | ||
1123 | dates: function(date) { | ||
1124 | return moment(date).format("MMMM DD, YYYY"); | ||
1125 | }, | ||
1126 | onFilePicked(e) { | ||
1127 | // console.log(e) | ||
1128 | const files = e.target.files; | ||
1129 | this.imageData.upload = e.target.files[0]; | ||
1130 | if (files[0] !== undefined) { | ||
1131 | this.imageName = files[0].name; | ||
1132 | if (this.imageName.lastIndexOf(".") <= 0) { | ||
1133 | return; | ||
1134 | } | ||
1135 | const fr = new FileReader(); | ||
1136 | fr.readAsDataURL(files[0]); | ||
1137 | fr.addEventListener("load", () => { | ||
1138 | this.imageUrl = fr.result; | ||
1139 | this.imageFile = files[0]; // this is an image file that can be sent to server... | ||
1140 | this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | ||
1141 | }); | ||
1142 | } else { | ||
1143 | this.imageName = ""; | ||
1144 | this.imageFile = ""; | ||
1145 | this.imageUrl = ""; | ||
1146 | } | ||
1147 | }, | ||
1148 | editItem(item) { | ||
1149 | this.editedIndex = this.schoolList.indexOf(item); | ||
1150 | this.editedItem = Object.assign({}, item); | ||
1151 | // if(this.editedItem.dob != undefined){ | ||
1152 | // this.editedItem.dob = this.editedItem.dob.substring(0, 10) | ||
1153 | // }else if(this.editedItem.dob = undefined){ | ||
1154 | // this.editedItem.dob = '' | ||
1155 | // } | ||
1156 | this.editedItem.dob = | ||
1157 | this.editedItem.dob != undefined | ||
1158 | ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10)) | ||
1159 | : (this.editedItem.dob = ""); | ||
1160 | this.dialog = true; | ||
1161 | }, | ||
1162 | profile(item) { | ||
1163 | console.log("item", item); | ||
1164 | this.editedIndex = this.schoolList.indexOf(item); | ||
1165 | this.editedItem = Object.assign({}, item); | ||
1166 | this.dialog1 = true; | ||
1167 | }, | ||
1168 | // deleteItem(item) { | ||
1169 | // let deleteStudent = { | ||
1170 | // studentId: item._id | ||
1171 | // }; | ||
1172 | // http() | ||
1173 | // .delete( | ||
1174 | // "/deleteStudent", | ||
1175 | // confirm("Are you sure you want to delete this?") && { | ||
1176 | // params: deleteStudent | ||
1177 | // } | ||
1178 | // ) | ||
1179 | // .then(response => { | ||
1180 | // // console.log("deleteUers",deleteStudent) | ||
1181 | // this.snackbar = true; | ||
1182 | // this.text = "Successfully delete Existing Student"; | ||
1183 | // this.getStudentList(); | ||
1184 | // }) | ||
1185 | // .catch(error => { | ||
1186 | // // console.log(error); | ||
1187 | // }); | ||
1188 | // }, | ||
1189 | activeTab(type) { | ||
1190 | switch (type) { | ||
1191 | case "existing": | ||
1192 | this.newActive = false; | ||
1193 | this.isActive = true; | ||
1194 | break; | ||
1195 | |||
1196 | default: | ||
1197 | this.newActive = true; | ||
1198 | this.isActive = false; | ||
1199 | break; | ||
1200 | } | ||
1201 | }, | ||
1202 | close() { | ||
1203 | this.dialog = false; | ||
1204 | setTimeout(() => { | ||
1205 | this.editedItem = Object.assign({}, this.defaultItem); | ||
1206 | this.editedIndex = -1; | ||
1207 | }, 300); | ||
1208 | }, | ||
1209 | close1() { | ||
1210 | this.dialog1 = false; | ||
1211 | }, | ||
1212 | submit() { | ||
1213 | if (this.$refs.form.validate()) { | ||
1214 | if (this.imageUrl) { | ||
1215 | var str = this.imageUrl; | ||
1216 | const [baseUrl, imageUrl] = str.split(/,/); | ||
1217 | this.addSchool.upload = imageUrl; | ||
1218 | } | ||
1219 | this.loading = true; | ||
1220 | http() | ||
1221 | .post("/createSchool", this.addSchool) | ||
1222 | .then(response => { | ||
1223 | this.snackbar = true; | ||
1224 | this.text = "New School added successfully"; | ||
1225 | this.clear(); | ||
1226 | this.getSchool(); | ||
1227 | this.loading = false; | ||
1228 | }) | ||
1229 | .catch(error => { | ||
1230 | // console.log(error); | ||
1231 | this.snackbar = true; | ||
1232 | this.text = error.response.data.message; | ||
1233 | this.loading = false; | ||
1234 | }); | ||
1235 | } | ||
1236 | }, | ||
1237 | clear() { | ||
1238 | this.$refs.form.reset(); | ||
1239 | this.imageUrl = ""; | ||
1240 | }, | ||
1241 | save() { | ||
1242 | if (this.imageUrl) { | ||
1243 | var str = this.imageUrl; | ||
1244 | const [baseUrl, imageUrl] = str.split(/,/); | ||
1245 | this.editedItem.upload = imageUrl; | ||
1246 | } | ||
1247 | this.editedItem.schoolId = this.editedItem._id; | ||
1248 | http() | ||
1249 | .put("/updateSchool", this.editedItem) | ||
1250 | .then(response => { | ||
1251 | this.snackbar = true; | ||
1252 | this.text = "Successfully School Existing User"; | ||
1253 | this.imageUrl = ""; | ||
1254 | this.getSchool(); | ||
1255 | this.close(); | ||
1256 | }) | ||
1257 | .catch(error => { | ||
1258 | // console.log(error); | ||
1259 | if ((this.snackbar = true)) { | ||
1260 | this.text = error.response.data.statusText; | ||
1261 | } | ||
1262 | }); | ||
1263 | } | ||
1264 | }, | ||
1265 | mounted() { | ||
1266 | const getCountryList = countryList(); | ||
1267 | this.countries = getCountryList; | ||
1268 | this.token = this.$store.state.token; | ||
1269 | this.getSchool(); | ||
1270 | }, | ||
1271 | created() { | ||
1272 | this.$root.$on("app:search", search => { | ||
1273 | this.search = search; | ||
1274 | }); | ||
1275 | }, | ||
1276 | beforeDestroy() { | ||
1277 | // dont forget to remove the listener | ||
1278 | this.$root.$off("app:search"); | ||
1279 | } | ||
1280 | }; | ||
1281 | </script> | ||
1282 | <style scoped> | ||
1283 | .active { | ||
1284 | background-color: gray; | ||
1285 | color: white !important; | ||
1286 | } | ||
1287 | .activebtn { | ||
1288 | color: black !important; | ||
1289 | } | ||
1290 | </style> |
src/pages/Section/section.vue
1 | <template> | 1 | <template> |
2 | <v-app id="pages-dasboard"> | 2 | <v-app id="pages-dasboard"> |
3 | <v-tabs grow slider-color="gray"> | 3 | <v-tabs grow slider-color="gray"> |
4 | <v-tab | 4 | <v-tab |
5 | ripple | 5 | ripple |
6 | @click="activeTab('existing')" | 6 | @click="activeTab('existing')" |
7 | v-bind:class="{ active: isActive }" | 7 | v-bind:class="{ active: isActive }" |
8 | id="tab" | 8 | id="tab" |
9 | class="subheading" | 9 | class="subheading" |
10 | >Existing Section</v-tab> | 10 | >Existing Section</v-tab> |
11 | <v-tab | 11 | <v-tab |
12 | ripple | 12 | ripple |
13 | @click="activeTab('new')" | 13 | @click="activeTab('new')" |
14 | v-bind:class="{ active: newActive }" | 14 | v-bind:class="{ active: newActive }" |
15 | id="tab1" | 15 | id="tab1" |
16 | User | 16 | User |
17 | class="subheading" | 17 | class="subheading" |
18 | >Add New Section</v-tab> | 18 | >Add New Section</v-tab> |
19 | 19 | ||
20 | <!-- ****** EDIT SECTION ****** --> | 20 | <!-- ****** EDIT SECTION ****** --> |
21 | <v-tab-item> | 21 | <v-tab-item> |
22 | <v-snackbar | 22 | <v-snackbar |
23 | :timeout="timeout" | 23 | :timeout="timeout" |
24 | :top="y === 'top'" | 24 | :top="y === 'top'" |
25 | :right="x === 'right'" | 25 | :right="x === 'right'" |
26 | :vertical="mode === 'vertical'" | 26 | :vertical="mode === 'vertical'" |
27 | v-model="snackbar" | 27 | v-model="snackbar" |
28 | color="success" | 28 | color="success" |
29 | >{{ text }}</v-snackbar> | 29 | >{{ text }}</v-snackbar> |
30 | <v-dialog v-model="dialog" max-width="600px"> | 30 | <v-dialog v-model="dialog" max-width="600px"> |
31 | <v-toolbar color="grey lighten-2"> | 31 | <v-toolbar color="grey lighten-2"> |
32 | <v-spacer></v-spacer> | 32 | <v-spacer></v-spacer> |
33 | <v-toolbar-title> | 33 | <v-toolbar-title> |
34 | <h3>Edit Section</h3> | 34 | <h3>Edit Section</h3> |
35 | </v-toolbar-title> | 35 | </v-toolbar-title> |
36 | <v-spacer></v-spacer> | 36 | <v-spacer></v-spacer> |
37 | </v-toolbar> | 37 | </v-toolbar> |
38 | <v-card> | 38 | <v-card> |
39 | <v-container> | 39 | <v-container> |
40 | <v-layout wrap justify-center> | 40 | <v-layout wrap justify-center> |
41 | <v-flex xs12 sm9> | 41 | <v-flex xs12 sm9> |
42 | <v-form> | 42 | <v-form> |
43 | <v-layout> | 43 | <v-layout> |
44 | <v-flex xs5 sm4 class="pt-4 subheading"> | 44 | <v-flex xs5 sm4 class="pt-4 subheading"> |
45 | <label class="pl-3">Class Name:</label> | 45 | <label class="pl-3">Class Name:</label> |
46 | <!-- <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> --> | 46 | <!-- <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> --> |
47 | </v-flex> | 47 | </v-flex> |
48 | <v-flex xs7 sm8> | 48 | <v-flex xs7 sm8> |
49 | <v-select | 49 | <v-autocomplete |
50 | :items="addclass" | 50 | :items="addclass" |
51 | :label="editedItem.classData.classNum" | 51 | :label="editedItem.classData.classNum" |
52 | v-model="editItem.classId" | 52 | v-model="editItem.classId" |
53 | item-text="classNum" | 53 | item-text="classNum" |
54 | item-value="_id" | 54 | item-value="_id" |
55 | name="Select Class" | 55 | ></v-autocomplete> |
56 | ></v-select> | ||
57 | </v-flex> | 56 | </v-flex> |
58 | </v-layout> | 57 | </v-layout> |
59 | <v-layout> | 58 | <v-layout> |
60 | <v-flex xs5 sm4 class="pt-4 subheading"> | 59 | <v-flex xs5 sm4 class="pt-4 subheading"> |
61 | <label>Section Name:</label> | 60 | <label>Section Name:</label> |
62 | </v-flex> | 61 | </v-flex> |
63 | <v-flex xs7 sm8> | 62 | <v-flex xs7 sm8> |
64 | <v-autocomplete | 63 | <v-autocomplete |
65 | v-model="editedItem.name" | 64 | v-model="editedItem.name" |
66 | placeholder="fill your Section Name" | 65 | placeholder="fill your Section Name" |
67 | :items="SectionName" | 66 | :items="SectionName" |
68 | ></v-autocomplete> | 67 | ></v-autocomplete> |
69 | </v-flex> | 68 | </v-flex> |
70 | </v-layout> | 69 | </v-layout> |
71 | <v-layout> | 70 | <v-layout> |
72 | <v-flex xs5 sm4 class="pt-4 subheading"> | 71 | <v-flex xs5 sm4 class="pt-4 subheading"> |
73 | <label>Class Incharge:</label> | 72 | <label>Class Incharge:</label> |
74 | </v-flex> | 73 | </v-flex> |
75 | <v-flex xs7 sm8> | 74 | <v-flex xs7 sm8> |
76 | <v-select | 75 | <v-select |
77 | :items="teacherList" | 76 | :items="teacherList" |
78 | v-model="editedItem.classInchargeId" | 77 | v-model="editedItem.classInchargeId" |
79 | :label="editedItem.teacherData[0].name" | 78 | :label="editedItem.teacherData[0].name" |
80 | item-text="name" | 79 | item-text="name" |
81 | item-value="_id" | 80 | item-value="_id" |
82 | ></v-select> | 81 | ></v-select> |
83 | </v-flex> | 82 | </v-flex> |
84 | </v-layout> | 83 | </v-layout> |
85 | <v-card-actions> | 84 | <v-card-actions> |
86 | <v-btn round dark @click.native="close">Cancel</v-btn> | 85 | <v-btn round dark @click.native="close">Cancel</v-btn> |
87 | <v-spacer></v-spacer> | 86 | <v-spacer></v-spacer> |
88 | <v-btn round dark @click="save">Save</v-btn> | 87 | <v-btn round dark @click="save">Save</v-btn> |
89 | </v-card-actions> | 88 | </v-card-actions> |
90 | </v-form> | 89 | </v-form> |
91 | </v-flex> | 90 | </v-flex> |
92 | </v-layout> | 91 | </v-layout> |
93 | </v-container> | 92 | </v-container> |
94 | </v-card> | 93 | </v-card> |
95 | </v-dialog> | 94 | </v-dialog> |
96 | 95 | ||
97 | <!-- ****** PROFILE VIEW SECTION DATA ****** --> | 96 | <!-- ****** PROFILE VIEW SECTION DATA ****** --> |
98 | 97 | ||
99 | <v-dialog v-model="dialog1" max-width="600px"> | 98 | <v-dialog v-model="dialog1" max-width="600px"> |
100 | <v-toolbar color="grey lighten-2"> | 99 | <v-toolbar color="grey lighten-2"> |
101 | <v-spacer></v-spacer> | 100 | <v-spacer></v-spacer> |
102 | <v-toolbar-title> | 101 | <v-toolbar-title> |
103 | <h3>Section</h3> | 102 | <h3>Section</h3> |
104 | </v-toolbar-title> | 103 | </v-toolbar-title> |
105 | <v-spacer></v-spacer> | 104 | <v-spacer></v-spacer> |
106 | <v-icon @click="close1">close</v-icon> | 105 | <v-icon @click="close1">close</v-icon> |
107 | </v-toolbar> | 106 | </v-toolbar> |
108 | <v-card> | 107 | <v-card> |
109 | <v-flex align-center justify-center layout text-xs-center> | 108 | <v-flex align-center justify-center layout text-xs-center> |
110 | <v-avatar size="50px" style="position:absolute; top:20px;"> | 109 | <v-avatar size="50px" style="position:absolute; top:20px;"> |
111 | <img src="/static/icon/user.png" /> | 110 | <img src="/static/icon/user.png" /> |
112 | </v-avatar> | 111 | </v-avatar> |
113 | </v-flex> | 112 | </v-flex> |
114 | <v-card-text> | 113 | <v-card-text> |
115 | <v-container grid-list-md> | 114 | <v-container grid-list-md> |
116 | <v-layout wrap> | 115 | <v-layout wrap> |
117 | <v-flex> | 116 | <v-flex> |
118 | <br /> | 117 | <br /> |
119 | <br /> | 118 | <br /> |
120 | <v-layout> | 119 | <v-layout> |
121 | <v-flex xs7 sm6> | 120 | <v-flex xs7 sm6> |
122 | <h5 class="right my-1 hidden-xs-only hidden-sm-only"> | 121 | <h5 class="right my-1 hidden-xs-only hidden-sm-only"> |
123 | <b>Class Name:</b> | 122 | <b>Class Name:</b> |
124 | </h5> | 123 | </h5> |
125 | <h5 class="right my-1 hidden-lg-only hidden-md-only hidden-xl-only"> | 124 | <h5 class="right my-1 hidden-lg-only hidden-md-only hidden-xl-only"> |
126 | <b>Class:</b> | 125 | <b>Class:</b> |
127 | </h5> | 126 | </h5> |
128 | </v-flex> | 127 | </v-flex> |
129 | <v-flex sm6 xs5> | 128 | <v-flex sm6 xs5> |
130 | <h5 class="my-1">{{ editedItem.classData.classNum }}</h5> | 129 | <h5 class="my-1">{{ editedItem.classData.classNum }}</h5> |
131 | </v-flex> | 130 | </v-flex> |
132 | </v-layout> | 131 | </v-layout> |
133 | <v-layout> | 132 | <v-layout> |
134 | <v-flex xs7 sm6> | 133 | <v-flex xs7 sm6> |
135 | <h5 class="right my-1"> | 134 | <h5 class="right my-1"> |
136 | <b>Section Name:</b> | 135 | <b>Section Name:</b> |
137 | </h5> | 136 | </h5> |
138 | </v-flex> | 137 | </v-flex> |
139 | <v-flex sm6 xs5> | 138 | <v-flex sm6 xs5> |
140 | <h5 class="my-1">{{ editedItem.name }}</h5> | 139 | <h5 class="my-1">{{ editedItem.name }}</h5> |
141 | </v-flex> | 140 | </v-flex> |
142 | </v-layout> | 141 | </v-layout> |
143 | <v-layout> | 142 | <v-layout> |
144 | <v-flex xs7 sm6> | 143 | <v-flex xs7 sm6> |
145 | <h5 class="right my-1"> | 144 | <h5 class="right my-1"> |
146 | <b>Class Incharge:</b> | 145 | <b>Class Incharge:</b> |
147 | </h5> | 146 | </h5> |
148 | </v-flex> | 147 | </v-flex> |
149 | <v-flex sm6 xs5> | 148 | <v-flex sm6 xs5> |
150 | <h5 class="my-1">{{ editedItem.teacherData[0].name }}</h5> | 149 | <h5 class="my-1">{{ editedItem.teacherData[0].name }}</h5> |
151 | </v-flex> | 150 | </v-flex> |
152 | </v-layout> | 151 | </v-layout> |
153 | <v-layout> | 152 | <v-layout> |
154 | <v-flex xs7 sm6> | 153 | <v-flex xs7 sm6> |
155 | <h5 class="right my-1"> | 154 | <h5 class="right my-1"> |
156 | <b>Session:</b> | 155 | <b>Session:</b> |
157 | </h5> | 156 | </h5> |
158 | </v-flex> | 157 | </v-flex> |
159 | <v-flex sm6 xs5> | 158 | <v-flex sm6 xs5> |
160 | <h5 class="my-1">{{ editedItem.session }}</h5> | 159 | <h5 class="my-1">{{ editedItem.session }}</h5> |
161 | </v-flex> | 160 | </v-flex> |
162 | </v-layout> | 161 | </v-layout> |
163 | </v-flex> | 162 | </v-flex> |
164 | </v-layout> | 163 | </v-layout> |
165 | </v-container> | 164 | </v-container> |
166 | </v-card-text> | 165 | </v-card-text> |
167 | </v-card> | 166 | </v-card> |
168 | </v-dialog> | 167 | </v-dialog> |
169 | 168 | ||
170 | <v-snackbar | 169 | <v-snackbar |
171 | :timeout="timeout" | 170 | :timeout="timeout" |
172 | :top="y === 'top'" | 171 | :top="y === 'top'" |
173 | :right="x === 'right'" | 172 | :right="x === 'right'" |
174 | :vertical="mode === 'vertical'" | 173 | :vertical="mode === 'vertical'" |
175 | v-model="snackbar" | 174 | v-model="snackbar" |
176 | color="success" | 175 | color="success" |
177 | >{{ text }}</v-snackbar> | 176 | >{{ text }}</v-snackbar> |
178 | 177 | ||
179 | <!-- ****** EXISTING-USERS StudentS Table ****** --> | 178 | <!-- ****** EXISTING-USERS StudentS Table ****** --> |
180 | 179 | ||
181 | <v-data-table | 180 | <v-data-table |
182 | :headers="headers" | 181 | :headers="headers" |
183 | :items="desserts" | 182 | :items="desserts" |
184 | :pagination.sync="pagination" | 183 | :pagination.sync="pagination" |
185 | :search="search" | 184 | :search="search" |
186 | > | 185 | > |
187 | <template slot="items" slot-scope="props"> | 186 | <template slot="items" slot-scope="props"> |
188 | <td id="td" class="text-xs-center">{{ props.index + 1}}</td> | 187 | <td id="td" class="text-xs-center">{{ props.index + 1}}</td> |
189 | <td id="td" class="text-xs-center">{{ props.item.classData.classNum}}</td> | 188 | <td id="td" class="text-xs-center">{{ props.item.classData.classNum}}</td> |
190 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> | 189 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> |
191 | <td id="td" class="text-xs-center">{{ props.item.session}}</td> | 190 | <td id="td" class="text-xs-center">{{ props.item.session}}</td> |
192 | 191 | ||
193 | <td class="text-xs-center"> | 192 | <td class="text-xs-center"> |
194 | <span> | 193 | <span> |
195 | <v-tooltip top> | 194 | <v-tooltip top> |
196 | <img | 195 | <img |
197 | slot="activator" | 196 | slot="activator" |
198 | style="cursor:pointer; width:25px; height:18px; " | 197 | style="cursor:pointer; width:25px; height:18px; " |
199 | class="mr5" | 198 | class="mr5" |
200 | @click="profile(props.item)" | 199 | @click="profile(props.item)" |
201 | src="/static/icon/eye1.png" | 200 | src="/static/icon/eye1.png" |
202 | /> | 201 | /> |
203 | <span>View</span> | 202 | <span>View</span> |
204 | </v-tooltip> | 203 | </v-tooltip> |
205 | <v-tooltip top> | 204 | <v-tooltip top> |
206 | <img | 205 | <img |
207 | slot="activator" | 206 | slot="activator" |
208 | style="cursor:pointer; width:20px; height:18px; " | 207 | style="cursor:pointer; width:20px; height:18px; " |
209 | class="mr5" | 208 | class="mr5" |
210 | @click="editItem(props.item)" | 209 | @click="editItem(props.item)" |
211 | src="/static/icon/edit1.png" | 210 | src="/static/icon/edit1.png" |
212 | /> | 211 | /> |
213 | <span>Edit</span> | 212 | <span>Edit</span> |
214 | </v-tooltip> | 213 | </v-tooltip> |
215 | <v-tooltip top> | 214 | <v-tooltip top> |
216 | <img | 215 | <img |
217 | slot="activator" | 216 | slot="activator" |
218 | style="cursor:pointer; width:20px; height:20px; " | 217 | style="cursor:pointer; width:20px; height:20px; " |
219 | class="mr5" | 218 | class="mr5" |
220 | @click="deleteItem(props.item)" | 219 | @click="deleteItem(props.item)" |
221 | src="/static/icon/delete1.png" | 220 | src="/static/icon/delete1.png" |
222 | /> | 221 | /> |
223 | <span>Delete</span> | 222 | <span>Delete</span> |
224 | </v-tooltip> | 223 | </v-tooltip> |
225 | </span> | 224 | </span> |
226 | </td> | 225 | </td> |
227 | </template> | 226 | </template> |
228 | <v-alert | 227 | <v-alert |
229 | slot="no-results" | 228 | slot="no-results" |
230 | :value="true" | 229 | :value="true" |
231 | color="error" | 230 | color="error" |
232 | icon="warning" | 231 | icon="warning" |
233 | >Your search for "{{ search }}" found no results.</v-alert> | 232 | >Your search for "{{ search }}" found no results.</v-alert> |
234 | </v-data-table> | 233 | </v-data-table> |
235 | </v-tab-item> | 234 | </v-tab-item> |
236 | 235 | ||
237 | <!-- ****** ADD multiple Students ****** --> | 236 | <!-- ****** ADD multiple Students ****** --> |
238 | 237 | ||
239 | <v-tab-item> | 238 | <v-tab-item> |
240 | <v-container> | 239 | <v-container> |
241 | <v-snackbar | 240 | <v-snackbar |
242 | :timeout="timeout" | 241 | :timeout="timeout" |
243 | :top="y === 'top'" | 242 | :top="y === 'top'" |
244 | :right="x === 'right'" | 243 | :right="x === 'right'" |
245 | :vertical="mode === 'vertical'" | 244 | :vertical="mode === 'vertical'" |
246 | v-model="snackbar" | 245 | v-model="snackbar" |
247 | color="success" | 246 | color="success" |
248 | >{{ text }}</v-snackbar> | 247 | >{{ text }}</v-snackbar> |
249 | <v-flex xs12 sm8 offset-sm2 class="top"> | 248 | <v-flex xs12 sm8 offset-sm2 class="top"> |
250 | <v-card flat> | 249 | <v-card flat> |
251 | <v-container fluid fill-height> | 250 | <v-container fluid fill-height> |
252 | <v-layout align-center> | 251 | <v-layout align-center> |
253 | <v-flex xs12 class="mt-4"> | 252 | <v-flex xs12 class="mt-4"> |
254 | <v-form ref="form" v-model="valid" lazy-validation> | 253 | <v-form ref="form" v-model="valid" lazy-validation> |
255 | <v-layout> | 254 | <v-layout> |
256 | <v-flex xs4 class="pt-4 subheading"> | 255 | <v-flex xs4 class="pt-4 subheading"> |
257 | <label class="right">Section Name:</label> | 256 | <label class="right">Section Name:</label> |
258 | </v-flex> | 257 | </v-flex> |
259 | <v-flex xs6 class="ml-3"> | 258 | <v-flex xs6 class="ml-3"> |
260 | <v-autocomplete | 259 | <v-autocomplete |
261 | v-model="sectionData.name" | 260 | v-model="sectionData.name" |
262 | placeholder="fill your Section Name" | 261 | placeholder="fill your Section Name" |
263 | :items="SectionName" | 262 | :items="SectionName" |
264 | :rules="nameRules" | 263 | :rules="nameRules" |
265 | required | 264 | required |
266 | ></v-autocomplete> | 265 | ></v-autocomplete> |
267 | </v-flex> | 266 | </v-flex> |
268 | </v-layout> | 267 | </v-layout> |
269 | <v-layout> | 268 | <v-layout> |
270 | <v-flex xs4 class="pt-4 subheading"> | 269 | <v-flex xs4 class="pt-4 subheading"> |
271 | <label class="right">Select Class:</label> | 270 | <label class="right">Select Class:</label> |
272 | </v-flex> | 271 | </v-flex> |
273 | <v-flex xs6 class="ml-3"> | 272 | <v-flex xs6 class="ml-3"> |
274 | <v-select | 273 | <v-select |
275 | :items="addclass" | 274 | :items="addclass" |
276 | label="Select Class" | 275 | label="Select Class" |
277 | v-model="sectionData.classNum" | 276 | v-model="sectionData.classNum" |
278 | item-text="classNum" | 277 | item-text="classNum" |
279 | item-value="_id" | 278 | item-value="_id" |
280 | name="Select Class" | 279 | name="Select Class" |
281 | :rules="classRules" | 280 | :rules="classRules" |
282 | required | 281 | required |
283 | ></v-select> | 282 | ></v-select> |
284 | </v-flex> | 283 | </v-flex> |
285 | </v-layout> | 284 | </v-layout> |
286 | <v-layout> | 285 | <v-layout> |
287 | <v-flex xs4 class="pt-4 subheading"> | 286 | <v-flex xs4 class="pt-4 subheading"> |
288 | <label class="right">Select Incharge:</label> | 287 | <label class="right">Select Incharge:</label> |
289 | </v-flex> | 288 | </v-flex> |
290 | <v-flex xs6 class="ml-3"> | 289 | <v-flex xs6 class="ml-3"> |
291 | <v-select | 290 | <v-select |
292 | :items="teacherList" | 291 | :items="teacherList" |
293 | label="Select Incharge" | 292 | label="Select Incharge" |
294 | v-model="sectionData.sectionId" | 293 | v-model="sectionData.sectionId" |
295 | item-text="name" | 294 | item-text="name" |
296 | item-value="_id" | 295 | item-value="_id" |
297 | name="Select Class" | 296 | name="Select Class" |
298 | :rules="inchargeRules" | 297 | :rules="inchargeRules" |
299 | required | 298 | required |
300 | ></v-select> | 299 | ></v-select> |
301 | </v-flex> | 300 | </v-flex> |
302 | </v-layout> | 301 | </v-layout> |
303 | <v-layout> | 302 | <v-layout> |
304 | <v-flex xs4 class="pt-4 subheading"> | 303 | <v-flex xs4 class="pt-4 subheading"> |
305 | <label class="right">Session:</label> | 304 | <label class="right">Session:</label> |
306 | </v-flex> | 305 | </v-flex> |
307 | <v-flex xs6 class="ml-3"> | 306 | <v-flex xs6 class="ml-3"> |
308 | <v-text-field | 307 | <v-text-field |
309 | v-model="sectionData.session" | 308 | v-model="sectionData.session" |
310 | placeholder="fill your Session" | 309 | placeholder="fill your Session" |
311 | name="name" | 310 | name="name" |
312 | type="text" | 311 | type="text" |
313 | :rules="sessionRules" | 312 | :rules="sessionRules" |
314 | required | 313 | required |
315 | ></v-text-field> | 314 | ></v-text-field> |
316 | </v-flex> | 315 | </v-flex> |
317 | </v-layout> | 316 | </v-layout> |
318 | <v-layout> | 317 | <v-layout> |
319 | <v-flex xs12 sm9 offset-sm2> | 318 | <v-flex xs12 sm9 offset-sm2> |
320 | <v-card-actions> | 319 | <v-card-actions> |
321 | <v-btn @click="clear" round dark>clear</v-btn> | 320 | <v-btn @click="clear" round dark>clear</v-btn> |
322 | <v-spacer></v-spacer> | 321 | <v-spacer></v-spacer> |
323 | <v-btn @click="submit" round dark :loading="loading">Add</v-btn> | 322 | <v-btn @click="submit" round dark :loading="loading">Add</v-btn> |
324 | </v-card-actions> | 323 | </v-card-actions> |
325 | </v-flex> | 324 | </v-flex> |
326 | </v-layout> | 325 | </v-layout> |
327 | </v-form> | 326 | </v-form> |
328 | </v-flex> | 327 | </v-flex> |
329 | </v-layout> | 328 | </v-layout> |
330 | </v-container> | 329 | </v-container> |
331 | </v-card> | 330 | </v-card> |
332 | </v-flex> | 331 | </v-flex> |
333 | </v-container> | 332 | </v-container> |
334 | </v-tab-item> | 333 | </v-tab-item> |
335 | </v-tabs> | 334 | </v-tabs> |
336 | <div class="loader" v-if="showLoader"> | 335 | <div class="loader" v-if="showLoader"> |
337 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 336 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
338 | </div> | 337 | </div> |
339 | </v-app> | 338 | </v-app> |
340 | </template> | 339 | </template> |
341 | 340 | ||
342 | <script> | 341 | <script> |
343 | import http from "@/Services/http.js"; | 342 | import http from "@/Services/http.js"; |
344 | import Util from "@/util"; | 343 | import Util from "@/util"; |
345 | 344 | ||
346 | export default { | 345 | export default { |
347 | data: () => ({ | 346 | data: () => ({ |
348 | snackbar: false, | 347 | snackbar: false, |
349 | y: "top", | 348 | y: "top", |
350 | x: "right", | 349 | x: "right", |
351 | mode: "", | 350 | mode: "", |
352 | timeout: 3000, | 351 | timeout: 3000, |
353 | text: "", | 352 | text: "", |
354 | showLoader: false, | 353 | showLoader: false, |
355 | loading: false, | 354 | loading: false, |
356 | date: null, | 355 | date: null, |
357 | search: "", | 356 | search: "", |
358 | dialog: false, | 357 | dialog: false, |
359 | dialog1: false, | 358 | dialog1: false, |
360 | valid: true, | 359 | valid: true, |
361 | validEdit: true, | 360 | validEdit: true, |
362 | isActive: true, | 361 | isActive: true, |
363 | newActive: false, | 362 | newActive: false, |
364 | details: [], | 363 | details: [], |
365 | AddUsercredentials: {}, | 364 | AddUsercredentials: {}, |
366 | pagination: { | 365 | pagination: { |
367 | rowsPerPage: 15 | 366 | rowsPerPage: 15 |
368 | }, | 367 | }, |
369 | nameRules: [v => !!v || " Section Name is required"], | 368 | nameRules: [v => !!v || " Section Name is required"], |
370 | classRules: [v => !!v || " Class Name is required"], | 369 | classRules: [v => !!v || " Class Name is required"], |
371 | sessionRules: [v => !!v || " Session is required"], | 370 | sessionRules: [v => !!v || " Session is required"], |
372 | inchargeRules: [v => !!v || " Incharge Name is required"], | 371 | inchargeRules: [v => !!v || " Incharge Name is required"], |
373 | SectionName: ["A", "B", "C", "D", "E", "F"], | 372 | SectionName: ["A", "B", "C", "D", "E", "F"], |
374 | headers: [ | 373 | headers: [ |
375 | { | 374 | { |
376 | text: "No", | 375 | text: "No", |
377 | align: "center", | 376 | align: "center", |
378 | sortable: false, | 377 | sortable: false, |
379 | value: "No" | 378 | value: "No" |
380 | }, | 379 | }, |
381 | { | 380 | { |
382 | text: "Class Name", | 381 | text: "Class Name", |
383 | value: "classData.classNum", | 382 | value: "classData.classNum", |
384 | sortable: false, | 383 | sortable: false, |
385 | align: "center" | 384 | align: "center" |
386 | }, | 385 | }, |
387 | { text: "Section Name", value: "name", sortable: false, align: "center" }, | 386 | { text: "Section Name", value: "name", sortable: false, align: "center" }, |
388 | { text: "Session", value: "session", sortable: false, align: "center" }, | 387 | { text: "Session", value: "session", sortable: false, align: "center" }, |
389 | { text: "Action", value: "", sortable: false, align: "center" } | 388 | { text: "Action", value: "", sortable: false, align: "center" } |
390 | ], | 389 | ], |
391 | desserts: [], | 390 | desserts: [], |
392 | addclass: [], | 391 | addclass: [], |
393 | teacherList: [], | 392 | teacherList: [], |
394 | select: "", | 393 | select: "", |
395 | selectId: "", | 394 | selectId: "", |
396 | token: "", | 395 | token: "", |
397 | editedIndex: -1, | 396 | editedIndex: -1, |
398 | editedItem: { | 397 | editedItem: { |
399 | classData: { | 398 | classData: { |
400 | classNum: "" | 399 | classNum: "" |
401 | }, | 400 | }, |
402 | classId: "", | 401 | classId: "", |
403 | classInchargeId: "", | 402 | classInchargeId: "", |
404 | teacherData: [ | 403 | teacherData: [ |
405 | { | 404 | { |
406 | name: "" | 405 | name: "" |
407 | } | 406 | } |
408 | ], | 407 | ], |
409 | name: "", | 408 | name: "", |
410 | session: new Date().getFullYear() | 409 | session: new Date().getFullYear() |
411 | }, | 410 | }, |
412 | sectionData: { | 411 | sectionData: { |
413 | session: new Date().getFullYear() | 412 | session: new Date().getFullYear() |
414 | } | 413 | } |
415 | }), | 414 | }), |
416 | methods: { | 415 | methods: { |
417 | getSectionList() { | 416 | getSectionList() { |
418 | this.showLoader = true; | 417 | this.showLoader = true; |
419 | http() | 418 | http() |
420 | .get("/getAllSections", { | 419 | .get("/getAllSections", { |
421 | headers: { Authorization: "Bearer " + this.token } | 420 | headers: { Authorization: "Bearer " + this.token } |
422 | }) | 421 | }) |
423 | .then(response => { | 422 | .then(response => { |
424 | this.desserts = response.data.data; | 423 | this.desserts = response.data.data; |
425 | this.showLoader = false; | 424 | this.showLoader = false; |
426 | // console.log("getAllSections=====>",response.data.data) | 425 | // console.log("getAllSections=====>",response.data.data) |
427 | }) | 426 | }) |
428 | .catch(err => { | 427 | .catch(error => { |
429 | // console.log("err====>", err); | ||
430 | this.showLoader = false; | 428 | this.showLoader = false; |
431 | if (error.response.status === 401) { | 429 | if (error.response.status === 401 && error.response.status === 401) { |
432 | this.$router.replace({ path: "/" }); | 430 | this.$router.replace({ path: "/" }); |
433 | this.$store.dispatch("setToken", null); | 431 | this.$store.dispatch("setToken", null); |
434 | this.$store.dispatch("Id", null); | 432 | this.$store.dispatch("Id", null); |
435 | } | 433 | } |
436 | }); | 434 | }); |
437 | }, | 435 | }, |
438 | editItem(item) { | 436 | editItem(item) { |
439 | this.editedIndex = this.desserts.indexOf(item); | 437 | this.editedIndex = this.desserts.indexOf(item); |
440 | this.editedItem = Object.assign({}, item); | 438 | this.editedItem = Object.assign({}, item); |
441 | console.log(this.editedItem); | 439 | console.log(this.editedItem); |
442 | this.dialog = true; | 440 | this.dialog = true; |
443 | }, | 441 | }, |
444 | profile(item) { | 442 | profile(item) { |
445 | this.editedIndex = this.desserts.indexOf(item); | 443 | this.editedIndex = this.desserts.indexOf(item); |
446 | this.editedItem = Object.assign({}, item); | 444 | this.editedItem = Object.assign({}, item); |
447 | this.dialog1 = true; | 445 | this.dialog1 = true; |
448 | }, | 446 | }, |
449 | deleteItem(item) { | 447 | deleteItem(item) { |
450 | let deleteStudent = { | 448 | let deleteStudent = { |
451 | sectionId: item._id | 449 | sectionId: item._id |
452 | }; | 450 | }; |
453 | http() | 451 | http() |
454 | .delete( | 452 | .delete( |
455 | "/deleteSection", | 453 | "/deleteSection", |
456 | confirm("Are you sure you want to delete this?") && { | 454 | confirm("Are you sure you want to delete this?") && { |
457 | params: deleteStudent | 455 | params: deleteStudent |
458 | } | 456 | } |
459 | ) | 457 | ) |
460 | .then(response => { | 458 | .then(response => { |
461 | if ((this.snackbar = true)) { | 459 | if ((this.snackbar = true)) { |
462 | this.text = "Successfully delete Existing Section"; | 460 | this.text = "Successfully delete Existing Section"; |
463 | } | 461 | } |
464 | this.getSectionList(); | 462 | this.getSectionList(); |
465 | }) | 463 | }) |
466 | .catch(error => { | 464 | .catch(error => { |
467 | // console.log(error); | 465 | // console.log(error); |
468 | }); | 466 | }); |
469 | }, | 467 | }, |
470 | activeTab(type) { | 468 | activeTab(type) { |
471 | switch (type) { | 469 | switch (type) { |
472 | case "existing": | 470 | case "existing": |
473 | this.newActive = false; | 471 | this.newActive = false; |
474 | this.isActive = true; | 472 | this.isActive = true; |
475 | break; | 473 | break; |
476 | 474 | ||
477 | default: | 475 | default: |
478 | this.newActive = true; | 476 | this.newActive = true; |
479 | this.isActive = false; | 477 | this.isActive = false; |
480 | break; | 478 | break; |
481 | } | 479 | } |
482 | }, | 480 | }, |
483 | close() { | 481 | close() { |
484 | this.dialog = false; | 482 | this.dialog = false; |
485 | setTimeout(() => { | 483 | setTimeout(() => { |
486 | this.editedItem = Object.assign({}, this.defaultItem); | 484 | this.editedItem = Object.assign({}, this.defaultItem); |
487 | this.editedIndex = -1; | 485 | this.editedIndex = -1; |
488 | }, 300); | 486 | }, 300); |
489 | }, | 487 | }, |
490 | close1() { | 488 | close1() { |
491 | this.dialog1 = false; | 489 | this.dialog1 = false; |
492 | }, | 490 | }, |
493 | close2() { | 491 | close2() { |
494 | this.dialog2 = false; | 492 | this.dialog2 = false; |
495 | }, | 493 | }, |
496 | submit() { | 494 | submit() { |
497 | if (this.$refs.form.validate()) { | 495 | if (this.$refs.form.validate()) { |
498 | let addSection = { | 496 | let addSection = { |
499 | name: this.sectionData.name, | 497 | name: this.sectionData.name, |
500 | classId: this.sectionData.classNum, | 498 | classId: this.sectionData.classNum, |
501 | session: this.sectionData.session, | 499 | session: this.sectionData.session, |
502 | classInchargeId: this.sectionData._id | 500 | classInchargeId: this.sectionData._id |
503 | }; | 501 | }; |
504 | this.loading = true; | 502 | this.loading = true; |
505 | http() | 503 | http() |
506 | .post("/createSection", addSection) | 504 | .post("/createSection", addSection) |
507 | .then(response => { | 505 | .then(response => { |
508 | console.log(response); | 506 | console.log(response); |
509 | this.getSectionList(); | 507 | this.getSectionList(); |
510 | if ((this.snackbar = true)) { | 508 | if ((this.snackbar = true)) { |
511 | this.text = "New Section added successfully"; | 509 | this.text = "New Section added successfully"; |
512 | } | 510 | } |
513 | 511 | ||
514 | this.clear(); | 512 | this.clear(); |
515 | this.loading = false; | 513 | this.loading = false; |
516 | }) | 514 | }) |
517 | .catch(error => { | 515 | .catch(error => { |
518 | // console.log(error); | 516 | // console.log(error); |
519 | if ((this.snackbar = true)) { | 517 | if ((this.snackbar = true)) { |
520 | this.text = error.response.data.message; | 518 | this.text = error.response.data.message; |
521 | } | 519 | } |
522 | this.loading = false; | 520 | this.loading = false; |
523 | }); | 521 | }); |
524 | } | 522 | } |
525 | }, | 523 | }, |
526 | clear() { | 524 | clear() { |
527 | this.$refs.form.reset(); | 525 | this.$refs.form.reset(); |
528 | }, | 526 | }, |
529 | save() { | 527 | save() { |
530 | this.editedItem.sectionId = this.editedItem._id; | 528 | this.editedItem.sectionId = this.editedItem._id; |
531 | http() | 529 | http() |
532 | .put("/updateSection", this.editedItem) | 530 | .put("/updateSection", this.editedItem) |
533 | .then(response => { | 531 | .then(response => { |
534 | // console.log("editStudent",editStudent); | 532 | // console.log("editStudent",editStudent); |
535 | if ((this.snackbar = true)) { | 533 | if ((this.snackbar = true)) { |
536 | this.text = "Successfully Edit Existing Section"; | 534 | this.text = "Successfully Edit Existing Section"; |
537 | } | 535 | } |
538 | this.getSectionList(); | 536 | this.getSectionList(); |
539 | this.close(); | 537 | this.close(); |
540 | }) | 538 | }) |
541 | .catch(error => { | 539 | .catch(error => { |
542 | this.text = error.response.data.message; | 540 | this.text = error.response.data.message; |
543 | // console.log(error); | 541 | // console.log(error); |
544 | }); | 542 | }); |
545 | }, | 543 | }, |
546 | getAllTeacher() { | 544 | getAllTeacher() { |
547 | http() | 545 | http() |
548 | .get("/getTeachersList", { | 546 | .get("/getTeachersList", { |
549 | headers: { Authorization: "Bearer " + this.token } | 547 | headers: { Authorization: "Bearer " + this.token } |
550 | }) | 548 | }) |
551 | .then(response => { | 549 | .then(response => { |
552 | this.teacherList = response.data.data; | 550 | this.teacherList = response.data.data; |
553 | this.showLoader = false; | 551 | this.showLoader = false; |
554 | }) | 552 | }) |
555 | .catch(err => { | 553 | .catch(err => { |
556 | // console.log("err====>", err); | 554 | // console.log("err====>", err); |
557 | this.showLoader = false; | 555 | this.showLoader = false; |
558 | }); | 556 | }); |
559 | }, | 557 | }, |
560 | getAllClasses() { | 558 | getAllClasses() { |
561 | http() | 559 | http() |
562 | .get("/getClassesList", { | 560 | .get("/getClassesList", { |
563 | headers: { Authorization: "Bearer " + this.token } | 561 | headers: { Authorization: "Bearer " + this.token } |
564 | }) | 562 | }) |
565 | .then(response => { | 563 | .then(response => { |
566 | this.addclass = response.data.data; | 564 | this.addclass = response.data.data; |
567 | }) | 565 | }) |
568 | .catch(err => { | 566 | .catch(err => { |
569 | // console.log("err====>", err); | 567 | // console.log("err====>", err); |
570 | // this.$router.replace({ path: "/" }); | 568 | // this.$router.replace({ path: "/" }); |
571 | }); | 569 | }); |
572 | } | 570 | } |
573 | }, | 571 | }, |
574 | mounted() { | 572 | mounted() { |
575 | this.token = this.$store.state.token; | 573 | this.token = this.$store.state.token; |
576 | this.getSectionList(); | 574 | this.getSectionList(); |
577 | this.getAllClasses(); | 575 | this.getAllClasses(); |
578 | this.getAllTeacher(); | 576 | this.getAllTeacher(); |
579 | }, | 577 | }, |
580 | created() { | 578 | created() { |
581 | this.$root.$on("app:search", search => { | 579 | this.$root.$on("app:search", search => { |
582 | this.search = search; | 580 | this.search = search; |
583 | }); | 581 | }); |
584 | }, | 582 | }, |
585 | beforeDestroy() { | 583 | beforeDestroy() { |
586 | // dont forget to remove the listener | 584 | // dont forget to remove the listener |
587 | this.$root.$off("app:search"); | 585 | this.$root.$off("app:search"); |
588 | } | 586 | } |
589 | }; | 587 | }; |
590 | </script> | 588 | </script> |
591 | 589 | ||
592 | <style scoped> | 590 | <style scoped> |
593 | .active { | 591 | .active { |
594 | background-color: gray; | 592 | background-color: gray; |
595 | color: white !important; | 593 | color: white !important; |
596 | } | 594 | } |
597 | .activebtn { | 595 | .activebtn { |
598 | color: black !important; | 596 | color: black !important; |
599 | } | 597 | } |
600 | </style> | 598 | </style> |
src/router/paths.js
1 | export default [{ | 1 | export default [{ |
2 | path: '*', | 2 | path: '*', |
3 | meta: { | 3 | meta: { |
4 | public: true, | 4 | public: true, |
5 | }, | 5 | }, |
6 | redirect: { | 6 | redirect: { |
7 | path: '/404' | 7 | path: '/404' |
8 | } | 8 | } |
9 | }, | 9 | }, |
10 | { | 10 | { |
11 | path: '/404', | 11 | path: '/404', |
12 | meta: { | 12 | meta: { |
13 | public: true, | 13 | public: true, |
14 | }, | 14 | }, |
15 | name: 'NotFound', | 15 | name: 'NotFound', |
16 | component: () => | 16 | component: () => |
17 | import ( | 17 | import ( |
18 | /* webpackChunkName: "routes" */ | 18 | /* webpackChunkName: "routes" */ |
19 | /* webpackMode: "lazy-once" */ | 19 | /* webpackMode: "lazy-once" */ |
20 | `@/pages/NotFound/NotFound.vue` | 20 | `@/pages/NotFound/NotFound.vue` |
21 | ) | 21 | ) |
22 | }, | 22 | }, |
23 | { | 23 | { |
24 | path: '/500', | 24 | path: '/500', |
25 | meta: { | 25 | meta: { |
26 | public: true, | 26 | public: true, |
27 | }, | 27 | }, |
28 | name: 'ServerError', | 28 | name: 'ServerError', |
29 | component: () => | 29 | component: () => |
30 | import ( | 30 | import ( |
31 | /* webpackChunkName: "routes" */ | 31 | /* webpackChunkName: "routes" */ |
32 | /* webpackMode: "lazy-once" */ | 32 | /* webpackMode: "lazy-once" */ |
33 | `@/pages/NotFound/Error.vue` | 33 | `@/pages/NotFound/Error.vue` |
34 | ) | 34 | ) |
35 | }, | 35 | }, |
36 | { | 36 | { |
37 | path: '/changepassword', | 37 | path: '/changepassword', |
38 | meta: {}, | 38 | meta: {}, |
39 | name: 'changepassword', | 39 | name: 'changepassword', |
40 | props: (route) => ({ type: route.query.type }), | 40 | props: (route) => ({ type: route.query.type }), |
41 | component: () => | 41 | component: () => |
42 | import ( | 42 | import ( |
43 | /* webpackChunkName: "routes" */ | 43 | /* webpackChunkName: "routes" */ |
44 | /* webpackMode: "lazy-once" */ | 44 | /* webpackMode: "lazy-once" */ |
45 | `@/pages/Authentication/changepassword.vue` | 45 | `@/pages/Authentication/changepassword.vue` |
46 | ) | 46 | ) |
47 | }, | 47 | }, |
48 | { | 48 | { |
49 | path: '/teachers', | 49 | path: '/teachers', |
50 | meta: { breadcrumb: false }, | 50 | meta: { breadcrumb: false }, |
51 | name: 'teachers', | 51 | name: 'teachers', |
52 | component: () => | 52 | component: () => |
53 | import ( | 53 | import ( |
54 | /* webpackChunkName: "routes" */ | 54 | /* webpackChunkName: "routes" */ |
55 | /* webpackMode: "lazy-once" */ | 55 | /* webpackMode: "lazy-once" */ |
56 | `@/pages/Teachers/teachers.vue` | 56 | `@/pages/Teachers/teachers.vue` |
57 | ) | 57 | ) |
58 | }, | 58 | }, |
59 | { | 59 | { |
60 | path: '/', | 60 | path: '/', |
61 | meta: { | 61 | meta: { |
62 | public: true, | 62 | public: true, |
63 | }, | 63 | }, |
64 | name: 'Login', | 64 | name: 'Login', |
65 | component: () => | 65 | component: () => |
66 | import ( | 66 | import ( |
67 | /* webpackChunkName: "routes" */ | 67 | /* webpackChunkName: "routes" */ |
68 | /* webpackMode: "lazy-once" */ | 68 | /* webpackMode: "lazy-once" */ |
69 | `@/pages/Authentication/Login.vue` | 69 | `@/pages/Authentication/Login.vue` |
70 | ) | 70 | ) |
71 | }, | 71 | }, |
72 | { | 72 | { |
73 | path: '/forgetpassword', | 73 | path: '/forgetpassword', |
74 | meta: { | 74 | meta: { |
75 | public: true, | 75 | public: true, |
76 | }, | 76 | }, |
77 | name: 'forgetpassword', | 77 | name: 'forgetpassword', |
78 | component: () => | 78 | component: () => |
79 | import ( | 79 | import ( |
80 | /* webpackChunkName: "routes" */ | 80 | /* webpackChunkName: "routes" */ |
81 | /* webpackMode: "lazy-once" */ | 81 | /* webpackMode: "lazy-once" */ |
82 | `@/pages/Authentication/forgetpassword.vue` | 82 | `@/pages/Authentication/forgetpassword.vue` |
83 | ) | 83 | ) |
84 | }, | 84 | }, |
85 | { | 85 | { |
86 | path: '/students', | 86 | path: '/students', |
87 | meta: {}, | 87 | meta: {}, |
88 | name: 'Students', | 88 | name: 'Students', |
89 | props: (route) => ({ type: route.query.type }), | 89 | props: (route) => ({ type: route.query.type }), |
90 | component: () => | 90 | component: () => |
91 | import ( | 91 | import ( |
92 | /* webpackChunkName: "routes" */ | 92 | /* webpackChunkName: "routes" */ |
93 | /* webpackMode: "lazy-once" */ | 93 | /* webpackMode: "lazy-once" */ |
94 | `@/pages/Students/students.vue` | 94 | `@/pages/Students/students.vue` |
95 | ) | 95 | ) |
96 | }, | 96 | }, |
97 | { | 97 | { |
98 | path: '/addclass', | 98 | path: '/addclass', |
99 | meta: {}, | 99 | meta: {}, |
100 | name: 'addclass', | 100 | name: 'addclass', |
101 | props: (route) => ({ type: route.query.type }), | 101 | props: (route) => ({ type: route.query.type }), |
102 | component: () => | 102 | component: () => |
103 | import ( | 103 | import ( |
104 | /* webpackChunkName: "routes" */ | 104 | /* webpackChunkName: "routes" */ |
105 | /* webpackMode: "lazy-once" */ | 105 | /* webpackMode: "lazy-once" */ |
106 | `@/pages/Class/addclass.vue` | 106 | `@/pages/Class/addclass.vue` |
107 | ) | 107 | ) |
108 | }, | 108 | }, |
109 | { | 109 | { |
110 | path: '/section', | 110 | path: '/section', |
111 | meta: {}, | 111 | meta: {}, |
112 | name: 'section', | 112 | name: 'section', |
113 | props: (route) => ({ type: route.query.type }), | 113 | props: (route) => ({ type: route.query.type }), |
114 | component: () => | 114 | component: () => |
115 | import ( | 115 | import ( |
116 | /* webpackChunkName: "routes" */ | 116 | /* webpackChunkName: "routes" */ |
117 | /* webpackMode: "lazy-once" */ | 117 | /* webpackMode: "lazy-once" */ |
118 | `@/pages/Section/section.vue` | 118 | `@/pages/Section/section.vue` |
119 | ) | 119 | ) |
120 | }, | 120 | }, |
121 | { | 121 | { |
122 | path: '/noticeBoard', | 122 | path: '/noticeBoard', |
123 | meta: {}, | 123 | meta: {}, |
124 | name: 'NoticeBoard', | 124 | name: 'NoticeBoard', |
125 | props: (route) => ({ type: route.query.type }), | 125 | props: (route) => ({ type: route.query.type }), |
126 | component: () => | 126 | component: () => |
127 | import ( | 127 | import ( |
128 | /* webpackChunkName: "routes" */ | 128 | /* webpackChunkName: "routes" */ |
129 | /* webpackMode: "lazy-once" */ | 129 | /* webpackMode: "lazy-once" */ |
130 | `@/pages/NoticeBoard/noticeBoard.vue` | 130 | `@/pages/NoticeBoard/noticeBoard.vue` |
131 | ) | 131 | ) |
132 | }, | 132 | }, |
133 | { | 133 | { |
134 | path: '/news', | 134 | path: '/news', |
135 | meta: {}, | 135 | meta: {}, |
136 | name: 'news', | 136 | name: 'news', |
137 | props: (route) => ({ type: route.query.type }), | 137 | props: (route) => ({ type: route.query.type }), |
138 | component: () => | 138 | component: () => |
139 | import ( | 139 | import ( |
140 | /* webpackChunkName: "routes" */ | 140 | /* webpackChunkName: "routes" */ |
141 | /* webpackMode: "lazy-once" */ | 141 | /* webpackMode: "lazy-once" */ |
142 | `@/pages/News/news.vue` | 142 | `@/pages/News/news.vue` |
143 | ) | 143 | ) |
144 | }, | 144 | }, |
145 | // { | 145 | // { |
146 | // path: '/reminder', | 146 | // path: '/reminder', |
147 | // meta: { }, | 147 | // meta: { }, |
148 | // name: 'reminder', | 148 | // name: 'reminder', |
149 | // props: (route) => ({ type: route.query.type }), | 149 | // props: (route) => ({ type: route.query.type }), |
150 | // component: () => import( | 150 | // component: () => import( |
151 | // /* webpackChunkName: "routes" */ | 151 | // /* webpackChunkName: "routes" */ |
152 | // /* webpackMode: "lazy-once" */ | 152 | // /* webpackMode: "lazy-once" */ |
153 | // `@/pages/Reminder/reminder.vue` | 153 | // `@/pages/Reminder/reminder.vue` |
154 | // ) | 154 | // ) |
155 | // }, | 155 | // }, |
156 | { | 156 | { |
157 | path: '/timeTable', | 157 | path: '/timeTable', |
158 | meta: {}, | 158 | meta: {}, |
159 | name: 'timeTable', | 159 | name: 'timeTable', |
160 | props: (route) => ({ type: route.query.type }), | 160 | props: (route) => ({ type: route.query.type }), |
161 | component: () => | 161 | component: () => |
162 | import ( | 162 | import ( |
163 | /* webpackChunkName: "routes" */ | 163 | /* webpackChunkName: "routes" */ |
164 | /* webpackMode: "lazy-once" */ | 164 | /* webpackMode: "lazy-once" */ |
165 | `@/pages/TimeTable/timeTable.vue` | 165 | `@/pages/TimeTable/timeTable.vue` |
166 | ) | 166 | ) |
167 | }, | 167 | }, |
168 | { | 168 | { |
169 | path: '/notification', | 169 | path: '/notification', |
170 | meta: {}, | 170 | meta: {}, |
171 | name: 'notification', | 171 | name: 'notification', |
172 | props: (route) => ({ type: route.query.type }), | 172 | props: (route) => ({ type: route.query.type }), |
173 | component: () => | 173 | component: () => |
174 | import ( | 174 | import ( |
175 | /* webpackChunkName: "routes" */ | 175 | /* webpackChunkName: "routes" */ |
176 | /* webpackMode: "lazy-once" */ | 176 | /* webpackMode: "lazy-once" */ |
177 | `@/pages/Notification/notification.vue` | 177 | `@/pages/Notification/notification.vue` |
178 | ) | 178 | ) |
179 | }, | 179 | }, |
180 | { | 180 | { |
181 | path: '/parents', | 181 | path: '/parents', |
182 | meta: {}, | 182 | meta: {}, |
183 | name: 'parents', | 183 | name: 'parents', |
184 | props: (route) => ({ type: route.query.type }), | 184 | props: (route) => ({ type: route.query.type }), |
185 | component: () => | 185 | component: () => |
186 | import ( | 186 | import ( |
187 | /* webpackChunkName: "routes" */ | 187 | /* webpackChunkName: "routes" */ |
188 | /* webpackMode: "lazy-once" */ | 188 | /* webpackMode: "lazy-once" */ |
189 | `@/pages/Parent/parents.vue` | 189 | `@/pages/Parent/parents.vue` |
190 | ) | 190 | ) |
191 | }, | 191 | }, |
192 | { | 192 | { |
193 | path: '/subject', | 193 | path: '/subject', |
194 | meta: {}, | 194 | meta: {}, |
195 | name: 'subject', | 195 | name: 'subject', |
196 | props: (route) => ({ type: route.query.type }), | 196 | props: (route) => ({ type: route.query.type }), |
197 | component: () => | 197 | component: () => |
198 | import ( | 198 | import ( |
199 | /* webpackChunkName: "routes" */ | 199 | /* webpackChunkName: "routes" */ |
200 | /* webpackMode: "lazy-once" */ | 200 | /* webpackMode: "lazy-once" */ |
201 | `@/pages/Subjects/subjects.vue` | 201 | `@/pages/Subjects/subjects.vue` |
202 | ) | 202 | ) |
203 | }, | 203 | }, |
204 | { | 204 | { |
205 | path: '/dashboard', | 205 | path: '/dashboard', |
206 | meta: {}, | 206 | meta: {}, |
207 | name: 'Dashboard', | 207 | name: 'Dashboard', |
208 | props: (route) => ({ type: route.query.type }), | 208 | props: (route) => ({ type: route.query.type }), |
209 | component: () => | 209 | component: () => |
210 | import ( | 210 | import ( |
211 | /* webpackChunkName: "routes" */ | 211 | /* webpackChunkName: "routes" */ |
212 | /* webpackMode: "lazy-once" */ | 212 | /* webpackMode: "lazy-once" */ |
213 | `@/pages/Dashboard/dashboard.vue` | 213 | `@/pages/Dashboard/dashboard.vue` |
214 | ) | 214 | ) |
215 | }, | 215 | }, |
216 | { | 216 | { |
217 | path: '/socialMedia', | 217 | path: '/socialMedia', |
218 | meta: {}, | 218 | meta: {}, |
219 | name: 'SocialMedia', | 219 | name: 'SocialMedia', |
220 | props: (route) => ({ type: route.query.type }), | 220 | props: (route) => ({ type: route.query.type }), |
221 | component: () => | 221 | component: () => |
222 | import ( | 222 | import ( |
223 | /* webpackChunkName: "routes" */ | 223 | /* webpackChunkName: "routes" */ |
224 | /* webpackMode: "lazy-once" */ | 224 | /* webpackMode: "lazy-once" */ |
225 | `@/pages/socialMedia/socialMedia.vue` | 225 | `@/pages/socialMedia/socialMedia.vue` |
226 | ) | 226 | ) |
227 | }, | 227 | }, |
228 | { | 228 | { |
229 | path: '/gallery', | 229 | path: '/gallery', |
230 | meta: {}, | 230 | meta: {}, |
231 | name: 'Gallery', | 231 | name: 'Gallery', |
232 | props: (route) => ({ type: route.query.type }), | 232 | props: (route) => ({ type: route.query.type }), |
233 | component: () => | 233 | component: () => |
234 | import ( | 234 | import ( |
235 | /* webpackChunkName: "routes" */ | 235 | /* webpackChunkName: "routes" */ |
236 | /* webpackMode: "lazy-once" */ | 236 | /* webpackMode: "lazy-once" */ |
237 | `@/pages/Gallery/gallery.vue` | 237 | `@/pages/Gallery/gallery.vue` |
238 | ) | 238 | ) |
239 | }, | 239 | }, |
240 | { | 240 | { |
241 | path: '/event', | 241 | path: '/event', |
242 | meta: {}, | 242 | meta: {}, |
243 | name: 'Event', | 243 | name: 'Event', |
244 | props: (route) => ({ type: route.query.type }), | 244 | props: (route) => ({ type: route.query.type }), |
245 | component: () => | 245 | component: () => |
246 | import ( | 246 | import ( |
247 | /* webpackChunkName: "routes" */ | 247 | /* webpackChunkName: "routes" */ |
248 | /* webpackMode: "lazy-once" */ | 248 | /* webpackMode: "lazy-once" */ |
249 | `@/pages/Event/event.vue` | 249 | `@/pages/Event/event.vue` |
250 | ) | 250 | ) |
251 | }, | 251 | }, |
252 | { | 252 | { |
253 | path: '/holiday', | 253 | path: '/holiday', |
254 | meta: {}, | 254 | meta: {}, |
255 | name: 'Holiday', | 255 | name: 'Holiday', |
256 | props: (route) => ({ type: route.query.type }), | 256 | props: (route) => ({ type: route.query.type }), |
257 | component: () => | 257 | component: () => |
258 | import ( | 258 | import ( |
259 | /* webpackChunkName: "routes" */ | 259 | /* webpackChunkName: "routes" */ |
260 | /* webpackMode: "lazy-once" */ | 260 | /* webpackMode: "lazy-once" */ |
261 | `@/pages/Holiday/holiday.vue` | 261 | `@/pages/Holiday/holiday.vue` |
262 | ) | 262 | ) |
263 | }, | 263 | }, |
264 | { | 264 | { |
265 | path: '/user', | 265 | path: '/user', |
266 | meta: {}, | 266 | meta: {}, |
267 | name: 'User', | 267 | name: 'User', |
268 | props: (route) => ({ type: route.query.type }), | 268 | props: (route) => ({ type: route.query.type }), |
269 | component: () => | 269 | component: () => |
270 | import ( | 270 | import ( |
271 | /* webpackChunkName: "routes" */ | 271 | /* webpackChunkName: "routes" */ |
272 | /* webpackMode: "lazy-once" */ | 272 | /* webpackMode: "lazy-once" */ |
273 | `@/pages/User/user.vue` | 273 | `@/pages/User/user.vue` |
274 | ) | 274 | ) |
275 | }, | 275 | }, |
276 | { | 276 | { |
277 | path: '/AttendenceStudent', | 277 | path: '/AttendenceStudent', |
278 | meta: {}, | 278 | meta: {}, |
279 | name: 'studentAttendence', | 279 | name: 'studentAttendence', |
280 | props: (route) => ({ type: route.query.type }), | 280 | props: (route) => ({ type: route.query.type }), |
281 | component: () => | 281 | component: () => |
282 | import ( | 282 | import ( |
283 | /* webpackChunkName: "routes" */ | 283 | /* webpackChunkName: "routes" */ |
284 | /* webpackMode: "lazy-once" */ | 284 | /* webpackMode: "lazy-once" */ |
285 | `@/pages/Attendence/studentAttendence.vue` | 285 | `@/pages/Attendence/studentAttendence.vue` |
286 | ) | 286 | ) |
287 | }, | 287 | }, |
288 | { | 288 | { |
289 | path: '/AttendenceTeacher', | 289 | path: '/AttendenceTeacher', |
290 | meta: {}, | 290 | meta: {}, |
291 | name: 'teacherAttendence', | 291 | name: 'teacherAttendence', |
292 | props: (route) => ({ type: route.query.type }), | 292 | props: (route) => ({ type: route.query.type }), |
293 | component: () => | 293 | component: () => |
294 | import ( | 294 | import ( |
295 | /* webpackChunkName: "routes" */ | 295 | /* webpackChunkName: "routes" */ |
296 | /* webpackMode: "lazy-once" */ | 296 | /* webpackMode: "lazy-once" */ |
297 | `@/pages/Attendence/teacherAttendence.vue` | 297 | `@/pages/Attendence/teacherAttendence.vue` |
298 | ) | 298 | ) |
299 | }, | 299 | }, |
300 | { | 300 | { |
301 | path: '/AttendenceUser', | 301 | path: '/AttendenceUser', |
302 | meta: {}, | 302 | meta: {}, |
303 | name: 'userAttendence', | 303 | name: 'userAttendence', |
304 | props: (route) => ({ type: route.query.type }), | 304 | props: (route) => ({ type: route.query.type }), |
305 | component: () => | 305 | component: () => |
306 | import ( | 306 | import ( |
307 | /* webpackChunkName: "routes" */ | 307 | /* webpackChunkName: "routes" */ |
308 | /* webpackMode: "lazy-once" */ | 308 | /* webpackMode: "lazy-once" */ |
309 | `@/pages/Attendence/userAttendence.vue` | 309 | `@/pages/Attendence/userAttendence.vue` |
310 | ) | 310 | ) |
311 | }, | 311 | }, |
312 | { | 312 | { |
313 | path: '/feeTypes', | 313 | path: '/feeTypes', |
314 | meta: {}, | 314 | meta: {}, |
315 | name: 'feeTypes', | 315 | name: 'feeTypes', |
316 | props: (route) => ({ type: route.query.type }), | 316 | props: (route) => ({ type: route.query.type }), |
317 | component: () => | 317 | component: () => |
318 | import ( | 318 | import ( |
319 | /* webpackChunkName: "routes" */ | 319 | /* webpackChunkName: "routes" */ |
320 | /* webpackMode: "lazy-once" */ | 320 | /* webpackMode: "lazy-once" */ |
321 | `@/pages/Account/feeTypes.vue` | 321 | `@/pages/Account/feeTypes.vue` |
322 | ) | 322 | ) |
323 | }, | 323 | }, |
324 | { | 324 | { |
325 | path: '/invoice', | 325 | path: '/invoice', |
326 | meta: {}, | 326 | meta: {}, |
327 | name: 'Invoice', | 327 | name: 'Invoice', |
328 | props: (route) => ({ type: route.query.type }), | 328 | props: (route) => ({ type: route.query.type }), |
329 | component: () => | 329 | component: () => |
330 | import ( | 330 | import ( |
331 | /* webpackChunkName: "routes" */ | 331 | /* webpackChunkName: "routes" */ |
332 | /* webpackMode: "lazy-once" */ | 332 | /* webpackMode: "lazy-once" */ |
333 | `@/pages/Account/invoice.vue` | 333 | `@/pages/Account/invoice.vue` |
334 | ) | 334 | ) |
335 | }, | 335 | }, |
336 | { | 336 | { |
337 | path: '/paymentHistory', | 337 | path: '/paymentHistory', |
338 | meta: {}, | 338 | meta: {}, |
339 | name: 'paymentHistory', | 339 | name: 'paymentHistory', |
340 | props: (route) => ({ type: route.query.type }), | 340 | props: (route) => ({ type: route.query.type }), |
341 | component: () => | 341 | component: () => |
342 | import ( | 342 | import ( |
343 | /* webpackChunkName: "routes" */ | 343 | /* webpackChunkName: "routes" */ |
344 | /* webpackMode: "lazy-once" */ | 344 | /* webpackMode: "lazy-once" */ |
345 | `@/pages/Account/paymentHistory.vue` | 345 | `@/pages/Account/paymentHistory.vue` |
346 | ) | 346 | ) |
347 | }, | 347 | }, |
348 | { | 348 | { |
349 | path: '/expense', | 349 | path: '/expense', |
350 | meta: {}, | 350 | meta: {}, |
351 | name: 'Expense', | 351 | name: 'Expense', |
352 | props: (route) => ({ type: route.query.type }), | 352 | props: (route) => ({ type: route.query.type }), |
353 | component: () => | 353 | component: () => |
354 | import ( | 354 | import ( |
355 | /* webpackChunkName: "routes" */ | 355 | /* webpackChunkName: "routes" */ |
356 | /* webpackMode: "lazy-once" */ | 356 | /* webpackMode: "lazy-once" */ |
357 | `@/pages/Account/expense.vue` | 357 | `@/pages/Account/expense.vue` |
358 | ) | 358 | ) |
359 | }, | 359 | }, |
360 | { | 360 | { |
361 | path: '/income', | 361 | path: '/income', |
362 | meta: {}, | 362 | meta: {}, |
363 | name: 'Income', | 363 | name: 'Income', |
364 | props: (route) => ({ type: route.query.type }), | 364 | props: (route) => ({ type: route.query.type }), |
365 | component: () => | 365 | component: () => |
366 | import ( | 366 | import ( |
367 | /* webpackChunkName: "routes" */ | 367 | /* webpackChunkName: "routes" */ |
368 | /* webpackMode: "lazy-once" */ | 368 | /* webpackMode: "lazy-once" */ |
369 | `@/pages/Account/income.vue` | 369 | `@/pages/Account/income.vue` |
370 | ) | 370 | ) |
371 | }, | 371 | }, |
372 | { | 372 | { |
373 | path: '/libraryMember', | 373 | path: '/libraryMember', |
374 | meta: {}, | 374 | meta: {}, |
375 | name: 'libraryMember', | 375 | name: 'libraryMember', |
376 | props: (route) => ({ type: route.query.type }), | 376 | props: (route) => ({ type: route.query.type }), |
377 | component: () => | 377 | component: () => |
378 | import ( | 378 | import ( |
379 | /* webpackChunkName: "routes" */ | 379 | /* webpackChunkName: "routes" */ |
380 | /* webpackMode: "lazy-once" */ | 380 | /* webpackMode: "lazy-once" */ |
381 | `@/pages/Library/member.vue` | 381 | `@/pages/Library/member.vue` |
382 | ) | 382 | ) |
383 | }, | 383 | }, |
384 | { | 384 | { |
385 | path: '/books', | 385 | path: '/books', |
386 | meta: {}, | 386 | meta: {}, |
387 | name: 'Books', | 387 | name: 'Books', |
388 | props: (route) => ({ type: route.query.type }), | 388 | props: (route) => ({ type: route.query.type }), |
389 | component: () => | 389 | component: () => |
390 | import ( | 390 | import ( |
391 | /* webpackChunkName: "routes" */ | 391 | /* webpackChunkName: "routes" */ |
392 | /* webpackMode: "lazy-once" */ | 392 | /* webpackMode: "lazy-once" */ |
393 | `@/pages/Library/books.vue` | 393 | `@/pages/Library/books.vue` |
394 | ) | 394 | ) |
395 | }, | 395 | }, |
396 | { | 396 | { |
397 | path: '/issue', | 397 | path: '/issue', |
398 | meta: {}, | 398 | meta: {}, |
399 | name: 'Issue', | 399 | name: 'Issue', |
400 | props: (route) => ({ type: route.query.type }), | 400 | props: (route) => ({ type: route.query.type }), |
401 | component: () => | 401 | component: () => |
402 | import ( | 402 | import ( |
403 | /* webpackChunkName: "routes" */ | 403 | /* webpackChunkName: "routes" */ |
404 | /* webpackMode: "lazy-once" */ | 404 | /* webpackMode: "lazy-once" */ |
405 | `@/pages/Library/issue.vue` | 405 | `@/pages/Library/issue.vue` |
406 | ) | 406 | ) |
407 | }, | 407 | }, |
408 | { | 408 | { |
409 | path: '/e-books', | 409 | path: '/e-books', |
410 | meta: {}, | 410 | meta: {}, |
411 | name: 'eBooks', | 411 | name: 'eBooks', |
412 | props: (route) => ({ type: route.query.type }), | 412 | props: (route) => ({ type: route.query.type }), |
413 | component: () => | 413 | component: () => |
414 | import ( | 414 | import ( |
415 | /* webpackChunkName: "routes" */ | 415 | /* webpackChunkName: "routes" */ |
416 | /* webpackMode: "lazy-once" */ | 416 | /* webpackMode: "lazy-once" */ |
417 | `@/pages/Library/eBook.vue` | 417 | `@/pages/Library/eBook.vue` |
418 | ) | 418 | ) |
419 | }, | 419 | }, |
420 | { | 420 | { |
421 | path: '/invoiceId/:invoiceid', | 421 | path: '/invoiceId/:invoiceid', |
422 | meta: {}, | 422 | meta: {}, |
423 | name: 'EditInvoice', | 423 | name: 'EditInvoice', |
424 | // props: (route) => ({ type: route.query.type }), | 424 | // props: (route) => ({ type: route.query.type }), |
425 | component: () => | 425 | component: () => |
426 | import ( | 426 | import ( |
427 | /* webpackChunkName: "routes" */ | 427 | /* webpackChunkName: "routes" */ |
428 | /* webpackMode: "lazy-once" */ | 428 | /* webpackMode: "lazy-once" */ |
429 | `@/pages/Account/editInvoice.vue` | 429 | `@/pages/Account/editInvoice.vue` |
430 | ) | 430 | ) |
431 | }, | 431 | }, |
432 | { | 432 | { |
433 | path: '/StudentsAttendence/:id', | 433 | path: '/StudentsAttendence/:id', |
434 | meta: {}, | 434 | meta: {}, |
435 | name: 'ViewStudentsAttendence', | 435 | name: 'ViewStudentsAttendence', |
436 | props: (route) => ({ type: route.query.type }), | 436 | props: (route) => ({ type: route.query.type }), |
437 | component: () => | 437 | component: () => |
438 | import ( | 438 | import ( |
439 | /* webpackChunkName: "routes" */ | 439 | /* webpackChunkName: "routes" */ |
440 | /* webpackMode: "lazy-once" */ | 440 | /* webpackMode: "lazy-once" */ |
441 | `@/pages/Attendence/viewStudentsAttendence.vue` | 441 | `@/pages/Attendence/viewStudentsAttendence.vue` |
442 | ) | 442 | ) |
443 | }, | 443 | }, |
444 | { | 444 | { |
445 | path: '/viewInvoice/:viewInvoiceId', | 445 | path: '/viewInvoice/:viewInvoiceId', |
446 | meta: {}, | 446 | meta: {}, |
447 | name: 'ViewInvoice', | 447 | name: 'ViewInvoice', |
448 | props: (route) => ({ type: route.query.type }), | 448 | props: (route) => ({ type: route.query.type }), |
449 | component: () => | 449 | component: () => |
450 | import ( | 450 | import ( |
451 | /* webpackChunkName: "routes" */ | 451 | /* webpackChunkName: "routes" */ |
452 | /* webpackMode: "lazy-once" */ | 452 | /* webpackMode: "lazy-once" */ |
453 | `@/pages/Account/viewInvoice.vue` | 453 | `@/pages/Account/viewInvoice.vue` |
454 | ) | 454 | ) |
455 | }, | 455 | }, |
456 | { | 456 | { |
457 | path: '/exam', | 457 | path: '/exam', |
458 | meta: {}, | 458 | meta: {}, |
459 | name: 'Exam', | 459 | name: 'Exam', |
460 | props: (route) => ({ type: route.query.type }), | 460 | props: (route) => ({ type: route.query.type }), |
461 | component: () => | 461 | component: () => |
462 | import ( | 462 | import ( |
463 | /* webpackChunkName: "routes" */ | 463 | /* webpackChunkName: "routes" */ |
464 | /* webpackMode: "lazy-once" */ | 464 | /* webpackMode: "lazy-once" */ |
465 | `@/pages/Exam/exam.vue` | 465 | `@/pages/Exam/exam.vue` |
466 | ) | 466 | ) |
467 | }, | 467 | }, |
468 | { | 468 | { |
469 | path: '/grade', | 469 | path: '/grade', |
470 | meta: {}, | 470 | meta: {}, |
471 | name: 'Grade', | 471 | name: 'Grade', |
472 | props: (route) => ({ type: route.query.type }), | 472 | props: (route) => ({ type: route.query.type }), |
473 | component: () => | 473 | component: () => |
474 | import ( | 474 | import ( |
475 | /* webpackChunkName: "routes" */ | 475 | /* webpackChunkName: "routes" */ |
476 | /* webpackMode: "lazy-once" */ | 476 | /* webpackMode: "lazy-once" */ |
477 | `@/pages/Exam/grade.vue` | 477 | `@/pages/Exam/grade.vue` |
478 | ) | 478 | ) |
479 | }, | 479 | }, |
480 | { | 480 | { |
481 | path: '/examSchedule', | 481 | path: '/examSchedule', |
482 | meta: {}, | 482 | meta: {}, |
483 | name: 'ExamSchedule', | 483 | name: 'ExamSchedule', |
484 | props: (route) => ({ type: route.query.type }), | 484 | props: (route) => ({ type: route.query.type }), |
485 | component: () => | 485 | component: () => |
486 | import ( | 486 | import ( |
487 | /* webpackChunkName: "routes" */ | 487 | /* webpackChunkName: "routes" */ |
488 | /* webpackMode: "lazy-once" */ | 488 | /* webpackMode: "lazy-once" */ |
489 | `@/pages/Exam/examSchedule.vue` | 489 | `@/pages/Exam/examSchedule.vue` |
490 | ) | 490 | ) |
491 | }, | 491 | }, |
492 | { | 492 | { |
493 | path: '/mark', | 493 | path: '/mark', |
494 | meta: {}, | 494 | meta: {}, |
495 | name: 'Mark', | 495 | name: 'Mark', |
496 | props: (route) => ({ type: route.query.type }), | 496 | props: (route) => ({ type: route.query.type }), |
497 | component: () => | 497 | component: () => |
498 | import ( | 498 | import ( |
499 | /* webpackChunkName: "routes" */ | 499 | /* webpackChunkName: "routes" */ |
500 | /* webpackMode: "lazy-once" */ | 500 | /* webpackMode: "lazy-once" */ |
501 | `@/pages/Mark/mark.vue` | 501 | `@/pages/Mark/mark.vue` |
502 | ) | 502 | ) |
503 | }, | 503 | }, |
504 | { | 504 | { |
505 | path: '/viewMark/:markId', | 505 | path: '/viewMark/:markId', |
506 | meta: {}, | 506 | meta: {}, |
507 | name: 'viewMark', | 507 | name: 'viewMark', |
508 | props: (route) => ({ type: route.query.type }), | 508 | props: (route) => ({ type: route.query.type }), |
509 | component: () => | 509 | component: () => |
510 | import ( | 510 | import ( |
511 | /* webpackChunkName: "routes" */ | 511 | /* webpackChunkName: "routes" */ |
512 | /* webpackMode: "lazy-once" */ | 512 | /* webpackMode: "lazy-once" */ |
513 | `@/pages/Mark/viewMark.vue` | 513 | `@/pages/Mark/viewMark.vue` |
514 | ) | 514 | ) |
515 | }, | 515 | }, |
516 | { | 516 | { |
517 | path: '/markDistribution', | 517 | path: '/markDistribution', |
518 | meta: {}, | 518 | meta: {}, |
519 | name: 'markDistribution', | 519 | name: 'markDistribution', |
520 | props: (route) => ({ type: route.query.type }), | 520 | props: (route) => ({ type: route.query.type }), |
521 | component: () => | 521 | component: () => |
522 | import ( | 522 | import ( |
523 | /* webpackChunkName: "routes" */ | 523 | /* webpackChunkName: "routes" */ |
524 | /* webpackMode: "lazy-once" */ | 524 | /* webpackMode: "lazy-once" */ |
525 | `@/pages/Mark/markDistribution.vue` | 525 | `@/pages/Mark/markDistribution.vue` |
526 | ) | 526 | ) |
527 | }, | 527 | }, |
528 | { | 528 | { |
529 | path: '/promotion', | 529 | path: '/promotion', |
530 | meta: {}, | 530 | meta: {}, |
531 | name: 'Promotion', | 531 | name: 'Promotion', |
532 | props: (route) => ({ type: route.query.type }), | 532 | props: (route) => ({ type: route.query.type }), |
533 | component: () => | 533 | component: () => |
534 | import ( | 534 | import ( |
535 | /* webpackChunkName: "routes" */ | 535 | /* webpackChunkName: "routes" */ |
536 | /* webpackMode: "lazy-once" */ | 536 | /* webpackMode: "lazy-once" */ |
537 | `@/pages/Mark/promotion.vue` | 537 | `@/pages/Mark/promotion.vue` |
538 | ) | 538 | ) |
539 | }, | 539 | }, |
540 | { | 540 | { |
541 | path: '/academicYear', | 541 | path: '/academicYear', |
542 | meta: {}, | 542 | meta: {}, |
543 | name: 'academicYear', | 543 | name: 'academicYear', |
544 | props: (route) => ({ type: route.query.type }), | 544 | props: (route) => ({ type: route.query.type }), |
545 | component: () => | 545 | component: () => |
546 | import ( | 546 | import ( |
547 | /* webpackChunkName: "routes" */ | 547 | /* webpackChunkName: "routes" */ |
548 | /* webpackMode: "lazy-once" */ | 548 | /* webpackMode: "lazy-once" */ |
549 | `@/pages/Administrator/academicYear.vue` | 549 | `@/pages/Administrator/academicYear.vue` |
550 | ) | 550 | ) |
551 | }, | 551 | }, |
552 | { | 552 | { |
553 | path: '/systemAdmin', | 553 | path: '/systemAdmin', |
554 | meta: {}, | 554 | meta: {}, |
555 | name: 'systemAdmin', | 555 | name: 'systemAdmin', |
556 | props: (route) => ({ type: route.query.type }), | 556 | props: (route) => ({ type: route.query.type }), |
557 | component: () => | 557 | component: () => |
558 | import ( | 558 | import ( |
559 | /* webpackChunkName: "routes" */ | 559 | /* webpackChunkName: "routes" */ |
560 | /* webpackMode: "lazy-once" */ | 560 | /* webpackMode: "lazy-once" */ |
561 | `@/pages/Administrator/systemAdmin.vue` | 561 | `@/pages/Administrator/systemAdmin.vue` |
562 | ) | 562 | ) |
563 | }, | 563 | }, |
564 | { | 564 | { |
565 | path: '/resetPassword', | 565 | path: '/resetPassword', |
566 | meta: {}, | 566 | meta: {}, |
567 | name: 'resetPassword', | 567 | name: 'resetPassword', |
568 | props: (route) => ({ type: route.query.type }), | 568 | props: (route) => ({ type: route.query.type }), |
569 | component: () => | 569 | component: () => |
570 | import ( | 570 | import ( |
571 | /* webpackChunkName: "routes" */ | 571 | /* webpackChunkName: "routes" */ |
572 | /* webpackMode: "lazy-once" */ | 572 | /* webpackMode: "lazy-once" */ |
573 | `@/pages/Administrator/resetPassword.vue` | 573 | `@/pages/Administrator/resetPassword.vue` |
574 | ) | 574 | ) |
575 | }, | 575 | }, |
576 | { | 576 | { |
577 | path: '/role', | 577 | path: '/role', |
578 | meta: {}, | 578 | meta: {}, |
579 | name: 'Role', | 579 | name: 'Role', |
580 | props: (route) => ({ type: route.query.type }), | 580 | props: (route) => ({ type: route.query.type }), |
581 | component: () => | 581 | component: () => |
582 | import ( | 582 | import ( |
583 | /* webpackChunkName: "routes" */ | 583 | /* webpackChunkName: "routes" */ |
584 | /* webpackMode: "lazy-once" */ | 584 | /* webpackMode: "lazy-once" */ |
585 | `@/pages/Administrator/role.vue` | 585 | `@/pages/Administrator/role.vue` |
586 | ) | 586 | ) |
587 | }, | 587 | }, |
588 | { | 588 | { |
589 | path: '/studentReport', | 589 | path: '/studentReport', |
590 | meta: {}, | 590 | meta: {}, |
591 | name: 'studentReport', | 591 | name: 'studentReport', |
592 | props: (route) => ({ type: route.query.type }), | 592 | props: (route) => ({ type: route.query.type }), |
593 | component: () => | 593 | component: () => |
594 | import ( | 594 | import ( |
595 | /* webpackChunkName: "routes" */ | 595 | /* webpackChunkName: "routes" */ |
596 | /* webpackMode: "lazy-once" */ | 596 | /* webpackMode: "lazy-once" */ |
597 | `@/pages/Report/studentReport.vue` | 597 | `@/pages/Report/studentReport.vue` |
598 | ) | 598 | ) |
599 | }, | 599 | }, |
600 | { | 600 | { |
601 | path: '/progressCardReport', | 601 | path: '/progressCardReport', |
602 | meta: {}, | 602 | meta: {}, |
603 | name: 'progressCardReport', | 603 | name: 'progressCardReport', |
604 | props: (route) => ({ type: route.query.type }), | 604 | props: (route) => ({ type: route.query.type }), |
605 | component: () => | 605 | component: () => |
606 | import ( | 606 | import ( |
607 | /* webpackChunkName: "routes" */ | 607 | /* webpackChunkName: "routes" */ |
608 | /* webpackMode: "lazy-once" */ | 608 | /* webpackMode: "lazy-once" */ |
609 | `@/pages/Report/progressCardReport.vue` | 609 | `@/pages/Report/progressCardReport.vue` |
610 | ) | 610 | ) |
611 | }, | 611 | }, |
612 | { | 612 | { |
613 | path: '/generalSetting', | 613 | path: '/generalSetting', |
614 | meta: {}, | 614 | meta: {}, |
615 | name: 'generalSetting', | 615 | name: 'generalSetting', |
616 | props: (route) => ({ type: route.query.type }), | 616 | props: (route) => ({ type: route.query.type }), |
617 | component: () => | 617 | component: () => |
618 | import ( | 618 | import ( |
619 | /* webpackChunkName: "routes" */ | 619 | /* webpackChunkName: "routes" */ |
620 | /* webpackMode: "lazy-once" */ | 620 | /* webpackMode: "lazy-once" */ |
621 | `@/pages/generalSetting/generalSetting.vue` | 621 | `@/pages/generalSetting/generalSetting.vue` |
622 | ) | 622 | ) |
623 | }, | ||
624 | |||
625 | { | ||
626 | path: '/school', | ||
627 | meta: {}, | ||
628 | name: 'School', | ||
629 | props: (route) => ({ type: route.query.type }), | ||
630 | component: () => | ||
631 | import ( | ||
632 | /* webpackChunkName: "routes" */ | ||
633 | /* webpackMode: "lazy-once" */ | ||
634 | `@/pages/School/school.vue` | ||
635 | ) | ||
623 | } | 636 | } |
624 | ]; | 637 | ]; |
src/store/store.js
1 | import Vue from 'vue' | 1 | import Vue from 'vue' |
2 | import Vuex from 'vuex' | 2 | import Vuex from 'vuex' |
3 | import createPersistedState from 'vuex-persistedstate' | 3 | import createPersistedState from 'vuex-persistedstate' |
4 | 4 | ||
5 | Vue.use(Vuex) | 5 | Vue.use(Vuex) |
6 | 6 | ||
7 | export default new Vuex.Store({ | 7 | export default new Vuex.Store({ |
8 | strict:true, | 8 | strict: true, |
9 | plugins:[ | 9 | plugins: [ |
10 | createPersistedState() | 10 | createPersistedState() |
11 | ], | 11 | ], |
12 | state: { | 12 | state: { |
13 | token: null, | 13 | token: null, |
14 | data: null, | 14 | data: null, |
15 | isUserLoggedIn: false, | 15 | isUserLoggedIn: false, |
16 | id: null, | 16 | id: null, |
17 | role: null | ||
17 | }, | 18 | }, |
18 | // serve as the one and only way to change the state of the data in the state object | 19 | // serve as the one and only way to change the state of the data in the state object |
19 | mutations: { | 20 | mutations: { |
20 | setToken (state, token) { | 21 | setToken(state, token) { |
21 | state.token = token | 22 | state.token = token |
22 | //state.isUserLoggedIn = !!(token) | 23 | //state.isUserLoggedIn = !!(token) |
23 | if (token != null) { | 24 | if (token != null) { |
24 | state.isUserLoggedIn = true | 25 | state.isUserLoggedIn = true |
25 | } else { | 26 | } else { |
26 | state.isUserLoggedIn = false | 27 | state.isUserLoggedIn = false |
27 | } | 28 | } |
28 | }, | 29 | }, |
29 | setUser (state, data) { | 30 | setUser(state, data) { |
30 | state.data = data | 31 | state.data = data |
31 | }, | 32 | }, |
32 | Id (state, id) { | 33 | Id(state, id) { |
33 | state.id = id | 34 | state.id = id |
34 | }, | 35 | }, |
35 | }, | 36 | Role(state, role) { |
37 | state.role = role | ||
38 | } | ||
39 | }, | ||
36 | //Action methods are referred to as being "dispatched" | 40 | //Action methods are referred to as being "dispatched" |
37 | actions: { | 41 | actions: { |
38 | setToken ({commit}, token) { | 42 | setToken({ commit }, token) { |
39 | commit('setToken', token) | 43 | commit('setToken', token) |
40 | }, | 44 | }, |
41 | setUser ({commit}, data) { | 45 | setUser({ commit }, data) { |
42 | commit('setUser', data) | 46 | commit('setUser', data) |
43 | }, | 47 | }, |
44 | Id ({commit}, id) { | 48 | Id({ commit }, id) { |
45 | commit('Id', id) | 49 | commit('Id', id) |
50 | }, | ||
51 | Role({ commit }, role) { | ||
52 | commit('Role', role) | ||
46 | } | 53 | } |
47 | 54 | ||
48 | } | 55 | } |
49 | 56 | ||
50 | }) | 57 | }) |