Commit 710438de6a76ef8b91cdc07b22c97d96384d6f0c
1 parent
0655a532c6
Exists in
master
and in
3 other branches
added teacher module in dashboard, added academic module while admin login, exam…
… attendence in teacher login
Showing
28 changed files
with
4179 additions
and
294 deletions
Show diff stats
src/api/menu.js
... | ... | @@ -53,8 +53,8 @@ const adminMenu = [ |
53 | 53 | icon: '/static/icon/attendence.png', |
54 | 54 | items: [ |
55 | 55 | { name: 'StudentAttendence', title: 'Student Attendance', component: 'Student Attendence', action: '', }, |
56 | - { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', } | |
57 | - // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, | |
56 | + { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', }, | |
57 | + // { name: 'userAttendence', title: 'User Attendance', component: 'User Attendence', action: '', }, | |
58 | 58 | ] |
59 | 59 | }, |
60 | 60 | { |
... | ... | @@ -82,6 +82,18 @@ const adminMenu = [ |
82 | 82 | ] |
83 | 83 | }, |
84 | 84 | { |
85 | + title: 'Academic', | |
86 | + group: 'Academic', | |
87 | + component: 'Academic', | |
88 | + icon: '/static/icon/school.png', | |
89 | + items: [ | |
90 | + { name: 'Subject', title: 'Subject', component: 'Subject', action: '', }, | |
91 | + { name: 'Syllabus', title: 'Syllabus', component: 'Syllabus', action: '', }, | |
92 | + { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, | |
93 | + { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, | |
94 | + ] | |
95 | + }, | |
96 | + { | |
85 | 97 | title: 'Administrator', |
86 | 98 | group: 'Administrator', |
87 | 99 | component: 'Administrator', |
... | ... | @@ -95,6 +107,17 @@ const adminMenu = [ |
95 | 107 | |
96 | 108 | ] |
97 | 109 | }, |
110 | + // { | |
111 | + // title: 'Payroll', | |
112 | + // group: 'Payroll', | |
113 | + // component: 'Payroll', | |
114 | + // icon: '/static/icon/dollar.png', | |
115 | + // items: [ | |
116 | + // { name: 'salaryTemplate', title: 'Salary Template', component: 'Salary Template', action: '', }, | |
117 | + // { name: 'hourlyTemplate', title: 'Hourly Template', component: 'Hourly Template', action: '', }, | |
118 | + // { name: 'manageSalary', title: 'Manage Salary', component: 'Manage Salary', action: '', }, | |
119 | + // ] | |
120 | + // }, | |
98 | 121 | { |
99 | 122 | title: 'Notice Board', |
100 | 123 | name: 'Notice Board', |
... | ... | @@ -137,7 +160,7 @@ const adminMenu = [ |
137 | 160 | { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', }, |
138 | 161 | { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }, |
139 | 162 | { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', }, |
140 | - { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '',} | |
163 | + { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '', } | |
141 | 164 | ] |
142 | 165 | }, |
143 | 166 | { |
... | ... | @@ -231,6 +254,97 @@ const schoolMenu = [ |
231 | 254 | } |
232 | 255 | ]; |
233 | 256 | |
257 | +const teacherMenu = [ | |
258 | + { | |
259 | + title: 'Dashboard', | |
260 | + name: 'School', | |
261 | + icon: '/static/icon/dashboard.png', | |
262 | + }, | |
263 | + { | |
264 | + title: 'Parents', | |
265 | + // group: 'apps', | |
266 | + name: 'Parents', | |
267 | + icon: '/static/icon/parents.png', | |
268 | + }, | |
269 | + { | |
270 | + title: 'Teachers', | |
271 | + // group: '', | |
272 | + name: 'Teachers', | |
273 | + icon: '/static/icon/teacher.png', | |
274 | + }, | |
275 | + { | |
276 | + title: 'Students', | |
277 | + // group: 'apps', | |
278 | + name: 'Students', | |
279 | + icon: '/static/icon/student.png', | |
280 | + }, | |
281 | + { | |
282 | + title: 'Academic', | |
283 | + group: 'Academic', | |
284 | + component: 'Academic', | |
285 | + icon: '/static/icon/school.png', | |
286 | + items: [ | |
287 | + { name: 'Subject', title: 'Subject', component: 'Subject', action: '', }, | |
288 | + { name: 'Syllabus', title: 'Syllabus', component: 'Syllabus', action: '', }, | |
289 | + { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, | |
290 | + { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, | |
291 | + ] | |
292 | + }, | |
293 | + { | |
294 | + title: 'Attendance', | |
295 | + group: 'Attendance', | |
296 | + component: 'Attendance', | |
297 | + icon: '/static/icon/attendence.png', | |
298 | + items: [ | |
299 | + { name: 'StudentAttendence', title: 'Student Attendance', component: 'Student Attendence', action: '', }, | |
300 | + { name: 'TeacherAttendence', title: 'Teacher Attendance', component: 'Teacher Attendence', action: '', }, | |
301 | + // { name: 'userAttendence', title: 'User Attendance', component: 'User Attendence', action: '', }, | |
302 | + ] | |
303 | + }, | |
304 | + { | |
305 | + title: 'Exam', | |
306 | + group: 'Exam', | |
307 | + component: 'Exam', | |
308 | + icon: '/static/icon/exam.png', | |
309 | + items: [ | |
310 | + { name: 'ExamSchedule', title: 'Exam Schedule', component: 'Exam Schedule', action: '', }, | |
311 | + { name: 'ExamAttendence', title: 'Exam Attendence', component: 'Exam Attendence', action: '', } | |
312 | + ] | |
313 | + }, | |
314 | + { | |
315 | + title: 'Marks', | |
316 | + group: 'Mark', | |
317 | + component: 'Mark', | |
318 | + icon: '/static/icon/marks.png', | |
319 | + items: [ | |
320 | + { name: 'Mark', title: 'Mark', component: 'Mark', action: '', } | |
321 | + ] | |
322 | + }, | |
323 | + { | |
324 | + title: 'Report', | |
325 | + group: 'Report', | |
326 | + component: 'Report', | |
327 | + icon: '/static/icon/reports.png', | |
328 | + items: [ | |
329 | + { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', }, | |
330 | + { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }, | |
331 | + { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', }, | |
332 | + { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '', } | |
333 | + ] | |
334 | + }, | |
335 | + { | |
336 | + title: 'Library', | |
337 | + group: 'Library', | |
338 | + component: 'Library', | |
339 | + icon: '/static/icon/library.png', | |
340 | + items: [ | |
341 | + { name: 'Books', title: 'Books', component: 'Books', action: '', }, | |
342 | + { name: 'E-Books', title: 'E-Books', component: 'E-Books', action: '', } | |
343 | + | |
344 | + ] | |
345 | + }, | |
346 | +]; | |
347 | + | |
234 | 348 | // reorder menu |
235 | 349 | // Menu.forEach((item) => { |
236 | 350 | // if (item.items) { |
... | ... | @@ -242,4 +356,4 @@ const schoolMenu = [ |
242 | 356 | // } |
243 | 357 | // }); |
244 | 358 | |
245 | -export default { adminMenu, schoolMenu, libraryMenu, accountMenu }; | |
246 | 359 | \ No newline at end of file |
360 | +export default { adminMenu, schoolMenu, teacherMenu, libraryMenu, accountMenu }; | |
247 | 361 | \ No newline at end of file | ... | ... |
src/components/pageHeader/AppDrawer.vue
... | ... | @@ -227,6 +227,103 @@ |
227 | 227 | <!-- </a> --> |
228 | 228 | </v-list-tile> |
229 | 229 | </template> |
230 | + <template v-for="(item, i) in menuTeacher" v-if="role === 'TEACHER'"> | |
231 | + <!-- {{menus}} --> | |
232 | + <!--group with subitems--> | |
233 | + <v-list-group | |
234 | + v-if="item.items" | |
235 | + :key="item.name" | |
236 | + :group="item.group" | |
237 | + no-action="no-action" | |
238 | + > | |
239 | + <v-list-tile slot="activator" ripple="ripple"> | |
240 | + <v-list-tile-action v-if="item.icon"> | |
241 | + <img :src="item.icon" width="22" alt="icons" /> | |
242 | + </v-list-tile-action> | |
243 | + <v-list-tile-content> | |
244 | + <v-list-tile-title>{{ item.title }}</v-list-tile-title> | |
245 | + </v-list-tile-content> | |
246 | + </v-list-tile> | |
247 | + <template v-for="(subItem, i) in item.items"> | |
248 | + <!--sub group--> | |
249 | + <v-list-group | |
250 | + v-if="subItem.items" | |
251 | + :key="subItem.name" | |
252 | + :group="subItem.group" | |
253 | + sub-group="sub-group" | |
254 | + > | |
255 | + <v-list-tile slot="activator" ripple="ripple"> | |
256 | + <v-list-tile-content> | |
257 | + <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | |
258 | + </v-list-tile-content> | |
259 | + </v-list-tile> | |
260 | + <v-list-tile | |
261 | + v-for="(grand, i) in subItem.children" | |
262 | + :key="i" | |
263 | + :to="genChildTarget(item, grand)" | |
264 | + :href="grand.href" | |
265 | + ripple="ripple" | |
266 | + > | |
267 | + <v-list-tile-content> | |
268 | + <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | |
269 | + </v-list-tile-content> | |
270 | + </v-list-tile> | |
271 | + </v-list-group> | |
272 | + <!--child item--> | |
273 | + <v-list-tile | |
274 | + v-else | |
275 | + :key="i" | |
276 | + :to="genChildTarget(item, subItem)" | |
277 | + :href="subItem.href" | |
278 | + :disabled="subItem.disabled" | |
279 | + :target="subItem.target" | |
280 | + ripple="ripple" | |
281 | + > | |
282 | + <v-list-tile-action v-if="subItem.action"> | |
283 | + <img | |
284 | + width="30" | |
285 | + :src="subItem.action" | |
286 | + :class="[subItem.actionClass || 'success--text']" | |
287 | + /> | |
288 | + </v-list-tile-action> | |
289 | + <v-list-tile-content> | |
290 | + <v-list-tile-title class="body-2"> | |
291 | + <span>{{ subItem.title }}</span> | |
292 | + </v-list-tile-title> | |
293 | + </v-list-tile-content> | |
294 | + <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | |
295 | + </v-list-tile> | |
296 | + </template> | |
297 | + </v-list-group> | |
298 | + <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | |
299 | + <v-divider v-else-if="item.divider" :key="i"></v-divider> | |
300 | + <!--top-level link--> | |
301 | + <v-list-tile | |
302 | + v-else | |
303 | + ripple="ripple" | |
304 | + :disabled="item.disabled" | |
305 | + :target="item.target" | |
306 | + rel="noopener" | |
307 | + :key="item.name" | |
308 | + :to="!item.href ? { name: item.name } : null" | |
309 | + :href="item.href" | |
310 | + > | |
311 | + <!-- <a :href="item.path"> --> | |
312 | + <v-list-tile-action v-if="item.icon"> | |
313 | + <img :src="item.icon" width="22" alt="icons" /> | |
314 | + </v-list-tile-action> | |
315 | + <v-list-tile-content class="pt-2"> | |
316 | + <v-list-tile-title>{{ item.title }}</v-list-tile-title> | |
317 | + </v-list-tile-content> | |
318 | + <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | |
319 | + <v-list-tile-action v-if="item.subAction"> | |
320 | + <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | |
321 | + <!-- <img :src="item.icon" width="40" alt="icons" /> --> | |
322 | + </v-list-tile-action> | |
323 | + <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | |
324 | + <!-- </a> --> | |
325 | + </v-list-tile> | |
326 | + </template> | |
230 | 327 | </v-list> |
231 | 328 | </vue-perfect-scrollbar> |
232 | 329 | </v-navigation-drawer> |
... | ... | @@ -250,6 +347,7 @@ export default { |
250 | 347 | drawer: true, |
251 | 348 | menus: [], |
252 | 349 | menuSchool: [], |
350 | + menuTeacher: [], | |
253 | 351 | schoolRole: "", |
254 | 352 | role: "", |
255 | 353 | scrollSettings: { |
... | ... | @@ -273,6 +371,7 @@ export default { |
273 | 371 | this.role = this.$store.state.role; |
274 | 372 | this.menus = menu.adminMenu; |
275 | 373 | this.menuSchool = menu.schoolMenu; |
374 | + this.menuTeacher = menu.teacherMenu; | |
276 | 375 | // console.log("this.$route.name", this.$route.name); |
277 | 376 | // if (this.$route.name === "School") { |
278 | 377 | // localStorage.setItem("SchoolName", this.$route.name); |
... | ... | @@ -323,6 +422,9 @@ export default { |
323 | 422 | this.token = this.$store.state.token; |
324 | 423 | } if (this.$store.state.schoolRole === "SUPERADMIN") { |
325 | 424 | this.token = this.$store.schoolToken; |
425 | + } if (this.$store.state.role === "TEACHER") { | |
426 | + this.token = this.$store.state.token; | |
427 | + // console.log("token",this.token); | |
326 | 428 | } |
327 | 429 | } |
328 | 430 | }; | ... | ... |
src/event.js
... | ... | @@ -17,12 +17,16 @@ export default [{ |
17 | 17 | this.$store.dispatch('setToken', null) |
18 | 18 | this.$store.dispatch('Id', null) |
19 | 19 | this.$store.dispatch('Role', null) |
20 | - | |
21 | 20 | this.$router.replace({ path: '/' }); |
22 | 21 | } else if (this.$store.state.schoolRole === "SUPERADMIN") { |
23 | 22 | this.$store.dispatch('setSchoolToken', null) |
24 | 23 | this.$store.dispatch('setSchoolRole', null) |
25 | 24 | this.$router.replace({ path: '/' }); |
25 | + } else if (this.$store.state.role === "TEACHER") { | |
26 | + this.$store.dispatch('setToken', null) | |
27 | + this.$store.dispatch('Id', null) | |
28 | + this.$store.dispatch('Role', null) | |
29 | + this.$router.replace({ path: '/' }); | |
26 | 30 | } |
27 | 31 | } |
28 | 32 | }, | ... | ... |
src/pages/Academic/assignment.vue
... | ... | @@ -0,0 +1,850 @@ |
1 | +<template> | |
2 | + <v-container fluid class="body-color"> | |
3 | + <!-- ****** EDIT Assignment ****** --> | |
4 | + <v-dialog v-model="editAssignmentDialog" max-width="400px"> | |
5 | + <v-card flat class="card-style pa-2" dark> | |
6 | + <v-layout> | |
7 | + <v-flex xs12> | |
8 | + <label class="title text-xs-center">Edit Assignment</label> | |
9 | + <v-icon size="24" class="right" @click="editAssignmentDialog = false">cancel</v-icon> | |
10 | + </v-flex> | |
11 | + </v-layout> | |
12 | + <v-container fluid> | |
13 | + <v-form ref="formEditAssignment" v-model="validEditAssignment" lazy-validation> | |
14 | + <v-layout> | |
15 | + <v-flex xs4 class="pt-4 subheading"> | |
16 | + <label class="right">Title:</label> | |
17 | + </v-flex> | |
18 | + <v-flex xs8 class="ml-3"> | |
19 | + <v-text-field v-model="editedItem.title" type="text" :rules="titleRules" required></v-text-field> | |
20 | + </v-flex> | |
21 | + </v-layout> | |
22 | + <v-layout> | |
23 | + <v-flex xs4 class="pt-4 subheading"> | |
24 | + <label class="right">Description:</label> | |
25 | + </v-flex> | |
26 | + <v-flex xs8 class="ml-3"> | |
27 | + <v-text-field | |
28 | + v-model="editedItem.description" | |
29 | + type="text" | |
30 | + :rules="deadlineRules" | |
31 | + required | |
32 | + ></v-text-field> | |
33 | + </v-flex> | |
34 | + </v-layout> | |
35 | + <v-layout> | |
36 | + <v-flex xs4 class="pt-4 subheading"> | |
37 | + <label class="right">Deadline:</label> | |
38 | + </v-flex> | |
39 | + <v-flex xs8 class="pt-4 subheading"> | |
40 | + <v-menu | |
41 | + ref="menu1" | |
42 | + :close-on-content-click="false" | |
43 | + v-model="menu1" | |
44 | + :nudge-right="40" | |
45 | + :return-value.sync="menu1" | |
46 | + lazy | |
47 | + transition="scale-transition" | |
48 | + offset-y | |
49 | + full-width | |
50 | + min-width="290px" | |
51 | + > | |
52 | + <v-text-field | |
53 | + slot="activator" | |
54 | + v-model="editedItem.deadline" | |
55 | + label="Select Date" | |
56 | + :rules="deadlineRules" | |
57 | + append-icon="event" | |
58 | + required | |
59 | + ></v-text-field> | |
60 | + <v-date-picker v-model="editedItem.date" @input="menu1 = false"></v-date-picker> | |
61 | + </v-menu> | |
62 | + </v-flex> | |
63 | + </v-layout> | |
64 | + <v-layout> | |
65 | + <v-flex xs4 class="pt-4 subheading"> | |
66 | + <label class="right">Class:</label> | |
67 | + </v-flex> | |
68 | + <v-flex xs8 class="ml-3"> | |
69 | + <v-select | |
70 | + :items="classList" | |
71 | + item-text="classNum" | |
72 | + item-value="_id" | |
73 | + :rules="classRules" | |
74 | + v-model="editedItem.classId" | |
75 | + @change="getSections(addAssignment.classId)" | |
76 | + required | |
77 | + ></v-select> | |
78 | + </v-flex> | |
79 | + </v-layout> | |
80 | + <v-layout> | |
81 | + <v-flex xs4 class="pt-4 subheading"> | |
82 | + <label class="right">Section:</label> | |
83 | + </v-flex> | |
84 | + <v-flex xs8 class="ml-3"> | |
85 | + <v-select | |
86 | + :items="addSection" | |
87 | + item-text="name" | |
88 | + item-value="_id" | |
89 | + v-model="editedItem.sectionId" | |
90 | + :rules="sectionRules" | |
91 | + @change="getClassSubject(addAssignment.classId)" | |
92 | + required | |
93 | + ></v-select> | |
94 | + </v-flex> | |
95 | + </v-layout> | |
96 | + <v-layout> | |
97 | + <v-flex xs4 class="pt-4 subheading"> | |
98 | + <label class="right">Subject</label> | |
99 | + </v-flex> | |
100 | + <v-flex xs8 class="ml-3"> | |
101 | + <v-select | |
102 | + :items="subjectList.subjects" | |
103 | + v-model="editedItem.subjectName" | |
104 | + item-text="subjectName" | |
105 | + item-value="_id" | |
106 | + :rules="subjectRules" | |
107 | + required | |
108 | + ></v-select> | |
109 | + </v-flex> | |
110 | + </v-layout> | |
111 | + <v-layout> | |
112 | + <v-flex xs4 class="pt-4 subheading"> | |
113 | + <label class="right">File:</label> | |
114 | + </v-flex> | |
115 | + <v-flex xs8 class="ml-3"> | |
116 | + <v-text-field | |
117 | + label="Select file" | |
118 | + @click="pickFile" | |
119 | + v-model="editedItem.imageName" | |
120 | + append-icon="attach_file" | |
121 | + ></v-text-field> | |
122 | + <input | |
123 | + type="file" | |
124 | + style="display:none" | |
125 | + ref="image" | |
126 | + accept="image/*" | |
127 | + @change="onFilePicked" | |
128 | + /> | |
129 | + </v-flex> | |
130 | + </v-layout> | |
131 | + <v-flex xs12 sm12> | |
132 | + <v-card-actions> | |
133 | + <v-spacer></v-spacer> | |
134 | + <v-btn round dark @click="save" :loading="editLoading" class="add-button">Save</v-btn> | |
135 | + </v-card-actions> | |
136 | + </v-flex> | |
137 | + </v-form> | |
138 | + </v-container> | |
139 | + </v-card> | |
140 | + </v-dialog> | |
141 | + | |
142 | + <!-- ****** VIEW PROFIL NOTICE BOARD ****** --> | |
143 | + <v-dialog v-model="viewAssignmentDialog" max-width="500px"> | |
144 | + <v-card flat class="card-style pa-3" dark> | |
145 | + <v-layout> | |
146 | + <v-flex xs12> | |
147 | + <label class="title text-xs-center">View Attendence</label> | |
148 | + <v-icon size="24" class="right" @click="viewAssignmentDialog = false">cancel</v-icon> | |
149 | + </v-flex> | |
150 | + </v-layout> | |
151 | + <v-card-text> | |
152 | + <v-container grid-list-md> | |
153 | + <v-layout wrap> | |
154 | + <v-flex> | |
155 | + <v-layout> | |
156 | + <v-flex xs6 sm4> | |
157 | + <h5 class="right my-1"> | |
158 | + <b>Title:</b> | |
159 | + </h5> | |
160 | + </v-flex> | |
161 | + <v-flex sm8 xs6> | |
162 | + <h5 class="my-1">{{ editedItem.title }}</h5> | |
163 | + </v-flex> | |
164 | + </v-layout> | |
165 | + <v-layout> | |
166 | + <v-flex xs6 sm4> | |
167 | + <h5 class="right my-1"> | |
168 | + <b>Description:</b> | |
169 | + </h5> | |
170 | + </v-flex> | |
171 | + <v-flex sm8 xs6> | |
172 | + <h5 class="my-1">{{ editedItem.description }}</h5> | |
173 | + </v-flex> | |
174 | + </v-layout> | |
175 | + <v-layout> | |
176 | + <v-flex xs6 sm4> | |
177 | + <h5 class="right my-1"> | |
178 | + <b>Deadline:</b> | |
179 | + </h5> | |
180 | + </v-flex> | |
181 | + <v-flex sm8 xs6> | |
182 | + <h5 class="my-1">{{ dates(editedItem.deadline) }}</h5> | |
183 | + </v-flex> | |
184 | + </v-layout> | |
185 | + </v-flex> | |
186 | + </v-layout> | |
187 | + </v-container> | |
188 | + </v-card-text> | |
189 | + </v-card> | |
190 | + </v-dialog> | |
191 | + | |
192 | + <!-- ****** EXISTING ASSIGNMENT TABLE ****** --> | |
193 | + <v-toolbar color="transparent" flat> | |
194 | + <v-btn | |
195 | + fab | |
196 | + dark | |
197 | + class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | |
198 | + small | |
199 | + @click="addAssignmentDialog = true" | |
200 | + > | |
201 | + <v-icon dark>add</v-icon> | |
202 | + </v-btn> | |
203 | + <v-flex xs1 class="hidden-sm-only hidden-xs-only"> | |
204 | + <v-btn round class="open-dialog-button" dark @click="addAssignmentDialog = true"> | |
205 | + <v-icon class="white--text pr-1" size="20">add</v-icon>Add Assignment | |
206 | + </v-btn> | |
207 | + </v-flex> | |
208 | + <v-spacer></v-spacer> | |
209 | + <v-flex lg2 md2 xs12 v-show="show"> | |
210 | + <v-select | |
211 | + :items="classList" | |
212 | + label="Select Your Class" | |
213 | + v-model="addAssignment.classId" | |
214 | + item-text="classNum" | |
215 | + item-value="_id" | |
216 | + name="Select Class" | |
217 | + :rules="classRules" | |
218 | + @change="getAssignmentList()" | |
219 | + class="pl-2" | |
220 | + required | |
221 | + ></v-select> | |
222 | + </v-flex> | |
223 | + <v-card-title class="body-1" v-show="show"> | |
224 | + <v-btn icon flat @click="displaySearch"> | |
225 | + <v-avatar size="27"> | |
226 | + <img src="/static/icon/search.png" alt="icon" /> | |
227 | + </v-avatar> | |
228 | + </v-btn> | |
229 | + </v-card-title> | |
230 | + <v-flex xs9 sm9 md2 lg2 xl2 v-show="showSearch"> | |
231 | + <v-layout> | |
232 | + <v-text-field | |
233 | + v-model="search" | |
234 | + label="Search" | |
235 | + prepend-inner-icon="search" | |
236 | + color="primary" | |
237 | + style="transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); !important" | |
238 | + ></v-text-field> | |
239 | + <v-icon @click="closeSearch" color="error">close</v-icon> | |
240 | + </v-layout> | |
241 | + </v-flex> | |
242 | + </v-toolbar> | |
243 | + <v-data-table | |
244 | + :headers="headers" | |
245 | + :items="assignmentData" | |
246 | + :pagination.sync="pagination" | |
247 | + :search="search" | |
248 | + > | |
249 | + <template slot="items" slot-scope="props"> | |
250 | + <tr class="tr"> | |
251 | + <td class="td-row td">{{ props.index + 1 }}</td> | |
252 | + <td class="text-xs-center td td-row">{{ props.item.title }}</td> | |
253 | + <td class="text-xs-center td td-row">{{ props.item.description }}</td> | |
254 | + <td class="text-xs-center td td-row">{{ props.item.deadline }}</td> | |
255 | + <td class="text-xs-center td td-row">{{ props.item.sectionId.name }}</td> | |
256 | + <td class="text-xs-center td td-row" v-if="role != 'ADMIN' ">{{ props.item.teacherId.name }}</td> | |
257 | + <td class="text-xs-center td td-row" v-if="role != 'TEACHER' ">{{ props.item.schoolId .name }}</td> | |
258 | + <!-- <td class="text-xs-center td td-row">{{ props.item.file }}</td> --> | |
259 | + <td class="text-xs-center td td-row"> | |
260 | + <span> | |
261 | + <v-tooltip top> | |
262 | + <img | |
263 | + slot="activator" | |
264 | + style="cursor:pointer; width:25px; height:25px; " | |
265 | + class="mr-3" | |
266 | + @click="profile(props.item)" | |
267 | + src="/static/icon/view.png" | |
268 | + /> | |
269 | + <span>View</span> | |
270 | + </v-tooltip> | |
271 | + <v-tooltip top> | |
272 | + <img | |
273 | + slot="activator" | |
274 | + style="cursor:pointer; width:20px; height:18px; " | |
275 | + class="mr-3" | |
276 | + @click="editItem(props.item)" | |
277 | + src="/static/icon/edit.png" | |
278 | + /> | |
279 | + <span>Edit</span> | |
280 | + </v-tooltip> | |
281 | + <v-tooltip top> | |
282 | + <img | |
283 | + slot="activator" | |
284 | + style="cursor:pointer; width:20px; height:20px; " | |
285 | + class="mr-3" | |
286 | + @click="deleteItem(props.item)" | |
287 | + src="/static/icon/delete.png" | |
288 | + /> | |
289 | + <span>Delete</span> | |
290 | + </v-tooltip> | |
291 | + </span> | |
292 | + </td> | |
293 | + </tr> | |
294 | + </template> | |
295 | + <v-alert | |
296 | + slot="no-results" | |
297 | + :value="true" | |
298 | + color="error" | |
299 | + icon="warning" | |
300 | + >Your search for "{{ search }}" found no results.</v-alert> | |
301 | + </v-data-table> | |
302 | + <!-- ****** ADD MULTIPLE Subject ****** --> | |
303 | + <v-snackbar | |
304 | + :timeout="timeout" | |
305 | + :top="y === 'top'" | |
306 | + :right="x === 'right'" | |
307 | + :vertical="mode === 'vertical'" | |
308 | + v-model="snackbar" | |
309 | + :color="color" | |
310 | + >{{ text }}</v-snackbar> | |
311 | + <v-dialog v-model="addAssignmentDialog" max-width="400px"> | |
312 | + <v-card flat class="card-style pa-2" dark> | |
313 | + <v-layout> | |
314 | + <v-flex xs12> | |
315 | + <label class="title text-xs-center">Add Assignment</label> | |
316 | + <v-icon size="24" class="right" @click="addAssignmentDialog = false">cancel</v-icon> | |
317 | + </v-flex> | |
318 | + </v-layout> | |
319 | + <v-container fluid fill-height> | |
320 | + <v-layout align-center> | |
321 | + <v-flex xs12> | |
322 | + <v-form ref="form" v-model="valid" lazy-validation> | |
323 | + <v-layout> | |
324 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
325 | + <label class="right">Title :</label> | |
326 | + </v-flex> | |
327 | + <v-flex xs8 sm8 class="ml-3"> | |
328 | + <v-text-field | |
329 | + name="name" | |
330 | + type="text" | |
331 | + :rules="titleRules" | |
332 | + v-model="addAssignment.title" | |
333 | + required | |
334 | + ></v-text-field> | |
335 | + </v-flex> | |
336 | + </v-layout> | |
337 | + <v-layout> | |
338 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
339 | + <label class="right">Description :</label> | |
340 | + </v-flex> | |
341 | + <v-flex xs8 sm8 class="ml-3"> | |
342 | + <v-text-field | |
343 | + name="name" | |
344 | + type="text" | |
345 | + :rules="descriptionRules" | |
346 | + v-model="addAssignment.description" | |
347 | + required | |
348 | + ></v-text-field> | |
349 | + </v-flex> | |
350 | + </v-layout> | |
351 | + <v-layout> | |
352 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
353 | + <label class="right">Deadline :</label> | |
354 | + </v-flex> | |
355 | + <v-flex xs8 sm7 class="ml-3"> | |
356 | + <v-menu | |
357 | + ref="menu2" | |
358 | + :close-on-content-click="false" | |
359 | + v-model="menu2" | |
360 | + :nudge-right="40" | |
361 | + :return-value.sync="addAssignment.date" | |
362 | + lazy | |
363 | + transition="scale-transition" | |
364 | + offset-y | |
365 | + full-width | |
366 | + min-width="290px" | |
367 | + > | |
368 | + <v-text-field | |
369 | + slot="activator" | |
370 | + v-model="addAssignment.deadline" | |
371 | + :rules="deadlineRules" | |
372 | + label="Select Date" | |
373 | + append-icon="event" | |
374 | + readonly | |
375 | + ></v-text-field> | |
376 | + <v-date-picker | |
377 | + v-model="addAssignment.deadline" | |
378 | + @input="$refs.menu2.save(addAssignment.date)" | |
379 | + ></v-date-picker> | |
380 | + </v-menu> | |
381 | + </v-flex> | |
382 | + </v-layout> | |
383 | + <v-layout> | |
384 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
385 | + <label class="right">Class :</label> | |
386 | + </v-flex> | |
387 | + <v-flex xs8 sm8 class="ml-3"> | |
388 | + <v-select | |
389 | + :items="classList" | |
390 | + label="Select Class" | |
391 | + item-text="classNum" | |
392 | + item-value="_id" | |
393 | + v-model="addAssignment.classId" | |
394 | + name="Select Class" | |
395 | + :rules="classRules" | |
396 | + @change="getSections(addAssignment.classId)" | |
397 | + class="pl-2" | |
398 | + required | |
399 | + ></v-select> | |
400 | + </v-flex> | |
401 | + </v-layout> | |
402 | + <v-layout> | |
403 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
404 | + <label class="right">Section :</label> | |
405 | + </v-flex> | |
406 | + <v-flex xs8 sm8 class="ml-3"> | |
407 | + <v-select | |
408 | + :items="addSection" | |
409 | + label="Select Section" | |
410 | + item-text="name" | |
411 | + item-value="_id" | |
412 | + v-model="addAssignment.sectionId" | |
413 | + name="Select Section" | |
414 | + :rules="sectionRules" | |
415 | + @change="getClassSubject(addAssignment.classId)" | |
416 | + class="px-2" | |
417 | + required | |
418 | + ></v-select> | |
419 | + </v-flex> | |
420 | + </v-layout> | |
421 | + <v-layout> | |
422 | + <v-flex xs3 sm4 class="pt-4 subheading"> | |
423 | + <label class="right">Subject :</label> | |
424 | + </v-flex> | |
425 | + <v-flex xs8 sm8 class="ml-2"> | |
426 | + <v-select | |
427 | + :items="subjectList.subjects" | |
428 | + label="Select your subject" | |
429 | + v-model="addAssignment.subjectName" | |
430 | + item-text="subjectName" | |
431 | + item-value="_id" | |
432 | + :rules="subjectRules" | |
433 | + required | |
434 | + ></v-select> | |
435 | + </v-flex> | |
436 | + </v-layout> | |
437 | + <v-layout> | |
438 | + <v-flex xs4 class="pt-4 subheading"> | |
439 | + <label class="right">File:</label> | |
440 | + </v-flex> | |
441 | + <v-flex xs8 sm6 class="ml-3"> | |
442 | + <v-text-field | |
443 | + label="Select file" | |
444 | + @click="pickFile" | |
445 | + v-model="addAssignment.file" | |
446 | + append-icon="attach_file" | |
447 | + ></v-text-field> | |
448 | + <input | |
449 | + type="file" | |
450 | + style="display:none" | |
451 | + ref="image" | |
452 | + accept="image/*" | |
453 | + @change="onFilePicked" | |
454 | + /> | |
455 | + </v-flex> | |
456 | + </v-layout> | |
457 | + <v-layout> | |
458 | + <v-flex xs12 sm12> | |
459 | + <v-card-actions> | |
460 | + <!-- <v-btn @click="clear" round dark class="clear-button">Clear</v-btn> --> | |
461 | + <v-spacer></v-spacer> | |
462 | + <v-btn | |
463 | + @click="submit" | |
464 | + round | |
465 | + dark | |
466 | + :loading="loading" | |
467 | + class="add-button" | |
468 | + >Add Assignment</v-btn> | |
469 | + </v-card-actions> | |
470 | + </v-flex> | |
471 | + </v-layout> | |
472 | + </v-form> | |
473 | + </v-flex> | |
474 | + </v-layout> | |
475 | + </v-container> | |
476 | + </v-card> | |
477 | + </v-dialog> | |
478 | + <div class="loader" v-if="showLoader"> | |
479 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
480 | + </div> | |
481 | + </v-container> | |
482 | +</template> | |
483 | + | |
484 | +<script> | |
485 | +import http from "@/Services/http.js"; | |
486 | +import Util from "@/util"; | |
487 | +import moment from "moment"; | |
488 | + | |
489 | +export default { | |
490 | + data: () => ({ | |
491 | + snackbar: false, | |
492 | + role: "", | |
493 | + menu1: false, | |
494 | + menu2: false, | |
495 | + y: "top", | |
496 | + x: "right", | |
497 | + mode: "", | |
498 | + timeout: 3000, | |
499 | + text: "", | |
500 | + color: "", | |
501 | + show: true, | |
502 | + showSearch: false, | |
503 | + showLoader: false, | |
504 | + loading: false, | |
505 | + editLoading: false, | |
506 | + date: null, | |
507 | + search: "", | |
508 | + viewAssignmentDialog: false, | |
509 | + editAssignmentDialog: false, | |
510 | + valid: true, | |
511 | + validEditAssignment: true, | |
512 | + addAssignmentDialog: false, | |
513 | + // isActive: true, | |
514 | + // newActive: false, | |
515 | + pagination: { | |
516 | + rowsPerPage: 10 | |
517 | + }, | |
518 | + token: "", | |
519 | + headers: [ | |
520 | + { | |
521 | + text: "No", | |
522 | + align: "", | |
523 | + sortable: false, | |
524 | + value: "No" | |
525 | + }, | |
526 | + { | |
527 | + text: "Title", | |
528 | + value: "title", | |
529 | + sortable: false, | |
530 | + align: "center" | |
531 | + }, | |
532 | + { | |
533 | + text: "Description", | |
534 | + value: "description", | |
535 | + sortable: false, | |
536 | + align: "center" | |
537 | + }, | |
538 | + { | |
539 | + text: "Deadline", | |
540 | + value: "deadline", | |
541 | + sortable: false, | |
542 | + align: "center" | |
543 | + }, | |
544 | + { | |
545 | + text: "Section", | |
546 | + value: "name", | |
547 | + sortable: false, | |
548 | + align: "center" | |
549 | + }, | |
550 | + { | |
551 | + text: "Uploader", | |
552 | + value: "name", | |
553 | + sortable: false, | |
554 | + align: "center" | |
555 | + }, | |
556 | + // { | |
557 | + // text: "File", | |
558 | + // value: "file", | |
559 | + // sortable: false, | |
560 | + // align: "center" | |
561 | + // }, | |
562 | + { text: "Action", value: "", sortable: false, align: "center" } | |
563 | + ], | |
564 | + assignmentData: [], | |
565 | + subjectList: [], | |
566 | + classList: [], | |
567 | + addSection: [], | |
568 | + editedIndex: -1, | |
569 | + addSubject: {}, | |
570 | + | |
571 | + editedItem: { | |
572 | + title: "", | |
573 | + description: "", | |
574 | + deadline: "", | |
575 | + classId: "", | |
576 | + sectionId: "", | |
577 | + subjectName: "", | |
578 | + file: "" | |
579 | + }, | |
580 | + addAssignment: {}, | |
581 | + | |
582 | + imageData: {}, | |
583 | + imageName: "", | |
584 | + imageUrl: "", | |
585 | + imageFile: "", | |
586 | + | |
587 | + titleRules: [v => !!v || " Title is required"], | |
588 | + descriptionRules: [v => !!v || " Description is required"], | |
589 | + deadlineRules: [v => !!v || " Deadline is required"], | |
590 | + classRules: [v => !!v || "Class is required"], | |
591 | + sectionRules: [v => !!v || "Section is required"], | |
592 | + subjectRules: [v => !!v || "Student is required"], | |
593 | + fileRules: [v => !!v || "File is required"] | |
594 | + }), | |
595 | + methods: { | |
596 | + dates: function(date) { | |
597 | + return moment(date).format("MMMM DD, YYYY"); | |
598 | + }, | |
599 | + pickFile() { | |
600 | + this.$refs.image.click(); | |
601 | + }, | |
602 | + editItem(item) { | |
603 | + this.editedIndex = this.assignmentData; | |
604 | + this.editedItem = Object.assign({}, item); | |
605 | + this.dialog = true; | |
606 | + this.editAssignmentDialog = true; | |
607 | + }, | |
608 | + profile(item) { | |
609 | + this.editedIndex = this.assignmentData; | |
610 | + this.editedItem = Object.assign({}, item); | |
611 | + this.dialog1 = true; | |
612 | + this.viewAssignmentDialog = true; | |
613 | + }, | |
614 | + deleteItem(item) { | |
615 | + let deleteAssignment = { | |
616 | + assignmentId: item._id | |
617 | + }; | |
618 | + http() | |
619 | + .delete( | |
620 | + "/deleteAssignment", | |
621 | + confirm("Are you sure you want to delete this?") && { | |
622 | + params: deleteAssignment | |
623 | + }, | |
624 | + { | |
625 | + headers: { Authorization: "Bearer " + this.token } | |
626 | + } | |
627 | + ) | |
628 | + .then(response => { | |
629 | + this.getAssignmentList(); | |
630 | + this.snackbar = true; | |
631 | + this.text = "Successfully delete Existing Assignment"; | |
632 | + this.color = "green"; | |
633 | + }) | |
634 | + .catch(error => { | |
635 | + this.snackbar = true; | |
636 | + this.text = error.response.data.message; | |
637 | + this.color = "error"; | |
638 | + }); | |
639 | + }, | |
640 | + close() { | |
641 | + this.editAssignmentDialog = false; | |
642 | + }, | |
643 | + close1() { | |
644 | + this.viewAssignmentDialog = false; | |
645 | + }, | |
646 | + submit() { | |
647 | + var addAssignment = { | |
648 | + title: this.addAssignment.title, | |
649 | + description: this.addAssignment.description, | |
650 | + deadline: this.addAssignment.deadline, | |
651 | + classId: this.addAssignment.classId, | |
652 | + sectionId: this.addAssignment.sectionId, | |
653 | + subjectName: this.addAssignment.subjectName, | |
654 | + file: this.addAssignment.imageName | |
655 | + }; | |
656 | + if (this.$refs.form.validate()) { | |
657 | + http() | |
658 | + .post("/createAssignment", addAssignment) | |
659 | + .then(response => { | |
660 | + this.getAssignmentList(); | |
661 | + this.snackbar = true; | |
662 | + this.text = "Syllabus added successfully"; | |
663 | + this.clear(); | |
664 | + this.color = "green"; | |
665 | + this.addAssignmentDialog = false; | |
666 | + }) | |
667 | + .catch(error => { | |
668 | + // console.log(error); | |
669 | + this.snackbar = true; | |
670 | + this.text = error.response.data.message; | |
671 | + this.color = "red"; | |
672 | + }); | |
673 | + } | |
674 | + }, | |
675 | + getAssignmentList() { | |
676 | + this.showLoader = true; | |
677 | + http() | |
678 | + .get( | |
679 | + "/getAssignmentList", | |
680 | + { | |
681 | + params: { classId: this.addAssignment.classId } | |
682 | + }, | |
683 | + { | |
684 | + headers: { Authorization: "Bearer " + this.token } | |
685 | + } | |
686 | + ) | |
687 | + .then(response => { | |
688 | + this.assignmentData = response.data.data; | |
689 | + this.showLoader = false; | |
690 | + this.loadingSearch = false; | |
691 | + }) | |
692 | + .catch(error => { | |
693 | + // console.log("err====>", err);u | |
694 | + this.showLoader = false; | |
695 | + this.loadingSearch = false; | |
696 | + this.snackbar = true; | |
697 | + this.text = error.response.data.message; | |
698 | + if (error.response.status === 401) { | |
699 | + this.$router.replace({ path: "/" }); | |
700 | + this.$store.dispatch("setToken", null); | |
701 | + this.$store.dispatch("Id", null); | |
702 | + } | |
703 | + }); | |
704 | + }, | |
705 | + clear() { | |
706 | + this.$refs.form.reset(); | |
707 | + }, | |
708 | + save() { | |
709 | + if (this.$refs.formEditAssignment.validate()) { | |
710 | + let editAssignment = { | |
711 | + assignmentId: this.editedItem._id, | |
712 | + title: this.addAssignment.title, | |
713 | + description: this.addAssignment.description, | |
714 | + deadline: this.addAssignment.deadline, | |
715 | + classId: this.addAssignment.classId, | |
716 | + sectionId: this.addAssignment.sectionId, | |
717 | + subjectName: this.addAssignment.subjectName, | |
718 | + file: this.addAssignment.imageName | |
719 | + }; | |
720 | + this.editLoading = true; | |
721 | + http() | |
722 | + .put("/updateAssignment", editAssignment) | |
723 | + .then(response => { | |
724 | + this.snackbar = true; | |
725 | + this.text = "Successfully Edit Existing Assignment"; | |
726 | + this.color = "green"; | |
727 | + this.editLoading = false; | |
728 | + this.editAssignmentDialog = false; | |
729 | + http() | |
730 | + .get( | |
731 | + "/getParticularClass", | |
732 | + { params: { classId: _id } }, | |
733 | + { | |
734 | + headers: { Authorization: "Bearer " + this.token } | |
735 | + } | |
736 | + ) | |
737 | + .then(response => { | |
738 | + this.assignmentData = response.data.data; | |
739 | + this.showLoader = false; | |
740 | + this.snackbar = true; | |
741 | + this.color = "green"; | |
742 | + this.close(); | |
743 | + }) | |
744 | + .catch(err => { | |
745 | + this.showLoader = false; | |
746 | + }); | |
747 | + }) | |
748 | + .catch(error => { | |
749 | + this.editLoading = false; | |
750 | + // console.log(error); | |
751 | + }); | |
752 | + } | |
753 | + }, | |
754 | + getClass() { | |
755 | + http() | |
756 | + .get("/getClassesList", { | |
757 | + headers: { Authorization: "Bearer " + this.token } | |
758 | + }) | |
759 | + .then(response => { | |
760 | + this.classList = response.data.data; | |
761 | + }) | |
762 | + .catch(error => { | |
763 | + if (error.response.status === 401) { | |
764 | + this.$router.replace({ path: "/" }); | |
765 | + this.$store.dispatch("setToken", null); | |
766 | + this.$store.dispatch("Id", null); | |
767 | + } | |
768 | + }); | |
769 | + }, | |
770 | + getSections(_id) { | |
771 | + var token = this.$store.state.token; | |
772 | + this.showLoader = true; | |
773 | + http() | |
774 | + .get( | |
775 | + "/getSectionsList", | |
776 | + { params: { classId: _id } }, | |
777 | + { | |
778 | + headers: { Authorization: "Bearer " + token } | |
779 | + } | |
780 | + ) | |
781 | + .then(response => { | |
782 | + this.addSection = response.data.data; | |
783 | + this.showLoader = false; | |
784 | + }) | |
785 | + .catch(err => { | |
786 | + this.showLoader = false; | |
787 | + }); | |
788 | + }, | |
789 | + getClassSubject(_id) { | |
790 | + this.showLoader = true; | |
791 | + // this.classId = this.classId; | |
792 | + http() | |
793 | + .get( | |
794 | + "/getParticularClass", | |
795 | + { params: { classId: _id } }, | |
796 | + { | |
797 | + headers: { Authorization: "Bearer " + this.token } | |
798 | + } | |
799 | + ) | |
800 | + .then(response => { | |
801 | + this.subjectList = response.data.data; | |
802 | + this.showLoader = false; | |
803 | + }) | |
804 | + .catch(err => { | |
805 | + this.showLoader = false; | |
806 | + }); | |
807 | + }, | |
808 | + onFilePicked(e) { | |
809 | + // console.log(e) | |
810 | + const files = e.target.files; | |
811 | + this.upload = e.target.files[0]; | |
812 | + // console.log("imageData-upload========>", this.upload); | |
813 | + if (files[0] !== undefined) { | |
814 | + this.imageName = files[0].name; | |
815 | + if (this.imageName.lastIndexOf(".") <= 0) { | |
816 | + return; | |
817 | + } | |
818 | + const fr = new FileReader(); | |
819 | + fr.readAsDataURL(files[0]); | |
820 | + fr.addEventListener("load", () => { | |
821 | + this.imageUrl = fr.result; | |
822 | + this.imageFile = files[0]; // this is an image file that can be sent to server... | |
823 | + this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | |
824 | + // console.log("upload=======>", this.imageData.imageUrl); | |
825 | + // console.log("imageFile", this.imageUrl); | |
826 | + }); | |
827 | + } else { | |
828 | + this.imageName = ""; | |
829 | + this.imageFile = ""; | |
830 | + this.imageUrl = ""; | |
831 | + } | |
832 | + }, | |
833 | + displaySearch() { | |
834 | + (this.show = false), (this.showSearch = true); | |
835 | + }, | |
836 | + closeSearch() { | |
837 | + this.showSearch = false; | |
838 | + this.show = true; | |
839 | + this.search = ""; | |
840 | + } | |
841 | + }, | |
842 | + mounted() { | |
843 | + this.token = this.$store.state.token; | |
844 | + this.role = this.$store.state.role; | |
845 | + // this.getNoticeDataList(); | |
846 | + this.getClass(); | |
847 | + // this.getAssignmentList(); | |
848 | + } | |
849 | +}; | |
850 | +</script> | |
0 | 851 | \ No newline at end of file | ... | ... |
src/pages/Academic/routine.vue
... | ... | @@ -0,0 +1,1184 @@ |
1 | +<template> | |
2 | + <v-container fluid class="body-color"> | |
3 | + <!-- ****** EDIT Subject ****** --> | |
4 | + <v-dialog v-model="editRoutineDialog" max-width="600px"> | |
5 | + <v-card flat class="card-style pa-2" dark> | |
6 | + <v-layout> | |
7 | + <v-flex xs12> | |
8 | + <label class="title text-xs-center">Edit Subject</label> | |
9 | + <v-icon size="24" class="right" @click="editRoutineDialog = false">cancel</v-icon> | |
10 | + </v-flex> | |
11 | + </v-layout> | |
12 | + <v-container fluid> | |
13 | + <v-form ref="formEditRoutine" v-model="validEditRoutine" lazy-validation> | |
14 | + <v-layout> | |
15 | + <v-flex xs4 class="pt-4 subheading"> | |
16 | + <label class="right">Class:</label> | |
17 | + </v-flex> | |
18 | + <v-flex xs8 class="ml-3"> | |
19 | + <v-select | |
20 | + v-model="editedItem.classId" | |
21 | + label="Select your class" | |
22 | + type="text" | |
23 | + :items="classList" | |
24 | + item-text="classNum" | |
25 | + item-value="_id" | |
26 | + :rules="classRules" | |
27 | + required | |
28 | + ></v-select> | |
29 | + </v-flex> | |
30 | + </v-layout> | |
31 | + <v-layout> | |
32 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
33 | + <label class="right">Teacher Name :</label> | |
34 | + </v-flex> | |
35 | + <v-flex xs8 sm8 class="ml-3"> | |
36 | + <v-select | |
37 | + v-model="editedItem.teacherId" | |
38 | + label="Select your teacher" | |
39 | + type="text" | |
40 | + :items="teacherList" | |
41 | + item-text="name" | |
42 | + item-value="_id" | |
43 | + :rules="teacherRules" | |
44 | + required | |
45 | + ></v-select> | |
46 | + </v-flex> | |
47 | + </v-layout> | |
48 | + <v-layout> | |
49 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
50 | + <label class="right">Pass Mark :</label> | |
51 | + </v-flex> | |
52 | + <v-flex xs8 sm8 class="ml-3"> | |
53 | + <v-text-field | |
54 | + label="Fill your Pass Mark" | |
55 | + name="name" | |
56 | + type="text" | |
57 | + :rules="markRules" | |
58 | + v-model="editedItem.passMarks" | |
59 | + required | |
60 | + ></v-text-field> | |
61 | + </v-flex> | |
62 | + </v-layout> | |
63 | + <v-layout> | |
64 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
65 | + <label class="right">Final Mark :</label> | |
66 | + </v-flex> | |
67 | + <v-flex xs8 sm8 class="ml-3"> | |
68 | + <v-text-field | |
69 | + label="Fill your final mark" | |
70 | + name="name" | |
71 | + type="text" | |
72 | + :rules="finalRules" | |
73 | + v-model="editedItem.finalMarks" | |
74 | + required | |
75 | + ></v-text-field> | |
76 | + </v-flex> | |
77 | + </v-layout> | |
78 | + <v-layout> | |
79 | + <v-flex xs4 class="pt-4 subheading"> | |
80 | + <label class="right">Subject:</label> | |
81 | + </v-flex> | |
82 | + <v-flex xs8 class="ml-3"> | |
83 | + <v-text-field | |
84 | + placeholder="fill your Subject" | |
85 | + v-model="editedItem.subjectName" | |
86 | + :rules="subjectRules" | |
87 | + type="text" | |
88 | + name="email" | |
89 | + required | |
90 | + ></v-text-field> | |
91 | + </v-flex> | |
92 | + </v-layout> | |
93 | + <v-layout> | |
94 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
95 | + <label class="right">Subject Author :</label> | |
96 | + </v-flex> | |
97 | + <v-flex xs8 sm8 class="ml-3"> | |
98 | + <v-text-field | |
99 | + v-model="editedItem.subjectAuthor" | |
100 | + placeholder="fill your Subject Author" | |
101 | + name="name" | |
102 | + type="text" | |
103 | + ></v-text-field> | |
104 | + </v-flex> | |
105 | + </v-layout> | |
106 | + <v-layout> | |
107 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
108 | + <label class="right">Subject Code:</label> | |
109 | + </v-flex> | |
110 | + <v-flex xs8 sm8 class="ml-3"> | |
111 | + <v-text-field | |
112 | + v-model="editedItem.subjectCode" | |
113 | + placeholder="fill your Subject Code" | |
114 | + name="name" | |
115 | + type="text" | |
116 | + ></v-text-field> | |
117 | + </v-flex> | |
118 | + </v-layout> | |
119 | + <v-flex xs12 sm12> | |
120 | + <v-card-actions> | |
121 | + <v-spacer></v-spacer> | |
122 | + <v-btn | |
123 | + round | |
124 | + dark | |
125 | + @click="save" | |
126 | + :loading="editLoading" | |
127 | + class="add-button" | |
128 | + >Update Subject</v-btn> | |
129 | + </v-card-actions> | |
130 | + </v-flex> | |
131 | + </v-form> | |
132 | + </v-container> | |
133 | + </v-card> | |
134 | + </v-dialog> | |
135 | + | |
136 | + <!-- ****** VIEW PROFIL NOTICE BOARD ****** --> | |
137 | + | |
138 | + <!-- <v-dialog v-model="viewSubjectDialog" max-width="500px"> | |
139 | + <v-card flat class="card-style pa-3" dark> | |
140 | + <v-layout> | |
141 | + <v-flex xs12> | |
142 | + <label class="title text-xs-center">View Subject</label> | |
143 | + <v-icon size="24" class="right" @click="viewSubjectDialog = false">cancel</v-icon> | |
144 | + </v-flex> | |
145 | + </v-layout> | |
146 | + <v-card-text> | |
147 | + <v-container grid-list-md> | |
148 | + <v-layout wrap> | |
149 | + <v-flex> | |
150 | + <v-layout> | |
151 | + <v-flex xs6 sm4> | |
152 | + <h5 class="right my-1"> | |
153 | + <b>Subject Name:</b> | |
154 | + </h5> | |
155 | + </v-flex> | |
156 | + <v-flex sm8 xs6> | |
157 | + <h5 class="my-1">{{ editedItem.subjectName }}</h5> | |
158 | + </v-flex> | |
159 | + </v-layout> | |
160 | + <v-layout> | |
161 | + <v-flex xs6 sm4> | |
162 | + <h5 class="right my-1"> | |
163 | + <b>Subject Author:</b> | |
164 | + </h5> | |
165 | + </v-flex> | |
166 | + <v-flex sm8 xs6> | |
167 | + <h5 class="my-1">{{ editedItem.subjectAuthor }}</h5> | |
168 | + </v-flex> | |
169 | + </v-layout> | |
170 | + <v-layout> | |
171 | + <v-flex xs6 sm4> | |
172 | + <h5 class="right my-1"> | |
173 | + <b>Subject :</b> | |
174 | + </h5> | |
175 | + </v-flex> | |
176 | + <v-flex sm8 xs6> | |
177 | + <h5 class="my-1">{{ editedItem.subjectCode }}</h5> | |
178 | + </v-flex> | |
179 | + </v-layout> | |
180 | + <v-layout> | |
181 | + <v-flex xs6 sm4> | |
182 | + <h5 class="right my-1"> | |
183 | + <b>Pass Marks :</b> | |
184 | + </h5> | |
185 | + </v-flex> | |
186 | + <v-flex sm8 xs6> | |
187 | + <h5 class="my-1">{{ editedItem.passMarks }}</h5> | |
188 | + </v-flex> | |
189 | + </v-layout> | |
190 | + <v-layout> | |
191 | + <v-flex xs6 sm4> | |
192 | + <h5 class="right my-1"> | |
193 | + <b>Final Marks :</b> | |
194 | + </h5> | |
195 | + </v-flex> | |
196 | + <v-flex sm8 xs6> | |
197 | + <h5 class="my-1">{{ editedItem.finalMarks }}</h5> | |
198 | + </v-flex> | |
199 | + </v-layout> | |
200 | + <v-layout> | |
201 | + <v-flex xs6 sm4> | |
202 | + <h5 class="right my-1"> | |
203 | + <b>Type :</b> | |
204 | + </h5> | |
205 | + </v-flex> | |
206 | + <v-flex sm8 xs6> | |
207 | + <h5 class="my-1">{{ editedItem.type }}</h5> | |
208 | + </v-flex> | |
209 | + </v-layout> | |
210 | + </v-flex> | |
211 | + </v-layout> | |
212 | + </v-container> | |
213 | + </v-card-text> | |
214 | + </v-card> | |
215 | + </v-dialog>--> | |
216 | + | |
217 | + <!-- ****** EXISTING SUBJECTS TABLE ****** --> | |
218 | + <v-toolbar color="transparent" flat> | |
219 | + <v-btn | |
220 | + fab | |
221 | + dark | |
222 | + class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | |
223 | + small | |
224 | + @click="addRoutineDialog = true" | |
225 | + > | |
226 | + <v-icon dark>add</v-icon> | |
227 | + </v-btn> | |
228 | + <v-flex xs1 class="hidden-sm-only hidden-xs-only"> | |
229 | + <v-btn | |
230 | + round | |
231 | + class="open-dialog-button" | |
232 | + dark | |
233 | + @click="addRoutineDialog = true" | |
234 | + v-if="role != 'TEACHER' " | |
235 | + > | |
236 | + <v-icon class="white--text pr-1" size="20">add</v-icon>Add Routine | |
237 | + </v-btn> | |
238 | + </v-flex> | |
239 | + <v-spacer></v-spacer> | |
240 | + <v-flex lg2 md2 xs12 v-show="show"> | |
241 | + <v-select | |
242 | + :items="classList" | |
243 | + label="Select Your Class" | |
244 | + v-model="addRoutine.classId" | |
245 | + item-text="classNum" | |
246 | + item-value="_id" | |
247 | + name="Select Class" | |
248 | + :rules="classRules" | |
249 | + @change="getSections(addRoutine.classId)" | |
250 | + class="pl-2" | |
251 | + required | |
252 | + ></v-select> | |
253 | + </v-flex> | |
254 | + <v-flex xs8 sm3 md2 class="mr-3"> | |
255 | + <v-select | |
256 | + v-model="addRoutine.sectionId" | |
257 | + label="Select your section" | |
258 | + type="text" | |
259 | + :items="addSection" | |
260 | + item-text="name" | |
261 | + item-value="_id" | |
262 | + @change="getRoutineList()" | |
263 | + required | |
264 | + ></v-select> | |
265 | + </v-flex> | |
266 | + <v-card-title class="body-1" v-show="show"> | |
267 | + <v-btn icon flat @click="displaySearch"> | |
268 | + <v-avatar size="27"> | |
269 | + <img src="/static/icon/search.png" alt="icon" /> | |
270 | + </v-avatar> | |
271 | + </v-btn> | |
272 | + </v-card-title> | |
273 | + <v-flex xs9 sm9 md2 lg2 xl2 v-show="showSearch"> | |
274 | + <v-layout> | |
275 | + <v-text-field | |
276 | + v-model="search" | |
277 | + label="Search" | |
278 | + prepend-inner-icon="search" | |
279 | + color="primary" | |
280 | + style="transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); !important" | |
281 | + ></v-text-field> | |
282 | + <v-icon @click="closeSearch" color="error">close</v-icon> | |
283 | + </v-layout> | |
284 | + </v-flex> | |
285 | + </v-toolbar> | |
286 | + | |
287 | + <div class="col-sm-12"> | |
288 | + <!-- <h5 class="page-header"> | |
289 | + <div class="col-lg-2 col-sm-2 col-md-2 col-xs-12 pull-right drop-marg"> | |
290 | + <div class="select2-container form-control select2" id="s2id_classesID"> | |
291 | + <a | |
292 | + href="javascript:void(0)" | |
293 | + onclick="return false;" | |
294 | + class="select2-choice" | |
295 | + tabindex="-1" | |
296 | + > | |
297 | + <span class="select2-chosen">Select Class</span> | |
298 | + <abbr class="select2-search-choice-close"></abbr> | |
299 | + <span class="select2-arrow"> | |
300 | + <b></b> | |
301 | + </span> | |
302 | + </a> | |
303 | + <input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen1" /> | |
304 | + <div class="select2-drop select2-display-none select2-with-searchbox"> | |
305 | + <div class="select2-search"> | |
306 | + <input | |
307 | + type="text" | |
308 | + autocomplete="off" | |
309 | + autocorrect="off" | |
310 | + autocapitalize="off" | |
311 | + spellcheck="false" | |
312 | + class="select2-input" | |
313 | + /> | |
314 | + </div> | |
315 | + <ul class="select2-results"></ul> | |
316 | + </div> | |
317 | + </div> | |
318 | + <select | |
319 | + name="classesID" | |
320 | + id="classesID" | |
321 | + class="form-control select2 select2-offscreen" | |
322 | + tabindex="-1" | |
323 | + > | |
324 | + <option value="0" selected="selected">Select Class</option> | |
325 | + <option value="3">ONE</option> | |
326 | + </select> | |
327 | + </div> | |
328 | + </h5>--> | |
329 | + | |
330 | + <div class="nav-tabs-custom"> | |
331 | + <ul class="nav nav-tabs"> | |
332 | + <li class="active"> | |
333 | + <a data-toggle="tab" href="#all" aria-expanded="true">All Routines</a> | |
334 | + </li> | |
335 | + </ul> | |
336 | + | |
337 | + <div class="tab-content"> | |
338 | + <div id="all" class="tab-pane active mCustomScrollbar _mCS_1 mCS_no_scrollbar"> | |
339 | + <div | |
340 | + id="mCSB_1" | |
341 | + class="mCustomScrollBox mCS-light mCSB_horizontal mCSB_inside" | |
342 | + style="max-height: none;" | |
343 | + tabindex="0" | |
344 | + > | |
345 | + <div | |
346 | + id="mCSB_1_container" | |
347 | + class="mCSB_container mCS_x_hidden mCS_no_scrollbar_x" | |
348 | + style="position: relative; top: 0px; left: 0px; width: 100%;" | |
349 | + dir="ltr" | |
350 | + > | |
351 | + <div id="hide-table-2"> | |
352 | + <table id="table" class="table table-striped"> | |
353 | + <tbody> | |
354 | + <tr> | |
355 | + <td>MONDAY</td> | |
356 | + </tr> | |
357 | + <tr> | |
358 | + <td>TUESDAY</td> | |
359 | + </tr> | |
360 | + <tr> | |
361 | + <td>WEDNESDAY</td> | |
362 | + </tr> | |
363 | + <tr> | |
364 | + <td>THURSDAY</td> | |
365 | + </tr> | |
366 | + <tr> | |
367 | + <td>FRIDAY</td> | |
368 | + </tr> | |
369 | + <tr> | |
370 | + <td>SATURDAY</td> | |
371 | + </tr> | |
372 | + <tr> | |
373 | + <td style="font-weight:bold">SUNDAY</td> | |
374 | + </tr> | |
375 | + </tbody> | |
376 | + </table> | |
377 | + </div> | |
378 | + </div> | |
379 | + <div | |
380 | + id="mCSB_1_scrollbar_horizontal" | |
381 | + class="mCSB_scrollTools mCSB_1_scrollbar mCS-light mCSB_scrollTools_horizontal" | |
382 | + style="display: none;" | |
383 | + > | |
384 | + <div class="mCSB_draggerContainer"> | |
385 | + <div | |
386 | + id="mCSB_1_dragger_horizontal" | |
387 | + class="mCSB_dragger" | |
388 | + style="position: absolute; min-width: 30px; width: 0px; left: 0px;" | |
389 | + > | |
390 | + <div class="mCSB_dragger_bar"></div> | |
391 | + </div> | |
392 | + <div class="mCSB_draggerRail"></div> | |
393 | + </div> | |
394 | + </div> | |
395 | + </div> | |
396 | + </div> | |
397 | + </div> | |
398 | + </div> | |
399 | + </div> | |
400 | + | |
401 | + <!-- <v-data-table | |
402 | + :headers="headers" | |
403 | + :items="routineList" | |
404 | + :pagination.sync="pagination" | |
405 | + :search="search" | |
406 | + > | |
407 | + <template slot="items" slot-scope="props"> | |
408 | + <tr class="tr"> | |
409 | + <td class="td-row td">{{ props.index + 1 }}</td> | |
410 | + <td class="text-xs-center td td-row">{{ props.item.schoolYear }}</td> | |
411 | + <td class="text-xs-center td td-row">{{ props.item.classId }}</td> | |
412 | + <td class="text-xs-center td td-row">{{ props.item.sectionId }}</td> | |
413 | + <td class="text-xs-center td td-row">{{ props.item.day }}</td> | |
414 | + <td class="text-xs-center td td-row">{{ props.item.lectureRoutine.staringTime }}</td> | |
415 | + <td class="text-xs-center td td-row">{{ props.item.lectureRoutine.endingTime }}</td> | |
416 | + <td class="text-xs-center td td-row">{{ props.item.lectureRoutine.subjectName }}</td> | |
417 | + <td class="text-xs-center td td-row"> | |
418 | + <span> | |
419 | + <v-tooltip top> | |
420 | + <img | |
421 | + slot="activator" | |
422 | + style="cursor:pointer; width:20px; height:18px; " | |
423 | + class="mr-3" | |
424 | + @click="editItem(props.item)" | |
425 | + src="/static/icon/edit.png" | |
426 | + /> | |
427 | + <span>Edit</span> | |
428 | + </v-tooltip> | |
429 | + <v-tooltip top> | |
430 | + <img | |
431 | + slot="activator" | |
432 | + style="cursor:pointer; width:20px; height:20px; " | |
433 | + class="mr-3" | |
434 | + @click="deleteItem(props.item)" | |
435 | + src="/static/icon/delete.png" | |
436 | + /> | |
437 | + <span>Delete</span> | |
438 | + </v-tooltip> | |
439 | + </span> | |
440 | + </td> | |
441 | + </tr> | |
442 | + </template> | |
443 | + <v-alert | |
444 | + slot="no-results" | |
445 | + :value="true" | |
446 | + color="error" | |
447 | + icon="warning" | |
448 | + >Your search for "{{ search }}" found no results.</v-alert> | |
449 | + </v-data-table> --> | |
450 | + <!-- ****** ADD MULTIPLE Subject ****** --> | |
451 | + <v-snackbar | |
452 | + :timeout="timeout" | |
453 | + :top="y === 'top'" | |
454 | + :right="x === 'right'" | |
455 | + :vertical="mode === 'vertical'" | |
456 | + v-model="snackbar" | |
457 | + :color="color" | |
458 | + >{{ text }}</v-snackbar> | |
459 | + <v-dialog v-model="addRoutineDialog" max-width="600px"> | |
460 | + <v-card flat class="card-style pa-2" dark> | |
461 | + <v-layout> | |
462 | + <v-flex xs12> | |
463 | + <label class="title text-xs-center">Add Routine</label> | |
464 | + <v-icon size="24" class="right" @click="addRoutineDialog = false">cancel</v-icon> | |
465 | + </v-flex> | |
466 | + </v-layout> | |
467 | + <v-container fluid fill-height> | |
468 | + <v-layout align-center> | |
469 | + <v-flex xs12> | |
470 | + <v-form ref="form" v-model="valid" lazy-validation> | |
471 | + <v-layout> | |
472 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
473 | + <label class="right">School Year :</label> | |
474 | + </v-flex> | |
475 | + <v-flex xs8 sm8 class="ml-3"> | |
476 | + <v-text-field | |
477 | + placeholder="fill your year" | |
478 | + :rules="schoolRules" | |
479 | + v-model="addRoutine.schoolYear" | |
480 | + ></v-text-field> | |
481 | + <!-- <v-select | |
482 | + :items="classList" | |
483 | + label="Select School Year" | |
484 | + item-text="classNum" | |
485 | + item-value="_id" | |
486 | + v-model="addRoutine.classId" | |
487 | + name="Select School Year" | |
488 | + :rules="schoolRules" | |
489 | + class="pl-2" | |
490 | + required | |
491 | + ></v-select>--> | |
492 | + </v-flex> | |
493 | + </v-layout> | |
494 | + <v-layout> | |
495 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
496 | + <label class="right">Class :</label> | |
497 | + </v-flex> | |
498 | + <v-flex xs8 sm8 class="ml-3"> | |
499 | + <v-select | |
500 | + :items="classList" | |
501 | + label="Select Class" | |
502 | + item-text="classNum" | |
503 | + item-value="_id" | |
504 | + v-model="addRoutine.classId" | |
505 | + name="Select Class" | |
506 | + :rules="classRules" | |
507 | + @change="getSections(addRoutine.classId)" | |
508 | + class="pl-2" | |
509 | + required | |
510 | + ></v-select> | |
511 | + </v-flex> | |
512 | + </v-layout> | |
513 | + <v-layout> | |
514 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
515 | + <label class="right">Section :</label> | |
516 | + </v-flex> | |
517 | + <v-flex xs8 sm8 class="ml-3"> | |
518 | + <v-select | |
519 | + :items="addSection" | |
520 | + label="Select Section" | |
521 | + item-text="name" | |
522 | + item-value="_id" | |
523 | + v-model="addRoutine.sectionId" | |
524 | + name="Select Section" | |
525 | + :rules="sectionRules" | |
526 | + @change="getClassSubject(addRoutine.classId)" | |
527 | + class="px-2" | |
528 | + required | |
529 | + ></v-select> | |
530 | + </v-flex> | |
531 | + </v-layout> | |
532 | + <v-layout> | |
533 | + <v-flex xs3 sm4 class="pt-4 subheading"> | |
534 | + <label class="right">Subject :</label> | |
535 | + </v-flex> | |
536 | + <v-flex xs8 sm8 class="ml-2"> | |
537 | + <v-select | |
538 | + :items="subjectList.subjects" | |
539 | + label="Select your subject" | |
540 | + v-model="addRoutine.subjectName" | |
541 | + item-text="subjectName" | |
542 | + item-value="_id" | |
543 | + :rules="subjectRules" | |
544 | + required | |
545 | + ></v-select> | |
546 | + </v-flex> | |
547 | + </v-layout> | |
548 | + <v-layout> | |
549 | + <v-flex xs3 sm4 class="pt-4 subheading"> | |
550 | + <label class="right">Day :</label> | |
551 | + </v-flex> | |
552 | + <v-flex xs8 sm8 class="ml-2"> | |
553 | + <v-select | |
554 | + :items="day" | |
555 | + label="Select your day" | |
556 | + v-model="addRoutine.day" | |
557 | + item-text="text" | |
558 | + :rules="dayRules" | |
559 | + required | |
560 | + ></v-select> | |
561 | + </v-flex> | |
562 | + </v-layout> | |
563 | + <v-layout> | |
564 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
565 | + <label class="right">Teacher Name :</label> | |
566 | + </v-flex> | |
567 | + <v-flex xs8 sm8 class="ml-3"> | |
568 | + <v-select | |
569 | + v-model="addRoutine.teacherId" | |
570 | + label="Select your teacher" | |
571 | + type="text" | |
572 | + :items="teacherList" | |
573 | + item-text="name" | |
574 | + item-value="_id" | |
575 | + :rules="teacherRules" | |
576 | + required | |
577 | + ></v-select> | |
578 | + </v-flex> | |
579 | + </v-layout> | |
580 | + <v-layout> | |
581 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
582 | + <label class="right">Starting time:</label> | |
583 | + </v-flex> | |
584 | + <v-flex xs8 sm8 class="ml-3"> | |
585 | + <v-menu | |
586 | + ref="menuA" | |
587 | + :close-on-content-click="false" | |
588 | + v-model="menuB" | |
589 | + :nudge-right="40" | |
590 | + :return-value.sync="addRoutine.staringTime" | |
591 | + lazy | |
592 | + transition="scale-transition" | |
593 | + offset-y | |
594 | + full-width | |
595 | + max-width="290px" | |
596 | + min-width="290px" | |
597 | + > | |
598 | + <v-text-field | |
599 | + slot="activator" | |
600 | + v-model="addRoutine.staringTime" | |
601 | + label="Select your starting time" | |
602 | + append-icon="access_time" | |
603 | + :rules="timeInRules" | |
604 | + readonly | |
605 | + ></v-text-field> | |
606 | + <v-time-picker | |
607 | + v-model="addRoutine.staringTime" | |
608 | + @change="$refs.menuA.save(addRoutine.staringTime)" | |
609 | + ></v-time-picker> | |
610 | + </v-menu> | |
611 | + </v-flex> | |
612 | + </v-layout> | |
613 | + <v-layout> | |
614 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
615 | + <label class="right">Ending Time:</label> | |
616 | + </v-flex> | |
617 | + <v-flex xs8 sm8 class="ml-3"> | |
618 | + <v-menu | |
619 | + ref="menu" | |
620 | + :close-on-content-click="false" | |
621 | + v-model="menu1" | |
622 | + :nudge-right="40" | |
623 | + :return-value.sync="addRoutine.endingTime" | |
624 | + lazy | |
625 | + transition="scale-transition" | |
626 | + offset-y | |
627 | + full-width | |
628 | + max-width="290px" | |
629 | + min-width="290px" | |
630 | + > | |
631 | + <v-text-field | |
632 | + slot="activator" | |
633 | + v-model="addRoutine.endingTime" | |
634 | + label="Select your end time" | |
635 | + append-icon="access_time" | |
636 | + :rules="timeOutRules" | |
637 | + readonly | |
638 | + ></v-text-field> | |
639 | + <v-time-picker | |
640 | + v-model="addRoutine.endingTime" | |
641 | + @change="$refs.menu.save(addRoutine.endingTime)" | |
642 | + ></v-time-picker> | |
643 | + </v-menu> | |
644 | + </v-flex> | |
645 | + </v-layout> | |
646 | + <v-layout> | |
647 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
648 | + <label class="right">Room:</label> | |
649 | + </v-flex> | |
650 | + <v-flex xs8 sm8 class="ml-3"> | |
651 | + <v-text-field | |
652 | + placeholder="fill your room" | |
653 | + :rules="roomRules" | |
654 | + v-model="addRoutine.room" | |
655 | + @keyup.enter="submit" | |
656 | + ></v-text-field> | |
657 | + </v-flex> | |
658 | + </v-layout> | |
659 | + <v-layout> | |
660 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
661 | + <label class="right">Period:</label> | |
662 | + </v-flex> | |
663 | + <v-flex xs8 sm8 class="ml-3"> | |
664 | + <v-text-field | |
665 | + placeholder="fill your room" | |
666 | + :rules="periodRules" | |
667 | + v-model="addRoutine.period" | |
668 | + @keyup.enter="submit" | |
669 | + ></v-text-field> | |
670 | + </v-flex> | |
671 | + </v-layout> | |
672 | + <v-layout> | |
673 | + <v-flex xs12 sm12> | |
674 | + <v-card-actions> | |
675 | + <v-spacer></v-spacer> | |
676 | + <v-btn | |
677 | + @click="create" | |
678 | + round | |
679 | + dark | |
680 | + :loading="loading" | |
681 | + class="add-button" | |
682 | + >Add Routine</v-btn> | |
683 | + </v-card-actions> | |
684 | + </v-flex> | |
685 | + </v-layout> | |
686 | + </v-form> | |
687 | + </v-flex> | |
688 | + </v-layout> | |
689 | + </v-container> | |
690 | + </v-card> | |
691 | + </v-dialog> | |
692 | + <div class="loader" v-if="showLoader"> | |
693 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
694 | + </div> | |
695 | + </v-container> | |
696 | +</template> | |
697 | + | |
698 | +<script> | |
699 | +import http from "@/Services/http.js"; | |
700 | +import Util from "@/util"; | |
701 | + | |
702 | +export default { | |
703 | + data: () => ({ | |
704 | + snackbar: false, | |
705 | + y: "top", | |
706 | + x: "right", | |
707 | + role: "", | |
708 | + mode: "", | |
709 | + timeout: 3000, | |
710 | + text: "", | |
711 | + color: "", | |
712 | + show: true, | |
713 | + showSearch: false, | |
714 | + showLoader: false, | |
715 | + loading: false, | |
716 | + editLoading: false, | |
717 | + date: null, | |
718 | + search: "", | |
719 | + // viewSubjectDialog: false, | |
720 | + editRoutineDialog: false, | |
721 | + valid: true, | |
722 | + validEditRoutine: true, | |
723 | + addRoutineDialog: false, | |
724 | + | |
725 | + day: [ | |
726 | + "Monday", | |
727 | + "Tuesday", | |
728 | + "Wednesday", | |
729 | + "Thursday", | |
730 | + "Friday", | |
731 | + "Saturday", | |
732 | + "Sunday" | |
733 | + ], | |
734 | + pagination: { | |
735 | + rowsPerPage: 10 | |
736 | + }, | |
737 | + token: "", | |
738 | + | |
739 | + menu1: false, | |
740 | + menuB: false, | |
741 | + menu2: false, | |
742 | + | |
743 | + schoolRules: [v => !!v || "School Year is required"], | |
744 | + classRules: [v => !!v || " Class Name is required"], | |
745 | + teacherRules: [v => !!v || " Teacher Name is required"], | |
746 | + sectionRules: [v => !!v || "Section is required"], | |
747 | + studentRules: [v => !!v || " Student is required"], | |
748 | + finalRules: [v => !!v || "Final MArk is required"], | |
749 | + subjectRules: [v => !!v || " Subject Name is required"], | |
750 | + dayRules: [v => !!v || "Day is required"], | |
751 | + timeInRules: [v => !!v || "Start Time is required"], | |
752 | + timeOutRules: [v => !!v || "End Time is required"], | |
753 | + roomRules: [v => !!v || "Room is required"], | |
754 | + periodRules: [v => !!v || "Period is required"], | |
755 | + headers: [ | |
756 | + { | |
757 | + text: "No", | |
758 | + align: "", | |
759 | + sortable: false, | |
760 | + value: "No" | |
761 | + }, | |
762 | + { | |
763 | + text: "Subject Name", | |
764 | + value: "subjectName", | |
765 | + sortable: false, | |
766 | + align: "center" | |
767 | + }, | |
768 | + { | |
769 | + text: "Subject Author", | |
770 | + value: "subjectAuthor", | |
771 | + sortable: false, | |
772 | + align: "center" | |
773 | + }, | |
774 | + { | |
775 | + text: "Subject Code", | |
776 | + value: "subjectCode", | |
777 | + sortable: false, | |
778 | + align: "center" | |
779 | + }, | |
780 | + // { | |
781 | + // text: "Teacher", | |
782 | + // value: "teacherId", | |
783 | + // sortable: false, | |
784 | + // align: "center" | |
785 | + // }, | |
786 | + { | |
787 | + text: "Pass Marks", | |
788 | + value: "passMarks", | |
789 | + sortable: false, | |
790 | + align: "center" | |
791 | + }, | |
792 | + { | |
793 | + text: "Final Marks", | |
794 | + value: "finalMarks", | |
795 | + sortable: false, | |
796 | + align: "center" | |
797 | + }, | |
798 | + { | |
799 | + text: "Type", | |
800 | + value: "type", | |
801 | + sortable: false, | |
802 | + align: "center" | |
803 | + }, | |
804 | + { text: "Action", value: "", sortable: false, align: "center" } | |
805 | + ], | |
806 | + subjectList: [], | |
807 | + classList: [], | |
808 | + addSection: [], | |
809 | + subjectList: [], | |
810 | + teacherList: [], | |
811 | + titleRules: [], | |
812 | + markRules: [], | |
813 | + typeRules: [], | |
814 | + routineList: [], | |
815 | + editedIndex: -1, | |
816 | + addRoutine: {}, | |
817 | + | |
818 | + editedItem: { | |
819 | + // subjectName: "", | |
820 | + // subjectAuthor: "" | |
821 | + } | |
822 | + }), | |
823 | + methods: { | |
824 | + pickFile() { | |
825 | + this.$refs.image.click(); | |
826 | + }, | |
827 | + editItem(item) { | |
828 | + this.editedIndex = this.subjectList.subjects; | |
829 | + this.editedItem = Object.assign({}, item); | |
830 | + this.dialog = true; | |
831 | + this.editRoutineDialog = true; | |
832 | + }, | |
833 | + // profile(item) { | |
834 | + // this.editedIndex = this.subjectList.subjects; | |
835 | + // this.editedItem = Object.assign({}, item); | |
836 | + // this.dialog1 = true; | |
837 | + // this.viewSubjectDialog = true; | |
838 | + // }, | |
839 | + deleteItem(item) { | |
840 | + let deleteSubject = { | |
841 | + classId: this.addRoutine.classId, | |
842 | + subjectId: item._id | |
843 | + }; | |
844 | + http() | |
845 | + .delete( | |
846 | + "/deleteSubject", | |
847 | + confirm("Are you sure you want to delete this?") && { | |
848 | + params: deleteSubject | |
849 | + } | |
850 | + ) | |
851 | + .then(response => { | |
852 | + this.getClassSubject(_id); | |
853 | + this.snackbar = true; | |
854 | + this.text = "Successfully delete Existing Subject"; | |
855 | + this.color = "green"; | |
856 | + }) | |
857 | + .catch(error => { | |
858 | + this.snackbar = true; | |
859 | + this.text = error.response.data.message; | |
860 | + this.color = "error"; | |
861 | + }); | |
862 | + }, | |
863 | + close() { | |
864 | + this.editRoutineDialog = false; | |
865 | + }, | |
866 | + | |
867 | + create() { | |
868 | + var routineData = { | |
869 | + schoolYear: this.addRoutine.schoolYear, | |
870 | + classId: this.addRoutine.classId, | |
871 | + sectionId: this.addRoutine.sectionId, | |
872 | + day: this.addRoutine.day, | |
873 | + lectureRoutine: [] | |
874 | + }; | |
875 | + if (this.$refs.form.validate()) { | |
876 | + routineData.lectureRoutine.push({ | |
877 | + teacherId: this.addRoutine.teacherId, | |
878 | + staringTime: this.addRoutine.staringTime, | |
879 | + endingTime: this.addRoutine.endingTime, | |
880 | + room: this.addRoutine.room, | |
881 | + period: this.addRoutine.period, | |
882 | + subjectName: this.addRoutine.subjectName | |
883 | + }); | |
884 | + http() | |
885 | + .post("/createRoutine", routineData) | |
886 | + .then(response => { | |
887 | + this.text = "Routine added successfully"; | |
888 | + this.clear(); | |
889 | + this.snackbar = true; | |
890 | + this.color = "green"; | |
891 | + this.addRoutineDialog = false; | |
892 | + }) | |
893 | + .catch(error => { | |
894 | + // console.log(error); | |
895 | + this.snackbar = true; | |
896 | + this.text = error.response.data.message; | |
897 | + this.color = "error"; | |
898 | + }); | |
899 | + } | |
900 | + }, | |
901 | + clear() { | |
902 | + this.$refs.form.reset(); | |
903 | + }, | |
904 | + | |
905 | + save() { | |
906 | + if (this.$refs.formEditRoutine.validate()) { | |
907 | + let editSubject = { | |
908 | + classId: this.editedItem.classId, | |
909 | + subjectId: this.editedItem._id, | |
910 | + teacherId: this.editedItem.teacherId, | |
911 | + type: this.editedItem.type, | |
912 | + passMarks: this.editedItem.passMarks, | |
913 | + finalMarks: this.editedItem.finalMarks, | |
914 | + subjectAuthor: this.editedItem.subjectAuthor, | |
915 | + subjectCode: this.editedItem.subjectCode, | |
916 | + subjectName: this.editedItem.subjectName | |
917 | + }; | |
918 | + this.editLoading = true; | |
919 | + http() | |
920 | + .put("/updateSubject", editSubject) | |
921 | + .then(response => { | |
922 | + this.snackbar = true; | |
923 | + this.text = "Successfully Edit Existing Subject"; | |
924 | + this.color = "green"; | |
925 | + this.editLoading = false; | |
926 | + this.editRoutineDialog = false; | |
927 | + http() | |
928 | + .get( | |
929 | + "/getParticularClass", | |
930 | + { params: { classId: _id } }, | |
931 | + { | |
932 | + headers: { Authorization: "Bearer " + this.token } | |
933 | + } | |
934 | + ) | |
935 | + .then(response => { | |
936 | + this.subjectList = response.data.data; | |
937 | + this.snackbar = true; | |
938 | + this.color = "green"; | |
939 | + this.text = response.data.message; | |
940 | + this.close(); | |
941 | + }) | |
942 | + .catch(err => { | |
943 | + console.log("err====>", err); | |
944 | + }); | |
945 | + }) | |
946 | + .catch(error => { | |
947 | + this.editLoading = false; | |
948 | + | |
949 | + // console.log(error); | |
950 | + }); | |
951 | + } | |
952 | + }, | |
953 | + getClassSubject(_id) { | |
954 | + this.showLoader = true; | |
955 | + // this.classId = this.classId; | |
956 | + http() | |
957 | + .get( | |
958 | + "/getParticularClass", | |
959 | + { params: { classId: _id } }, | |
960 | + { | |
961 | + headers: { Authorization: "Bearer " + this.token } | |
962 | + } | |
963 | + ) | |
964 | + .then(response => { | |
965 | + this.subjectList = response.data.data; | |
966 | + this.showLoader = false; | |
967 | + }) | |
968 | + .catch(err => { | |
969 | + this.showLoader = false; | |
970 | + }); | |
971 | + }, | |
972 | + getClass() { | |
973 | + http() | |
974 | + .get("/getClassesList", { | |
975 | + headers: { Authorization: "Bearer " + this.token } | |
976 | + }) | |
977 | + .then(response => { | |
978 | + this.classList = response.data.data; | |
979 | + }) | |
980 | + .catch(error => { | |
981 | + if (error.response.status === 401) { | |
982 | + this.$router.replace({ path: "/" }); | |
983 | + this.$store.dispatch("setToken", null); | |
984 | + this.$store.dispatch("Id", null); | |
985 | + } | |
986 | + }); | |
987 | + }, | |
988 | + getSections(_id) { | |
989 | + var token = this.$store.state.token; | |
990 | + this.showLoader = true; | |
991 | + http() | |
992 | + .get( | |
993 | + "/getSectionsList", | |
994 | + { params: { classId: _id } }, | |
995 | + { | |
996 | + headers: { Authorization: "Bearer " + token } | |
997 | + } | |
998 | + ) | |
999 | + .then(response => { | |
1000 | + this.addSection = response.data.data; | |
1001 | + this.showLoader = false; | |
1002 | + }) | |
1003 | + .catch(err => { | |
1004 | + this.showLoader = false; | |
1005 | + }); | |
1006 | + }, | |
1007 | + getClassSubject(_id) { | |
1008 | + this.showLoader = true; | |
1009 | + // this.classId = this.classId; | |
1010 | + http() | |
1011 | + .get( | |
1012 | + "/getParticularClass", | |
1013 | + { params: { classId: _id } }, | |
1014 | + { | |
1015 | + headers: { Authorization: "Bearer " + this.token } | |
1016 | + } | |
1017 | + ) | |
1018 | + .then(response => { | |
1019 | + this.subjectList = response.data.data; | |
1020 | + this.showLoader = false; | |
1021 | + }) | |
1022 | + .catch(err => { | |
1023 | + this.showLoader = false; | |
1024 | + }); | |
1025 | + }, | |
1026 | + getTeacherList() { | |
1027 | + this.showLoader = true; | |
1028 | + var token = this.$store.state.token; | |
1029 | + http() | |
1030 | + .get("/getTeachersList", { | |
1031 | + headers: { Authorization: "Bearer " + token } | |
1032 | + }) | |
1033 | + .then(response => { | |
1034 | + this.teacherList = response.data.data; | |
1035 | + this.showLoader = false; | |
1036 | + // console.log("getTeacherList=====>",this.desserts) | |
1037 | + }) | |
1038 | + .catch(error => { | |
1039 | + this.showLoader = false; | |
1040 | + if (error.response.status === 401) { | |
1041 | + this.$router.replace({ path: "/" }); | |
1042 | + this.$store.dispatch("setToken", null); | |
1043 | + this.$store.dispatch("Id", null); | |
1044 | + } | |
1045 | + }); | |
1046 | + }, | |
1047 | + getRoutineList() { | |
1048 | + this.showLoader = true; | |
1049 | + http() | |
1050 | + .get( | |
1051 | + "/getRoutineList", | |
1052 | + { | |
1053 | + params: { | |
1054 | + classId: this.addRoutine.classId, | |
1055 | + sectionId: this.addRoutine.sectionId | |
1056 | + } | |
1057 | + }, | |
1058 | + { | |
1059 | + headers: { Authorization: "Bearer " + this.token } | |
1060 | + } | |
1061 | + ) | |
1062 | + .then(response => { | |
1063 | + this.routineList = response.data.data; | |
1064 | + this.showLoader = false; | |
1065 | + }) | |
1066 | + .catch(err => { | |
1067 | + this.showLoader = false; | |
1068 | + }); | |
1069 | + }, | |
1070 | + displaySearch() { | |
1071 | + (this.show = false), (this.showSearch = true); | |
1072 | + }, | |
1073 | + closeSearch() { | |
1074 | + this.showSearch = false; | |
1075 | + this.show = true; | |
1076 | + this.search = ""; | |
1077 | + } | |
1078 | + }, | |
1079 | + mounted() { | |
1080 | + this.token = this.$store.state.token; | |
1081 | + // this.getNoticeDataList(); | |
1082 | + this.getClass(); | |
1083 | + this.getTeacherList(); | |
1084 | + this.role = this.$store.state.role; | |
1085 | + } | |
1086 | +}; | |
1087 | +</script> | |
1088 | + | |
1089 | +<style scoped> | |
1090 | +.nav-tabs-custom { | |
1091 | + margin-bottom: 20px; | |
1092 | + background: #fff; | |
1093 | + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); | |
1094 | +} | |
1095 | +.nav-tabs-custom > .nav-tabs { | |
1096 | + background-color: #e5e5e54d; | |
1097 | + margin: 0; | |
1098 | + border-bottom-color: #e5e5e54d; | |
1099 | +} | |
1100 | +.nav-tabs { | |
1101 | + border-bottom: 1px solid #ddd; | |
1102 | +} | |
1103 | +.nav { | |
1104 | + padding-left: 0; | |
1105 | + list-style: none; | |
1106 | +} | |
1107 | +.nav-tabs-custom > .nav-tabs > li:first-of-type { | |
1108 | + margin-left: 0px; | |
1109 | +} | |
1110 | +.nav-tabs-custom > .nav-tabs > li.active { | |
1111 | + border-top-color: #09a3a3; | |
1112 | +} | |
1113 | +.nav-tabs-custom > .nav-tabs > li { | |
1114 | + border-top: 3px solid transparent; | |
1115 | + margin-bottom: -2px; | |
1116 | + margin-right: 5px; | |
1117 | +} | |
1118 | +.nav-tabs-custom > .nav-tabs > li:first-of-type.active > a { | |
1119 | + border-left-width: 0; | |
1120 | +} | |
1121 | +.nav-tabs-custom > .nav-tabs > li.active > a { | |
1122 | + border-top: 0; | |
1123 | + border-left-color: #09a3a3; | |
1124 | + border-right-color: #09a3a3; | |
1125 | +} | |
1126 | +.nav-tabs-custom > .tab-content { | |
1127 | + background: #fff; | |
1128 | +} | |
1129 | +.mCustomScrollbar.mCS_no_scrollbar, | |
1130 | +.mCustomScrollbar.mCS_touch_action { | |
1131 | + touch-action: auto; | |
1132 | +} | |
1133 | +.tab-content > .active { | |
1134 | + display: block; | |
1135 | +} | |
1136 | +.mCustomScrollBox { | |
1137 | + position: relative; | |
1138 | + overflow: hidden; | |
1139 | + height: 100%; | |
1140 | + max-width: 100%; | |
1141 | + outline: none; | |
1142 | + direction: ltr; | |
1143 | +} | |
1144 | +.mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden { | |
1145 | + margin-bottom: 0; | |
1146 | +} | |
1147 | +.mCSB_horizontal.mCSB_inside > .mCSB_container { | |
1148 | + margin-right: 0; | |
1149 | +} | |
1150 | +.mCSB_container { | |
1151 | + overflow: hidden; | |
1152 | + height: auto; | |
1153 | +} | |
1154 | +.mCSB_scrollTools.mCSB_scrollTools_horizontal { | |
1155 | + width: auto; | |
1156 | + height: 16px; | |
1157 | + top: auto; | |
1158 | + right: 0; | |
1159 | + bottom: 0; | |
1160 | + left: 0; | |
1161 | +} | |
1162 | +.box .box-body .table { | |
1163 | + margin-bottom: 0; | |
1164 | +} | |
1165 | +.table { | |
1166 | + width: 100%; | |
1167 | +} | |
1168 | +.table-striped > tbody > tr:nth-child(odd) > td, | |
1169 | +.table-striped > tbody > tr:nth-child(odd) > th { | |
1170 | + background-color: #f0f3f5; | |
1171 | +} | |
1172 | +.page-header { | |
1173 | + margin: 10px 0 20px 0; | |
1174 | + padding: 0px 0px 16px; | |
1175 | + font-size: 22px; | |
1176 | + border: none; | |
1177 | +} | |
1178 | + | |
1179 | +@media (min-width: 768px) { | |
1180 | + .col-sm-12 { | |
1181 | + width: 100%; | |
1182 | + } | |
1183 | +} | |
1184 | +</style> | |
0 | 1185 | \ No newline at end of file | ... | ... |
src/pages/Academic/subject.vue
src/pages/Academic/syllabus.vue
... | ... | @@ -0,0 +1,670 @@ |
1 | +<template> | |
2 | + <v-container fluid class="body-color"> | |
3 | + <!-- ****** EDIT Syllabus ****** --> | |
4 | + <v-dialog v-model="editSyllabusDialog" max-width="400px"> | |
5 | + <v-card flat class="card-style pa-2" dark> | |
6 | + <v-layout> | |
7 | + <v-flex xs12> | |
8 | + <label class="title text-xs-center">Edit Syllabus</label> | |
9 | + <v-icon size="24" class="right" @click="editSyllabusDialog = false">cancel</v-icon> | |
10 | + </v-flex> | |
11 | + </v-layout> | |
12 | + <v-container fluid> | |
13 | + <!-- <v-layout> | |
14 | + <v-flex | |
15 | + xs12 | |
16 | + class="text-xs-center text-sm-center text-md-center text-lg-center my-4 mr-4" | |
17 | + > | |
18 | + <v-avatar size="140px" v-if="!editedItem.fileUrl && !imageUrl"> | |
19 | + <img src="/static/icon/user.png" /> | |
20 | + </v-avatar> | |
21 | + <img | |
22 | + :src="editedItem.fileUrl" | |
23 | + v-else-if="editedItem.fileUrl && !imageUrl" | |
24 | + style="border-radius:50%; width:150px" | |
25 | + /> | |
26 | + <img | |
27 | + v-if="imageUrl" | |
28 | + :src="imageUrl" | |
29 | + height="150" | |
30 | + style="border-radius:50%; width:150px" | |
31 | + /> | |
32 | + <input | |
33 | + type="file" | |
34 | + style="display:none" | |
35 | + ref="image" | |
36 | + accept="image/*" | |
37 | + @change="onFilePicked" | |
38 | + /> | |
39 | + </v-flex> | |
40 | + </v-layout> --> | |
41 | + <v-form ref="formEditSyllabus" v-model="validEditSyllabus" lazy-validation> | |
42 | + <v-layout> | |
43 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
44 | + <label class="right">Title :</label> | |
45 | + </v-flex> | |
46 | + <v-flex xs8 sm8 class="ml-3"> | |
47 | + <v-text-field v-model="editedItem.title"></v-text-field> | |
48 | + </v-flex> | |
49 | + </v-layout> | |
50 | + <v-layout> | |
51 | + <v-flex xs4 class="pt-4 subheading"> | |
52 | + <label class="right">Description:</label> | |
53 | + </v-flex> | |
54 | + <v-flex xs8 class="ml-3"> | |
55 | + <v-text-field v-model="editedItem.description"></v-text-field> | |
56 | + </v-flex> | |
57 | + </v-layout> | |
58 | + <v-layout> | |
59 | + <v-flex xs4 class="pt-4 subheading"> | |
60 | + <label class="right">Class:</label> | |
61 | + </v-flex> | |
62 | + <v-flex xs8 class="ml-3"> | |
63 | + <v-select | |
64 | + :items="classList" | |
65 | + v-model="editedItem.classId" | |
66 | + label="Select Class" | |
67 | + item-text="classNum" | |
68 | + item-value="_id" | |
69 | + name="Select Class" | |
70 | + required | |
71 | + ></v-select> | |
72 | + </v-flex> | |
73 | + </v-layout> | |
74 | + <v-layout> | |
75 | + <v-flex xs4 class="pt-4 subheading"> | |
76 | + <label class="right">File:</label> | |
77 | + </v-flex> | |
78 | + <v-flex xs8 sm6 class="ml-3"> | |
79 | + <v-text-field | |
80 | + label="Select file" | |
81 | + @click="pickFile" | |
82 | + v-model="imageName" | |
83 | + append-icon="attach_file" | |
84 | + ></v-text-field> | |
85 | + <!-- <input | |
86 | + type="file" | |
87 | + style="display:none" | |
88 | + ref="image" | |
89 | + accept="image/*" | |
90 | + @change="onFilePicked" | |
91 | + />--> | |
92 | + </v-flex> | |
93 | + </v-layout> | |
94 | + <v-flex xs12 sm12> | |
95 | + <v-card-actions> | |
96 | + <v-spacer></v-spacer> | |
97 | + <v-btn | |
98 | + round | |
99 | + dark | |
100 | + @click="save" | |
101 | + :loading="editLoading" | |
102 | + class="add-button" | |
103 | + >Update Syllabus</v-btn> | |
104 | + </v-card-actions> | |
105 | + </v-flex> | |
106 | + </v-form> | |
107 | + </v-container> | |
108 | + </v-card> | |
109 | + </v-dialog> | |
110 | + | |
111 | + <!-- ****** VIEW PROFIL NOTICE BOARD ****** --> | |
112 | + | |
113 | + <v-dialog v-model="viewSubjectDialog" max-width="600px"> | |
114 | + <v-toolbar flat class="card-style pa-3" dark> | |
115 | + <v-spacer></v-spacer> | |
116 | + <v-toolbar-title> | |
117 | + <h3>Subject</h3> | |
118 | + </v-toolbar-title> | |
119 | + <v-spacer></v-spacer> | |
120 | + <v-icon @click="close1">close</v-icon> | |
121 | + </v-toolbar> | |
122 | + <v-card> | |
123 | + <v-card-text> | |
124 | + <v-container grid-list-md> | |
125 | + <v-layout wrap> | |
126 | + <v-flex> | |
127 | + <v-layout> | |
128 | + <v-flex xs7 sm6> | |
129 | + <h5 class="right my-1"> | |
130 | + <b>Subject Name:</b> | |
131 | + </h5> | |
132 | + </v-flex> | |
133 | + <v-flex sm6 xs5> | |
134 | + <h5 class="my-1">{{ editedItem.subjectName }}</h5> | |
135 | + </v-flex> | |
136 | + </v-layout> | |
137 | + </v-flex> | |
138 | + </v-layout> | |
139 | + </v-container> | |
140 | + </v-card-text> | |
141 | + </v-card> | |
142 | + </v-dialog> | |
143 | + | |
144 | + <!-- ****** EXISTING SYLLABUS TABLE ****** --> | |
145 | + <v-toolbar color="transparent" flat> | |
146 | + <v-btn | |
147 | + fab | |
148 | + dark | |
149 | + class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | |
150 | + small | |
151 | + @click="addSyllabusDialog = true" | |
152 | + > | |
153 | + <v-icon dark>add</v-icon> | |
154 | + </v-btn> | |
155 | + <v-flex xs1 class="hidden-sm-only hidden-xs-only"> | |
156 | + <v-btn round class="open-dialog-button" dark @click="addSyllabusDialog = true"> | |
157 | + <v-icon class="white--text pr-1" size="20">add</v-icon>Add Syllabus | |
158 | + </v-btn> | |
159 | + </v-flex> | |
160 | + <v-spacer></v-spacer> | |
161 | + <v-flex lg2 md2 xs12 v-show="show"> | |
162 | + <v-select | |
163 | + :items="classList" | |
164 | + label="Select Class" | |
165 | + v-model="addSyllabus.classId" | |
166 | + item-text="classNum" | |
167 | + item-value="_id" | |
168 | + name="Select Class" | |
169 | + :rules="classRules" | |
170 | + @change="getSyallabusList" | |
171 | + class="pl-2" | |
172 | + required | |
173 | + ></v-select> | |
174 | + </v-flex> | |
175 | + <v-card-title class="body-1" v-show="show"> | |
176 | + <v-btn icon flat @click="displaySearch"> | |
177 | + <v-avatar size="27"> | |
178 | + <img src="/static/icon/search.png" alt="icon" /> | |
179 | + </v-avatar> | |
180 | + </v-btn> | |
181 | + </v-card-title> | |
182 | + <v-flex xs9 sm9 md2 lg2 xl2 v-show="showSearch"> | |
183 | + <v-layout> | |
184 | + <v-text-field | |
185 | + v-model="search" | |
186 | + label="Search" | |
187 | + prepend-inner-icon="search" | |
188 | + color="primary" | |
189 | + style="transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); !important" | |
190 | + ></v-text-field> | |
191 | + <v-icon @click="closeSearch" color="error">close</v-icon> | |
192 | + </v-layout> | |
193 | + </v-flex> | |
194 | + </v-toolbar> | |
195 | + <v-data-table | |
196 | + :headers="headers" | |
197 | + :items="syllabusList" | |
198 | + :pagination.sync="pagination" | |
199 | + :search="search" | |
200 | + > | |
201 | + <template slot="items" slot-scope="props"> | |
202 | + <tr class="tr"> | |
203 | + <td class="td-row td">{{ props.index + 1 }}</td> | |
204 | + <td class="text-xs-center td td-row">{{ props.item.title }}</td> | |
205 | + <td class="text-xs-center td td-row">{{ props.item.description }}</td> | |
206 | + <td class="text-xs-center td td-row">{{ dates(props.item.created) }}</td> | |
207 | + <td class="text-xs-center td td-row" v-if="role != 'ADMIN' ">{{ props.item.teacherId.name }}</td> | |
208 | + <td class="text-xs-center td td-row" v-if="role != 'TEACHER' ">{{ props.item.schoolId.name }}</td> | |
209 | + <!-- <td class="text-xs-center td td-row">{{ props.item.fileType }}</td> --> | |
210 | + <td class="text-xs-center td td-row"> | |
211 | + <span> | |
212 | + <!-- <v-tooltip top> | |
213 | + <img | |
214 | + slot="activator" | |
215 | + style="cursor:pointer; width:25px; height:25px; " | |
216 | + class="mr-3" | |
217 | + @click="profile(props.item)" | |
218 | + src="/static/icon/download1.png" | |
219 | + /> | |
220 | + <span>Download</span> | |
221 | + </v-tooltip>--> | |
222 | + <v-tooltip top> | |
223 | + <img | |
224 | + slot="activator" | |
225 | + style="cursor:pointer; width:20px; height:18px; " | |
226 | + class="mr-3" | |
227 | + @click="editItem(props.item)" | |
228 | + src="/static/icon/edit.png" | |
229 | + /> | |
230 | + <span>Edit</span> | |
231 | + </v-tooltip> | |
232 | + <v-tooltip top> | |
233 | + <img | |
234 | + slot="activator" | |
235 | + style="cursor:pointer; width:20px; height:20px; " | |
236 | + class="mr-3" | |
237 | + @click="deleteItem(props.item)" | |
238 | + src="/static/icon/delete.png" | |
239 | + /> | |
240 | + <span>Delete</span> | |
241 | + </v-tooltip> | |
242 | + </span> | |
243 | + </td> | |
244 | + </tr> | |
245 | + </template> | |
246 | + <v-alert | |
247 | + slot="no-results" | |
248 | + :value="true" | |
249 | + color="error" | |
250 | + icon="warning" | |
251 | + >Your search for "{{ search }}" found no results.</v-alert> | |
252 | + </v-data-table> | |
253 | + <!-- ****** ADD SYLLABUS ****** --> | |
254 | + <v-snackbar | |
255 | + :timeout="timeout" | |
256 | + :top="y === 'top'" | |
257 | + :right="x === 'right'" | |
258 | + :vertical="mode === 'vertical'" | |
259 | + v-model="snackbar" | |
260 | + :color="color" | |
261 | + >{{ text }}</v-snackbar> | |
262 | + <v-dialog v-model="addSyllabusDialog" max-width="400px"> | |
263 | + <v-card flat class="card-style pa-2" dark> | |
264 | + <v-layout> | |
265 | + <v-flex xs12> | |
266 | + <label class="title text-xs-center">Add Syllabus</label> | |
267 | + <v-icon size="24" class="right" @click="addSyllabusDialog = false">cancel</v-icon> | |
268 | + </v-flex> | |
269 | + </v-layout> | |
270 | + <v-container fluid fill-height> | |
271 | + <!-- <v-layout> | |
272 | + <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center"> | |
273 | + <v-avatar size="80px"> | |
274 | + <img src="/static/icon/user.png" v-if="!imageUrl" /> | |
275 | + </v-avatar> | |
276 | + <img | |
277 | + :src="imageUrl" | |
278 | + height="150" | |
279 | + v-if="imageUrl" | |
280 | + style="border-radius:50%; width:150px" | |
281 | + /> | |
282 | + </v-flex> | |
283 | + </v-layout> --> | |
284 | + <v-layout align-center> | |
285 | + <v-flex xs12> | |
286 | + <v-form ref="form" v-model="valid" lazy-validation> | |
287 | + <v-layout> | |
288 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
289 | + <label class="right">Title :</label> | |
290 | + </v-flex> | |
291 | + <v-flex xs8 sm8 class="ml-3"> | |
292 | + <v-text-field | |
293 | + v-model="addSyllabus.title" | |
294 | + name="name" | |
295 | + type="text" | |
296 | + :rules="titleRules" | |
297 | + required | |
298 | + ></v-text-field> | |
299 | + </v-flex> | |
300 | + </v-layout> | |
301 | + <v-layout> | |
302 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
303 | + <label class="right">Description :</label> | |
304 | + </v-flex> | |
305 | + <v-flex xs8 sm8 class="ml-3"> | |
306 | + <v-text-field | |
307 | + v-model="addSyllabus.description" | |
308 | + name="name" | |
309 | + type="text" | |
310 | + :rules="descriptionRules" | |
311 | + required | |
312 | + ></v-text-field> | |
313 | + </v-flex> | |
314 | + </v-layout> | |
315 | + <v-layout> | |
316 | + <v-flex xs4 class="pt-4 subheading"> | |
317 | + <label class="right">Class:</label> | |
318 | + </v-flex> | |
319 | + <v-flex xs8 class="ml-3"> | |
320 | + <v-select | |
321 | + :items="classList" | |
322 | + v-model="addSyllabus.classId" | |
323 | + label="Select Class" | |
324 | + item-text="classNum" | |
325 | + item-value="_id" | |
326 | + name="Select Class" | |
327 | + required | |
328 | + ></v-select> | |
329 | + </v-flex> | |
330 | + </v-layout> | |
331 | + <v-layout> | |
332 | + <v-flex xs4 class="pt-4 subheading"> | |
333 | + <label class="right">File:</label> | |
334 | + </v-flex> | |
335 | + <v-flex xs8 sm6 class="ml-3"> | |
336 | + <v-text-field | |
337 | + label="Select file" | |
338 | + @click="pickFile" | |
339 | + v-model="imageName" | |
340 | + append-icon="attach_file" | |
341 | + ></v-text-field> | |
342 | + <input | |
343 | + type="file" | |
344 | + style="display:none" | |
345 | + ref="image" | |
346 | + accept="image/*" | |
347 | + @change="onFilePicked" | |
348 | + /> | |
349 | + </v-flex> | |
350 | + </v-layout> | |
351 | + <v-layout> | |
352 | + <v-flex xs12 sm12> | |
353 | + <v-card-actions> | |
354 | + <v-spacer></v-spacer> | |
355 | + <v-btn | |
356 | + @click="submit" | |
357 | + round | |
358 | + dark | |
359 | + :loading="loading" | |
360 | + class="add-button" | |
361 | + >Add Syllabus</v-btn> | |
362 | + </v-card-actions> | |
363 | + </v-flex> | |
364 | + </v-layout> | |
365 | + </v-form> | |
366 | + </v-flex> | |
367 | + </v-layout> | |
368 | + </v-container> | |
369 | + </v-card> | |
370 | + </v-dialog> | |
371 | + <div class="loader" v-if="showLoader"> | |
372 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
373 | + </div> | |
374 | + </v-container> | |
375 | +</template> | |
376 | + | |
377 | +<script> | |
378 | +import http from "@/Services/http.js"; | |
379 | +import Util from "@/util"; | |
380 | +import moment from "moment"; | |
381 | + | |
382 | +export default { | |
383 | + data: () => ({ | |
384 | + snackbar: false, | |
385 | + y: "top", | |
386 | + x: "right", | |
387 | + mode: "", | |
388 | + timeout: 3000, | |
389 | + text: "", | |
390 | + color: "", | |
391 | + show: true, | |
392 | + showSearch: false, | |
393 | + showLoader: false, | |
394 | + loading: false, | |
395 | + editLoading: false, | |
396 | + date: null, | |
397 | + search: "", | |
398 | + viewSubjectDialog: false, | |
399 | + editSyllabusDialog: false, | |
400 | + valid: true, | |
401 | + validEditSyllabus: true, | |
402 | + addSyllabusDialog: false, | |
403 | + // isActive: true, | |
404 | + // newActive: false, | |
405 | + pagination: { | |
406 | + rowsPerPage: 10 | |
407 | + }, | |
408 | + token: "", | |
409 | + upload: "", | |
410 | + titleRules: [v => !!v || " Title is required"], | |
411 | + descriptionRules: [v => !!v || " Description is required"], | |
412 | + classRules: [v => !!v || " Class Name is required"], | |
413 | + fileRules: [v => !!v || " File is required"], | |
414 | + headers: [ | |
415 | + { | |
416 | + text: "No", | |
417 | + align: "", | |
418 | + sortable: false, | |
419 | + value: "No" | |
420 | + }, | |
421 | + { | |
422 | + text: "Title", | |
423 | + value: "title", | |
424 | + sortable: false, | |
425 | + align: "center" | |
426 | + }, | |
427 | + { | |
428 | + text: "Description", | |
429 | + value: "description", | |
430 | + sortable: false, | |
431 | + align: "center" | |
432 | + }, | |
433 | + { | |
434 | + text: "Date", | |
435 | + value: "created", | |
436 | + sortable: false, | |
437 | + align: "center" | |
438 | + }, | |
439 | + { | |
440 | + text: "Uploader", | |
441 | + value: "upload", | |
442 | + sortable: false, | |
443 | + align: "center" | |
444 | + }, | |
445 | + // { | |
446 | + // text: "File", | |
447 | + // value: "fileType", | |
448 | + // sortable: false, | |
449 | + // align: "center" | |
450 | + // }, | |
451 | + { text: "Action", value: "", sortable: false, align: "center" } | |
452 | + ], | |
453 | + syllabusList: [], | |
454 | + classList: [], | |
455 | + editedIndex: -1, | |
456 | + addSyllabus: {}, | |
457 | + // selectClassId: "", | |
458 | + editedItem: { | |
459 | + subjectName: "" | |
460 | + }, | |
461 | + imageData: {}, | |
462 | + imageName: "", | |
463 | + imageUrl: "", | |
464 | + imageFile: "" | |
465 | + }), | |
466 | + methods: { | |
467 | + pickFile() { | |
468 | + this.$refs.image.click(); | |
469 | + }, | |
470 | + dates: function(date) { | |
471 | + return moment(date).format("MMMM DD, YYYY"); | |
472 | + }, | |
473 | + editItem(item) { | |
474 | + this.editedIndex = this.syllabusList; | |
475 | + this.editedItem = Object.assign({}, item); | |
476 | + this.dialog = true; | |
477 | + this.editSyllabusDialog = true; | |
478 | + }, | |
479 | + profile(item) { | |
480 | + this.editedIndex = this.syllabusList; | |
481 | + this.editedItem = Object.assign({}, item); | |
482 | + this.dialog1 = true; | |
483 | + this.viewSubjectDialog = true; | |
484 | + }, | |
485 | + deleteItem(item) { | |
486 | + let deleteSyallabus = { | |
487 | + syallabusId: item._id | |
488 | + }; | |
489 | + http() | |
490 | + .delete( | |
491 | + "/deleteSyallabus", | |
492 | + confirm("Are you sure you want to delete this?") && { | |
493 | + params: deleteSyallabus | |
494 | + } | |
495 | + ) | |
496 | + .then(response => { | |
497 | + this.getSyallabusList(); | |
498 | + this.snackbar = true; | |
499 | + this.color = "green"; | |
500 | + this.text = "Successfully delete Existing Syllabus"; | |
501 | + }) | |
502 | + .catch(error => { | |
503 | + this.snackbar = true; | |
504 | + this.text = error.response.data.message; | |
505 | + this.color = "error"; | |
506 | + }); | |
507 | + }, | |
508 | + close() { | |
509 | + this.editSyllabusDialog = false; | |
510 | + }, | |
511 | + close1() { | |
512 | + this.viewSubjectDialog = false; | |
513 | + }, | |
514 | + submit() { | |
515 | + // var addSyllabus = { | |
516 | + // classId: this.addSyllabus.classId, | |
517 | + // title: this.addSyllabus.title, | |
518 | + // description: this.addSyllabus.description, | |
519 | + // upload: this.addSyllabus.upload, | |
520 | + // fileType: this.addSyllabus.fileType | |
521 | + // }; | |
522 | + if (this.$refs.form.validate()) { | |
523 | + if (this.imageUrl) { | |
524 | + var str = this.imageUrl; | |
525 | + const [baseUrl, imageUrl] = str.split(/,/); | |
526 | + this.addSyllabus.upload = imageUrl; | |
527 | + } | |
528 | + http() | |
529 | + .post("/createSyallabus", this.addSyllabus) | |
530 | + .then(response => { | |
531 | + this.getSyallabusList(); | |
532 | + this.snackbar = true; | |
533 | + this.text = "Syllabus added successfully"; | |
534 | + this.clear(); | |
535 | + this.color = "green"; | |
536 | + this.addSyllabusDialog = false; | |
537 | + }) | |
538 | + .catch(error => { | |
539 | + // console.log(error); | |
540 | + this.snackbar = true; | |
541 | + this.text = error.response.data.message; | |
542 | + this.color = "error"; | |
543 | + }); | |
544 | + } | |
545 | + }, | |
546 | + onFilePicked(e) { | |
547 | + // console.log(e) | |
548 | + const files = e.target.files; | |
549 | + this.upload = e.target.files[0]; | |
550 | + console.log("imageData-upload========>", this.upload); | |
551 | + if (files[0] !== undefined) { | |
552 | + this.imageName = files[0].name; | |
553 | + if (this.imageName.lastIndexOf(".") <= 0) { | |
554 | + return; | |
555 | + } | |
556 | + const fr = new FileReader(); | |
557 | + fr.readAsDataURL(files[0]); | |
558 | + fr.addEventListener("load", () => { | |
559 | + this.imageUrl = fr.result; | |
560 | + this.imageFile = files[0]; // this is an image file that can be sent to server... | |
561 | + this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | |
562 | + // console.log("upload=======>", this.imageData.imageUrl); | |
563 | + // console.log("imageFile", this.imageUrl); | |
564 | + }); | |
565 | + } else { | |
566 | + this.imageName = ""; | |
567 | + this.imageFile = ""; | |
568 | + this.imageUrl = ""; | |
569 | + } | |
570 | + }, | |
571 | + clear() { | |
572 | + this.$refs.form.reset(); | |
573 | + }, | |
574 | + save() { | |
575 | + if (this.$refs.formEditSyllabus.validate()) { | |
576 | + let syllabusData = { | |
577 | + syallabusId: this.editedItem._id, | |
578 | + sectionId: this.editedItem.sectionId, | |
579 | + classId: this.editedItem.classId, | |
580 | + title: this.editedItem.title, | |
581 | + description: this.editedItem.description, | |
582 | + upload: this.editedItem.upload, | |
583 | + fileType: this.editedItem.fileType | |
584 | + }; | |
585 | + this.editLoading = true; | |
586 | + http() | |
587 | + .put("/updateSyallabus", syllabusData) | |
588 | + .then(response => { | |
589 | + this.snackbar = true; | |
590 | + this.text = "Successfully Edit Existing Syllabus"; | |
591 | + this.color = "green"; | |
592 | + this.editLoading = false; | |
593 | + this.editSyllabusDialog = false; | |
594 | + http() | |
595 | + .get( | |
596 | + "/getSyallabusList", | |
597 | + { params: { classId: this.addSyllabus.classId } }, | |
598 | + { | |
599 | + headers: { Authorization: "Bearer " + this.token } | |
600 | + } | |
601 | + ) | |
602 | + .then(response => { | |
603 | + this.syllabusList = response.data.data; | |
604 | + this.getSyallabusList(); | |
605 | + this.snackbar = true; | |
606 | + this.color = "green"; | |
607 | + this.close(); | |
608 | + }) | |
609 | + .catch(err => { | |
610 | + console.log("err====>", err); | |
611 | + this.text = error.response.data.message; | |
612 | + this.color = "error"; | |
613 | + }); | |
614 | + }) | |
615 | + .catch(error => { | |
616 | + this.editLoading = false; | |
617 | + }); | |
618 | + } | |
619 | + }, | |
620 | + getSyallabusList() { | |
621 | + this.showLoader = true; | |
622 | + http() | |
623 | + .get( | |
624 | + "/getSyallabusList", | |
625 | + { params: { classId: this.addSyllabus.classId } }, | |
626 | + { | |
627 | + headers: { Authorization: "Bearer " + this.token } | |
628 | + } | |
629 | + ) | |
630 | + .then(response => { | |
631 | + this.syllabusList = response.data.data; | |
632 | + this.showLoader = false; | |
633 | + }) | |
634 | + .catch(err => { | |
635 | + this.showLoader = false; | |
636 | + }); | |
637 | + }, | |
638 | + getClass() { | |
639 | + http() | |
640 | + .get("/getClassesList", { | |
641 | + headers: { Authorization: "Bearer " + this.token } | |
642 | + }) | |
643 | + .then(response => { | |
644 | + this.classList = response.data.data; | |
645 | + }) | |
646 | + .catch(error => { | |
647 | + if (error.response.status === 401) { | |
648 | + this.$router.replace({ path: "/" }); | |
649 | + this.$store.dispatch("setToken", null); | |
650 | + this.$store.dispatch("Id", null); | |
651 | + } | |
652 | + }); | |
653 | + }, | |
654 | + displaySearch() { | |
655 | + (this.show = false), (this.showSearch = true); | |
656 | + }, | |
657 | + closeSearch() { | |
658 | + this.showSearch = false; | |
659 | + this.show = true; | |
660 | + this.search = ""; | |
661 | + } | |
662 | + }, | |
663 | + mounted() { | |
664 | + this.token = this.$store.state.token; | |
665 | + this.role = this.$store.state.role; | |
666 | + this.getClass(); | |
667 | + // this.getSyallabusList(); | |
668 | + } | |
669 | +}; | |
670 | +</script> | |
0 | 671 | \ No newline at end of file | ... | ... |
src/pages/Attendence/studentAttendence.vue
... | ... | @@ -13,17 +13,50 @@ |
13 | 13 | <v-btn>Download Data</v-btn> |
14 | 14 | </download-csv>--> |
15 | 15 | <v-toolbar color="transparent" flat> |
16 | + <v-btn | |
17 | + fab | |
18 | + dark | |
19 | + class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | |
20 | + small | |
21 | + @click="addStudentAttendenceDialog = true" | |
22 | + > | |
23 | + <v-icon dark>add</v-icon> | |
24 | + </v-btn> | |
25 | + <v-btn | |
26 | + v-if="role != 'ADMIN' && schoolRole != 'SCHOOLADMIN' " | |
27 | + round | |
28 | + class="open-dialog-button hidden-sm-only hidden-xs-only" | |
29 | + dark | |
30 | + @click="addStudentAttendenceDialog = true" | |
31 | + > | |
32 | + <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student Attendence | |
33 | + </v-btn> | |
34 | + | |
16 | 35 | <v-spacer></v-spacer> |
17 | 36 | <v-flex xs12 sm4 md2> |
18 | 37 | <v-select |
19 | 38 | small |
20 | 39 | :items="addclass" |
21 | 40 | label="Select Class" |
22 | - v-model="selectStudents.select" | |
41 | + v-model="getReport.classId" | |
23 | 42 | item-text="classNum" |
24 | 43 | item-value="_id" |
25 | 44 | name="Select Class" |
26 | - @change="getSections(selectStudents.select)" | |
45 | + @change="getSection(getReport.classId)" | |
46 | + class="px-2" | |
47 | + required | |
48 | + ></v-select> | |
49 | + </v-flex> | |
50 | + <v-flex xs12 sm4 md2> | |
51 | + <v-select | |
52 | + small | |
53 | + :items="addSection" | |
54 | + label="Select Section" | |
55 | + v-model="getReport.sectionId" | |
56 | + item-text="name" | |
57 | + item-value="_id" | |
58 | + name="Select Section" | |
59 | + @change="getStudents(getReport.sectionId)" | |
27 | 60 | class="px-2" |
28 | 61 | required |
29 | 62 | ></v-select> |
... | ... | @@ -44,7 +77,7 @@ |
44 | 77 | </v-toolbar> |
45 | 78 | <v-data-table |
46 | 79 | :headers="headers" |
47 | - :items="studentsList" | |
80 | + :items="studentsData" | |
48 | 81 | :pagination.sync="pagination" |
49 | 82 | :search="search" |
50 | 83 | > |
... | ... | @@ -58,7 +91,7 @@ |
58 | 91 | </v-avatar> |
59 | 92 | </td> |
60 | 93 | <td class="text-xs-center td td-row">{{ props.item.name}}</td> |
61 | - <td class="text-xs-center td td-row">{{ props.item.rollNo}}</td> | |
94 | + <td class="text-xs-center td td-row">{{ props.item.fatherCellNo}}</td> | |
62 | 95 | <td class="text-xs-center td td-row">{{ props.item.email }}</td> |
63 | 96 | <td class="text-xs-center td td-row"> |
64 | 97 | <router-link :to="{ name:'View Students Attendence',params: { id:props.item._id } }"> |
... | ... | @@ -72,16 +105,6 @@ |
72 | 105 | <span>View</span> |
73 | 106 | </v-tooltip> |
74 | 107 | </router-link> |
75 | - <v-tooltip top> | |
76 | - <img | |
77 | - slot="activator" | |
78 | - style="cursor:pointer; width:20px; height:20px; " | |
79 | - @click="deleteItem(props.item)" | |
80 | - class="mr-3" | |
81 | - src="/static/icon/delete.png" | |
82 | - /> | |
83 | - <span>Delete</span> | |
84 | - </v-tooltip> | |
85 | 108 | </td> |
86 | 109 | </tr> |
87 | 110 | </template> |
... | ... | @@ -92,6 +115,143 @@ |
92 | 115 | icon="warning" |
93 | 116 | >Your search for "{{ search }}" found no results.</v-alert> |
94 | 117 | </v-data-table> |
118 | + <!-- ****** Add Students Attendece****** --> | |
119 | + <v-dialog v-model="addStudentAttendenceDialog" width="1600"> | |
120 | + <v-card flat class="pa-2"> | |
121 | + <v-layout> | |
122 | + <v-flex xs12> | |
123 | + <label class="title text-xs-center">Add Student Attendence</label> | |
124 | + <v-icon size="24" class="right" @click="addStudentAttendenceDialog = false">cancel</v-icon> | |
125 | + </v-flex> | |
126 | + </v-layout> | |
127 | + <v-flex xs12 class="mt-4"> | |
128 | + <v-form ref="form" v-model="valid" lazy-validation> | |
129 | + <v-flex xs12 sm12 lg12> | |
130 | + <v-layout wrap> | |
131 | + <v-flex xs6 sm6 lg3 md4> | |
132 | + <v-layout> | |
133 | + <v-flex xs3 sm6 lg2 class="subheading mt-4"> | |
134 | + <label class="right">Class:</label> | |
135 | + </v-flex> | |
136 | + <v-flex xs9 sm6 lg8 class="ml-2"> | |
137 | + <v-select | |
138 | + v-model="getReport.classId" | |
139 | + label="Select your class" | |
140 | + type="text" | |
141 | + :items="addclass" | |
142 | + item-text="classNum" | |
143 | + item-value="_id" | |
144 | + :rules="classRules" | |
145 | + @change="getSection(getReport.classId)" | |
146 | + required | |
147 | + ></v-select> | |
148 | + </v-flex> | |
149 | + </v-layout> | |
150 | + </v-flex> | |
151 | + <v-flex xs6 sm6 lg3 md8> | |
152 | + <v-layout> | |
153 | + <v-flex xs3 sm6 lg2 class="subheading mt-4"> | |
154 | + <label class="right">Section:</label> | |
155 | + </v-flex> | |
156 | + <v-flex xs9 sm6 lg8 class="ml-2"> | |
157 | + <v-select | |
158 | + :items="addSection" | |
159 | + label="Select your Section" | |
160 | + v-model="getReport.sectionId" | |
161 | + item-text="name" | |
162 | + item-value="_id" | |
163 | + name="Select Section" | |
164 | + :rules="sectionRules" | |
165 | + required | |
166 | + ></v-select> | |
167 | + </v-flex> | |
168 | + </v-layout> | |
169 | + </v-flex> | |
170 | + <v-flex xs6 sm6 lg3 md4> | |
171 | + <v-menu | |
172 | + ref="menu" | |
173 | + :close-on-content-click="false" | |
174 | + v-model="menu" | |
175 | + :nudge-right="40" | |
176 | + lazy | |
177 | + transition="scale-transition" | |
178 | + offset-y | |
179 | + full-width | |
180 | + min-width="290px" | |
181 | + > | |
182 | + <v-text-field | |
183 | + slot="activator" | |
184 | + v-model="date" | |
185 | + label="Select Date" | |
186 | + append-icon="event" | |
187 | + :rules="dataValid" | |
188 | + readonly | |
189 | + ></v-text-field> | |
190 | + <v-date-picker | |
191 | + ref="picker" | |
192 | + v-model="date" | |
193 | + :max="new Date().toISOString().substr(0, 10)" | |
194 | + min="1950-01-01" | |
195 | + @change="save" | |
196 | + ></v-date-picker> | |
197 | + </v-menu> | |
198 | + </v-flex> | |
199 | + <v-flex xs6 sm6 lg9 md8> | |
200 | + <v-btn round dark class="add-button" @click="showTable">Attendence</v-btn> | |
201 | + </v-flex> | |
202 | + </v-layout> | |
203 | + </v-flex> | |
204 | + </v-form> | |
205 | + </v-flex> | |
206 | + <v-flex xs12 v-show="attendeceTable" class> | |
207 | + <v-data-table | |
208 | + :headers="headers" | |
209 | + :items="studentsData" | |
210 | + :pagination.sync="pagination" | |
211 | + :search="search" | |
212 | + > | |
213 | + <template slot="items" slot-scope="props"> | |
214 | + <tr class="tr"> | |
215 | + <td class="td td-row">{{ props.index + 1}}</td> | |
216 | + <td class="text-xs-center td td-row"> | |
217 | + <v-avatar size="40"> | |
218 | + <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | |
219 | + <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | |
220 | + </v-avatar> | |
221 | + </td> | |
222 | + <td class="text-xs-center td td-row">{{ props.item.name}}</td> | |
223 | + <td class="text-xs-center td td-row">{{ props.item.fatherCellNo }}</td> | |
224 | + <td class="text-xs-center td td-row">{{ props.item.email }}</td> | |
225 | + <td class="text-xs-center td td-row"> | |
226 | + <v-radio-group v-model="props.item.attendence" :mandatory="false" row> | |
227 | + <v-radio | |
228 | + v-for="attendences in attendenceType" | |
229 | + :key="attendences.value" | |
230 | + :label="`${attendences.label}`" | |
231 | + :value="attendences.value" | |
232 | + ></v-radio> | |
233 | + </v-radio-group> | |
234 | + </td> | |
235 | + </tr> | |
236 | + </template> | |
237 | + </v-data-table> | |
238 | + <v-flex xs12> | |
239 | + <v-card-actions> | |
240 | + <v-spacer></v-spacer> | |
241 | + <v-btn @click="update()" class="add-button" round dark>Submit</v-btn> | |
242 | + </v-card-actions> | |
243 | + </v-flex> | |
244 | + </v-flex> | |
245 | + </v-card> | |
246 | + </v-dialog> | |
247 | + <v-snackbar | |
248 | + :timeout="timeout" | |
249 | + :top="y === 'top'" | |
250 | + :right="x === 'right'" | |
251 | + :vertical="mode === 'vertical'" | |
252 | + v-model="snackbar" | |
253 | + color="success" | |
254 | + >{{ text }}</v-snackbar> | |
95 | 255 | <div class="loader" v-if="showLoader"> |
96 | 256 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
97 | 257 | </div> |
... | ... | @@ -138,57 +298,143 @@ export default { |
138 | 298 | align: "center" |
139 | 299 | }, |
140 | 300 | { text: "Name", value: "name", sortable: false, align: "center" }, |
141 | - { text: "Roll No", value: "rollNo", sortable: false, align: "center" }, | |
301 | + { | |
302 | + text: "Mobile No", | |
303 | + value: "fatherCellNo", | |
304 | + sortable: false, | |
305 | + align: "center" | |
306 | + }, | |
142 | 307 | { text: "Email", value: "email", sortable: false, align: "center" }, |
143 | - { text: "Action", value: "", sortable: false, align: "center" } | |
308 | + { text: "Attendance", value: "", sortable: false, align: "center" } | |
144 | 309 | ], |
145 | 310 | // json_data: [], |
146 | - studentsList: [], | |
147 | 311 | parentId: "", |
148 | 312 | token: "", |
149 | 313 | selectStudents: { |
150 | 314 | select: "", |
151 | 315 | selectSection: "" |
152 | - } | |
316 | + }, | |
317 | + | |
318 | + role: "", | |
319 | + schoolRole: "", | |
320 | + addStudentAttendenceDialog: false, | |
321 | + attendeceTable: false, | |
322 | + menu: false, | |
323 | + valid: true, | |
324 | + | |
325 | + getReport: {}, | |
326 | + studentsList: [], | |
327 | + studentsData: [], | |
328 | + addSection: [], | |
329 | + | |
330 | + SectionName: ["A", "B", "C", "D", "E", "F"], | |
331 | + classRules: [v => !!v || "Class is required"], | |
332 | + sectionRules: [v => !!v || "Class is required"], | |
333 | + studentRules: [v => !!v || "Student is required"], | |
334 | + dataValid: [v => !!v || "Date is required"], | |
335 | + | |
336 | + attendenceType: [ | |
337 | + { | |
338 | + label: "Present", | |
339 | + value: true | |
340 | + }, | |
341 | + { | |
342 | + label: "Absent", | |
343 | + value: false | |
344 | + } | |
345 | + ] | |
153 | 346 | }), |
154 | 347 | methods: { |
155 | - getSections(_id) { | |
348 | + save(date) { | |
349 | + this.$refs.menu.save(date); | |
350 | + }, | |
351 | + showTable() { | |
352 | + this.attendeceTable = true; | |
353 | + this.getStudents(); | |
354 | + }, | |
355 | + getAllClass() { | |
356 | + http() | |
357 | + .get("/getClassesList", { | |
358 | + headers: { Authorization: "Bearer " + this.token } | |
359 | + }) | |
360 | + .then(response => { | |
361 | + this.addclass = response.data.data; | |
362 | + }) | |
363 | + .catch(error => { | |
364 | + // console.log("err====>", err); | |
365 | + // this.$router.replace({ path: "/" }); | |
366 | + }); | |
367 | + }, | |
368 | + getSection(_id) { | |
156 | 369 | this.showLoader = true; |
157 | - var token = this.$store.state.token; | |
158 | 370 | http() |
159 | 371 | .get( |
160 | - "/getStudentsList", | |
372 | + "/getSectionsList", | |
161 | 373 | { params: { classId: _id } }, |
162 | 374 | { |
163 | - headers: { Authorization: "Bearer " + token } | |
375 | + headers: { Authorization: "Bearer " + this.token } | |
164 | 376 | } |
165 | 377 | ) |
166 | 378 | .then(response => { |
379 | + this.addSection = response.data.data; | |
167 | 380 | this.showLoader = false; |
168 | - this.studentsList = response.data.data; | |
169 | 381 | }) |
170 | - .catch(error => { | |
382 | + .catch(err => { | |
171 | 383 | this.showLoader = false; |
172 | - if (error.response.status === 401) { | |
173 | - this.$router.replace({ path: "/" }); | |
174 | - this.$store.dispatch("setToken", null); | |
175 | - this.$store.dispatch("Id", null); | |
176 | - } | |
384 | + // console.log("err====>", err); | |
177 | 385 | }); |
178 | 386 | }, |
179 | - getAllClass() { | |
387 | + getStudents(_id) { | |
388 | + this.showLoader = true; | |
180 | 389 | http() |
181 | - .get("/getClassesList", { | |
182 | - headers: { Authorization: "Bearer " + this.token } | |
390 | + .get("/getStudentWithClass", { | |
391 | + params: { | |
392 | + classId: this.getReport.classId, | |
393 | + sectionId: this.getReport.sectionId | |
394 | + } | |
183 | 395 | }) |
184 | 396 | .then(response => { |
185 | - this.addclass = response.data.data; | |
397 | + this.studentsData = response.data.data; | |
398 | + this.showLoader = false; | |
399 | + // this.addStudentAttendenceDialog = false; | |
400 | + var attendence = ""; | |
401 | + for (let i = 0; i < this.studentsData.length; i++) { | |
402 | + this.studentsData[i].attendence = true; | |
403 | + } | |
186 | 404 | }) |
187 | 405 | .catch(error => { |
188 | - // console.log("err====>", err); | |
189 | - // this.$router.replace({ path: "/" }); | |
406 | + console.log("err====>", error); | |
407 | + this.showLoader = false; | |
408 | + }); | |
409 | + }, | |
410 | + update() { | |
411 | + var studentsAttendence = []; | |
412 | + for (var j = 0; j < this.studentsData.length; j++) { | |
413 | + studentsAttendence.push({ | |
414 | + studentId: this.studentsData[j]._id, | |
415 | + isPresent: this.studentsData[j].attendence | |
190 | 416 | }); |
417 | + } | |
418 | + if (this.$refs.form.validate()) { | |
419 | + let attendanceData = { | |
420 | + sectionId: this.getReport.sectionId, | |
421 | + date: this.date, | |
422 | + students: studentsAttendence | |
423 | + }; | |
424 | + http() | |
425 | + .put("/updateAttendance", attendanceData) | |
426 | + .then(response => { | |
427 | + this.snackbar = true; | |
428 | + this.text = response.data.message; | |
429 | + this.addStudentAttendenceDialog = false; | |
430 | + }) | |
431 | + .catch(error => { | |
432 | + this.snackbar = true; | |
433 | + this.text = error.response.data.message; | |
434 | + }); | |
435 | + } | |
191 | 436 | }, |
437 | + | |
192 | 438 | displaySearch() { |
193 | 439 | (this.show = false), (this.showSearch = true); |
194 | 440 | }, |
... | ... | @@ -202,6 +448,7 @@ export default { |
202 | 448 | // this.getStudentList(); |
203 | 449 | this.token = this.$store.state.token; |
204 | 450 | this.getAllClass(); |
451 | + this.role = this.$store.state.role; | |
205 | 452 | } |
206 | 453 | }; |
207 | 454 | </script> |
208 | 455 | \ No newline at end of file | ... | ... |
src/pages/Attendence/teacherAttendence.vue
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | <v-icon dark>add</v-icon> |
13 | 13 | </v-btn> |
14 | 14 | <v-btn |
15 | + v-if="role != 'TEACHER' " | |
15 | 16 | round |
16 | 17 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
17 | 18 | dark |
... | ... | @@ -144,9 +145,9 @@ |
144 | 145 | <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> |
145 | 146 | </v-avatar> |
146 | 147 | </td> |
147 | - <td class="text-xs-center td td-row">{{ props.item.name}}</td> | |
148 | - <td class="text-xs-center td td-row">{{ props.item.email }}</td> | |
149 | - <td class="text-xs-center td td-row">{{ props.item.mobileNo }}</td> | |
148 | + <td class="text-xs-center td td-row">{{ props.item.studentId.name}}</td> | |
149 | + <td class="text-xs-center td td-row">{{ props.item.studentId.email }}</td> | |
150 | + <td class="text-xs-center td td-row">{{ props.item.studentId.mobileNo }}</td> | |
150 | 151 | <td class="text-xs-center td td-row"> |
151 | 152 | <v-radio-group v-model="props.item.attendence" :mandatory="false" row> |
152 | 153 | <v-radio |
... | ... | @@ -192,6 +193,7 @@ export default { |
192 | 193 | snackbar: false, |
193 | 194 | y: "top", |
194 | 195 | x: "right", |
196 | + role: "", | |
195 | 197 | mode: "", |
196 | 198 | timeout: 5000, |
197 | 199 | text: "", |
... | ... | @@ -337,6 +339,7 @@ export default { |
337 | 339 | }, |
338 | 340 | mounted() { |
339 | 341 | this.getTeacherList(); |
342 | + this.role = this.$store.state.role; | |
340 | 343 | } |
341 | 344 | }; |
342 | 345 | </script> |
343 | 346 | \ No newline at end of file | ... | ... |
src/pages/Authentication/Login.vue
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | <v-flex xs12 sm10 md6 lg4> |
15 | 15 | <v-toolbar dense flat class="transparent mb-4"> |
16 | 16 | <v-toolbar-items class="mx-auto"> |
17 | - <img src="/static/icon.png" height="40" width="140" alt="logo" class="logo"/> | |
17 | + <img src="/static/icon.png" height="40" width="140" alt="logo" class="logo" /> | |
18 | 18 | <!-- <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> --> |
19 | 19 | </v-toolbar-items> |
20 | 20 | </v-toolbar> |
... | ... | @@ -117,6 +117,7 @@ export default { |
117 | 117 | http() |
118 | 118 | .post("/schoolLogin", userdata) |
119 | 119 | .then(response => { |
120 | + // console.log("token",response.data.data); | |
120 | 121 | this.loading = false; |
121 | 122 | if (response.data.data.role === "ADMIN") { |
122 | 123 | this.$store.dispatch("setToken", response.data.data.token); |
... | ... | @@ -127,6 +128,12 @@ export default { |
127 | 128 | this.$store.dispatch("setSchoolRole", response.data.data.role); |
128 | 129 | this.$store.dispatch("setSchoolToken", response.data.data.token); |
129 | 130 | this.$router.push("/schooldashboard"); |
131 | + } else if (response.data.data.role === "TEACHER") { | |
132 | + // console.log("teacher", response.data.data.role); | |
133 | + this.$store.dispatch("setToken", response.data.data.token); | |
134 | + this.$store.dispatch("Id", response.data.data.id); | |
135 | + this.$store.dispatch("Role", response.data.data.role); | |
136 | + this.$router.push("/dashboard"); | |
130 | 137 | } else if (response.data.data.role === "LIBRARIAN") { |
131 | 138 | this.$store.dispatch("setToken", response.data.data.token); |
132 | 139 | this.$store.dispatch("Id", response.data.data.id); |
... | ... | @@ -154,9 +161,9 @@ export default { |
154 | 161 | } |
155 | 162 | }, |
156 | 163 | mounted() { |
157 | - if (this.$store.state.isUserLoggedIn == true) { | |
158 | - this.$router.push("/dashboard"); | |
159 | - } | |
164 | + // if (this.$store.state.isUserLoggedIn == true) { | |
165 | + // this.$router.push("/dashboard"); | |
166 | + // } | |
160 | 167 | // else if (this.$store.state.isSchoolLoggedIn == true) { |
161 | 168 | // this.$router.push("/dashboard"); |
162 | 169 | // } | ... | ... |
src/pages/Dashboard/dashboard.vue
... | ... | @@ -446,6 +446,8 @@ export default { |
446 | 446 | this.token = this.$store.state.token; |
447 | 447 | } else if (this.$store.state.schoolRole === "SUPERADMIN") { |
448 | 448 | this.token = this.$store.state.schoolToken; |
449 | + } else if (this.$store.state.role === "TEACHER") { | |
450 | + this.token = this.$store.state.token; | |
449 | 451 | } |
450 | 452 | // console.log("role", this.$store.state.schoolRole,"tt",this.$store.state.schoolToken); |
451 | 453 | // this.getData(); | ... | ... |
src/pages/Exam/examAttendence.vue
... | ... | @@ -0,0 +1,596 @@ |
1 | +<template> | |
2 | + <v-container fluid class="body-color"> | |
3 | + <!-- ***** Exam Schedule TABLE****** --> | |
4 | + <v-toolbar color="transparent" flat> | |
5 | + <v-btn | |
6 | + fab | |
7 | + dark | |
8 | + class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | |
9 | + small | |
10 | + @click="addExamAttendenceDialog = true" | |
11 | + > | |
12 | + <v-icon dark>add</v-icon> | |
13 | + </v-btn> | |
14 | + <v-btn | |
15 | + round | |
16 | + class="open-dialog-button hidden-sm-only hidden-xs-only" | |
17 | + dark | |
18 | + @click="addExamAttendenceDialog = true" | |
19 | + > | |
20 | + <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Attendence | |
21 | + </v-btn> | |
22 | + <v-spacer></v-spacer> | |
23 | + <v-flex xs8 sm3 md2 class="mr-3"> | |
24 | + <v-select | |
25 | + v-model="addAttendence.examId" | |
26 | + label="Select Exam" | |
27 | + :rules="examRules" | |
28 | + :items="examList" | |
29 | + item-text="examName" | |
30 | + item-value="_id" | |
31 | + required | |
32 | + ></v-select> | |
33 | + </v-flex> | |
34 | + <v-flex xs8 sm3 md2 class="mr-3"> | |
35 | + <v-select | |
36 | + v-model="addAttendence.classId" | |
37 | + label="Select your class" | |
38 | + type="text" | |
39 | + :items="classList" | |
40 | + item-text="classNum" | |
41 | + item-value="_id" | |
42 | + @change="getSections(addAttendence.classId)" | |
43 | + required | |
44 | + ></v-select> | |
45 | + </v-flex> | |
46 | + <v-flex xs8 sm3 md2 class="mr-3"> | |
47 | + <v-select | |
48 | + v-model="addAttendence.sectionId" | |
49 | + label="Select your section" | |
50 | + type="text" | |
51 | + :items="addSection" | |
52 | + item-text="name" | |
53 | + item-value="_id" | |
54 | + @change="getClassSubject(addAttendence.classId)" | |
55 | + required | |
56 | + ></v-select> | |
57 | + </v-flex> | |
58 | + <v-flex xs8 sm3 md2 class="mr-3"> | |
59 | + <v-select | |
60 | + v-model="addAttendence.subjectId" | |
61 | + label="Select Subject" | |
62 | + :rules="subjectRules" | |
63 | + :items="subjectList.subjects" | |
64 | + item-text="subjectName" | |
65 | + item-value="_id" | |
66 | + @change="getExamAttendenceList()" | |
67 | + required | |
68 | + ></v-select> | |
69 | + </v-flex> | |
70 | + | |
71 | + <v-card-title class="body-1" v-show="show"> | |
72 | + <v-btn icon large flat @click="displaySearch"> | |
73 | + <v-avatar size="27"> | |
74 | + <img src="/static/icon/search.png" alt="icon" /> | |
75 | + </v-avatar> | |
76 | + </v-btn> | |
77 | + </v-card-title> | |
78 | + <v-flex xs8 sm8 md3 lg2 v-show="showSearch"> | |
79 | + <v-layout> | |
80 | + <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
81 | + <v-icon @click="closeSearch" color="error">close</v-icon> | |
82 | + </v-layout> | |
83 | + </v-flex> | |
84 | + </v-toolbar> | |
85 | + | |
86 | + <v-data-table | |
87 | + :headers="headers" | |
88 | + :items="examData.students" | |
89 | + :pagination.sync="pagination" | |
90 | + :search="search" | |
91 | + > | |
92 | + <template slot="items" slot-scope="props"> | |
93 | + <tr class="tr"> | |
94 | + <td class="td td-row">{{ props.index + 1}}</td> | |
95 | + <td class="text-xs-center td td-row"> | |
96 | + <v-avatar size="40"> | |
97 | + <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | |
98 | + <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | |
99 | + </v-avatar> | |
100 | + </td> | |
101 | + <td class="td td-row text-xs-center">{{ props.item.studentId.name}}</td> | |
102 | + <td class="td td-row text-xs-center">{{ props.item.studentId.rollNo}}</td> | |
103 | + <td class="td td-row text-xs-center">{{ props.item.studentId.email }}</td> | |
104 | + <td class="td td-row text-xs-center"> | |
105 | + <v-radio-group v-model="isPresent" row readonly> | |
106 | + <v-radio | |
107 | + :value="props.item.isPresent" | |
108 | + ></v-radio> | |
109 | + </v-radio-group> | |
110 | + </td> | |
111 | + </tr> | |
112 | + </template> | |
113 | + <v-alert | |
114 | + slot="no-results" | |
115 | + :value="true" | |
116 | + color="error" | |
117 | + icon="warning" | |
118 | + >Your search for "{{ search }}" found no results.</v-alert> | |
119 | + </v-data-table> | |
120 | + | |
121 | + <!-- ****** ADD Exam Attendence ****** --> | |
122 | + <v-dialog v-model="addExamAttendenceDialog" max-width="800px"> | |
123 | + <v-card flat class="text-xs-center pa-2"> | |
124 | + <v-layout> | |
125 | + <v-flex xs12> | |
126 | + <label class="title text-xs-center">Add Exam Attendence</label> | |
127 | + <v-icon size="24" class="right" @click="addExamAttendenceDialog = false">cancel</v-icon> | |
128 | + </v-flex> | |
129 | + </v-layout> | |
130 | + <v-form ref="form" v-model="valid" lazy-validation class="text-xs-center"> | |
131 | + <v-container fluid> | |
132 | + <v-flex xs12> | |
133 | + <v-layout> | |
134 | + <v-flex xs5 class="pt-4 subheading"> | |
135 | + <label class="right">Exam Name:</label> | |
136 | + </v-flex> | |
137 | + <v-flex xs7 sm7 md6 class="ml-3"> | |
138 | + <v-select | |
139 | + label="Select Exam" | |
140 | + :rules="examRules" | |
141 | + :items="examList" | |
142 | + v-model="addAttendence.examId" | |
143 | + item-text="examName" | |
144 | + item-value="_id" | |
145 | + ></v-select> | |
146 | + </v-flex> | |
147 | + </v-layout> | |
148 | + </v-flex> | |
149 | + <v-flex xs12> | |
150 | + <v-layout> | |
151 | + <v-flex xs5 class="pt-4 subheading"> | |
152 | + <label class="right">Class:</label> | |
153 | + </v-flex> | |
154 | + <v-flex xs7 sm7 md6 class="ml-3"> | |
155 | + <v-select | |
156 | + v-model="addAttendence.classId" | |
157 | + label="Select Class" | |
158 | + type="text" | |
159 | + :items="classList" | |
160 | + item-text="classNum" | |
161 | + item-value="_id" | |
162 | + :rules="classRules" | |
163 | + @change="getSections(addAttendence.classId)" | |
164 | + required | |
165 | + ></v-select> | |
166 | + </v-flex> | |
167 | + </v-layout> | |
168 | + </v-flex> | |
169 | + <v-flex xs12> | |
170 | + <v-layout> | |
171 | + <v-flex xs5 class="pt-4 subheading"> | |
172 | + <label class="right">Section:</label> | |
173 | + </v-flex> | |
174 | + <v-flex xs7 sm7 md6 class="ml-3"> | |
175 | + <v-select | |
176 | + :items="addSection" | |
177 | + label="Select Section" | |
178 | + v-model="addAttendence.sectionId" | |
179 | + item-text="name" | |
180 | + item-value="_id" | |
181 | + name="Select Section" | |
182 | + :rules="sectionRules" | |
183 | + @change="getClassSubject(addAttendence.classId)" | |
184 | + required | |
185 | + ></v-select> | |
186 | + </v-flex> | |
187 | + </v-layout> | |
188 | + </v-flex> | |
189 | + <v-flex xs12> | |
190 | + <v-layout> | |
191 | + <v-flex xs5 class="pt-4 subheading"> | |
192 | + <label class="right">Subject Name:</label> | |
193 | + </v-flex> | |
194 | + <v-flex xs7 sm7 md6 class="ml-3"> | |
195 | + <v-select | |
196 | + :items="subjectList.subjects" | |
197 | + label="Select Subject" | |
198 | + item-text="subjectName" | |
199 | + v-model="addAttendence.subjectId" | |
200 | + item-value="_id" | |
201 | + name="Select Subject" | |
202 | + :rules="subjectRules" | |
203 | + required | |
204 | + ></v-select> | |
205 | + </v-flex> | |
206 | + </v-layout> | |
207 | + </v-flex> | |
208 | + <v-layout> | |
209 | + <v-flex xs12> | |
210 | + <v-card-actions> | |
211 | + <v-spacer class="hidden-xs-only"></v-spacer> | |
212 | + <v-btn | |
213 | + round | |
214 | + dark | |
215 | + @click="showTable" | |
216 | + :loading="loading" | |
217 | + class="add-button" | |
218 | + >Attendence</v-btn> | |
219 | + </v-card-actions> | |
220 | + </v-flex> | |
221 | + </v-layout> | |
222 | + </v-container> | |
223 | + </v-form> | |
224 | + <v-flex xs12 v-show="attendeceTable" class> | |
225 | + <v-data-table | |
226 | + :headers="headers" | |
227 | + :items="studentsData" | |
228 | + :pagination.sync="pagination" | |
229 | + :search="search" | |
230 | + > | |
231 | + <template slot="items" slot-scope="props"> | |
232 | + <tr class="tr"> | |
233 | + <td class="td td-row">{{ props.index + 1}}</td> | |
234 | + <td class="text-xs-center td td-row"> | |
235 | + <v-avatar size="40"> | |
236 | + <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | |
237 | + <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | |
238 | + </v-avatar> | |
239 | + </td> | |
240 | + <td class="td td-row text-xs-center">{{ props.item.name}}</td> | |
241 | + <td class="td td-row text-xs-center">{{ props.item.rollNo}}</td> | |
242 | + <td class="td td-row text-xs-center">{{ props.item.email }}</td> | |
243 | + <td class="td td-row text-xs-center"> | |
244 | + <v-radio-group v-model="props.item.attendence" :mandatory="false" row> | |
245 | + <v-radio | |
246 | + v-for="attendences in attendenceType" | |
247 | + :key="attendences.value" | |
248 | + :label="`${attendences.label}`" | |
249 | + :value="attendences.value" | |
250 | + ></v-radio> | |
251 | + </v-radio-group> | |
252 | + </td> | |
253 | + </tr> | |
254 | + </template> | |
255 | + <v-alert | |
256 | + slot="no-results" | |
257 | + :value="true" | |
258 | + color="error" | |
259 | + icon="warning" | |
260 | + >Your search for "{{ search }}" found no results.</v-alert> | |
261 | + </v-data-table> | |
262 | + <v-flex xs12 sm12> | |
263 | + <v-card-actions> | |
264 | + <v-spacer></v-spacer> | |
265 | + <v-btn @click="submit()" round dark :loading="loading" class="add-button">Submit</v-btn> | |
266 | + </v-card-actions> | |
267 | + </v-flex> | |
268 | + </v-flex> | |
269 | + </v-card> | |
270 | + </v-dialog> | |
271 | + <v-snackbar | |
272 | + :timeout="timeout" | |
273 | + :top="y === 'top'" | |
274 | + :right="x === 'right'" | |
275 | + :vertical="mode === 'vertical'" | |
276 | + v-model="snackbar" | |
277 | + :color="color" | |
278 | + >{{ text }}</v-snackbar> | |
279 | + <div class="loader" v-if="showLoader"> | |
280 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
281 | + </div> | |
282 | + </v-container> | |
283 | +</template> | |
284 | + | |
285 | +<script> | |
286 | +import http from "@/Services/http.js"; | |
287 | +import Util from "@/util"; | |
288 | +import moment from "moment"; | |
289 | + | |
290 | +export default { | |
291 | + data: () => ({ | |
292 | + snackbar: false, | |
293 | + editDate: false, | |
294 | + menu1: false, | |
295 | + menuB: false, | |
296 | + menu2: false, | |
297 | + menuEdit: false, | |
298 | + timeToEdit: false, | |
299 | + show: true, | |
300 | + showSearch: false, | |
301 | + addExamAttendenceDialog: false, | |
302 | + color: "", | |
303 | + y: "top", | |
304 | + x: "right", | |
305 | + mode: "", | |
306 | + timeout: 10000, | |
307 | + text: "", | |
308 | + loading: false, | |
309 | + search: "", | |
310 | + showLoader: false, | |
311 | + valid: true, | |
312 | + role: "", | |
313 | + pagination: { | |
314 | + rowsPerPage: 10 | |
315 | + }, | |
316 | + attendeceTable: false, | |
317 | + isPresent: true, | |
318 | + | |
319 | + examRules: [v => !!v || "Exam Name is required"], | |
320 | + classRules: [v => !!v || "Class Name is required"], | |
321 | + sectionRules: [v => !!v || "section is required"], | |
322 | + subjectRules: [v => !!v || "Subject is required"], | |
323 | + timeInRules: [v => !!v || "Time In is required"], | |
324 | + timeOutRules: [v => !!v || "time Out s is required"], | |
325 | + roomRules: [v => !!v || "Room is required"], | |
326 | + examScheduleDateRules: [v => !!v || "Date is required"], | |
327 | + studentsData: [], | |
328 | + examData: [], | |
329 | + students: [], | |
330 | + | |
331 | + headers: [ | |
332 | + { | |
333 | + align: "", | |
334 | + text: "No", | |
335 | + sortable: false, | |
336 | + value: "No" | |
337 | + }, | |
338 | + { | |
339 | + text: "Profile Pic", | |
340 | + value: "profilprofilePicUrlePicUrl", | |
341 | + sortable: false, | |
342 | + align: "center" | |
343 | + }, | |
344 | + { | |
345 | + text: "Name", | |
346 | + value: "name", | |
347 | + sortable: false, | |
348 | + align: "center" | |
349 | + }, | |
350 | + { | |
351 | + text: "Roll No", | |
352 | + value: "rollNo", | |
353 | + sortable: false, | |
354 | + align: "center" | |
355 | + }, | |
356 | + { | |
357 | + text: "Email", | |
358 | + value: "email", | |
359 | + sortable: false, | |
360 | + align: "center" | |
361 | + }, | |
362 | + { | |
363 | + text: "Action", | |
364 | + value: "", | |
365 | + sortable: false, | |
366 | + align: "center" | |
367 | + } | |
368 | + ], | |
369 | + attendenceType: [ | |
370 | + { | |
371 | + label: "", | |
372 | + value: true | |
373 | + } | |
374 | + ], | |
375 | + classList: [], | |
376 | + addSection: [], | |
377 | + examList: [], | |
378 | + subjectList: [], | |
379 | + subjects: [], | |
380 | + addAttendence: {}, | |
381 | + editedItem: { | |
382 | + sectionId: { | |
383 | + name: "" | |
384 | + } | |
385 | + }, | |
386 | + getScheduleData: {}, | |
387 | + ScheduleData: [], | |
388 | + token: "" | |
389 | + }), | |
390 | + methods: { | |
391 | + pickFile() { | |
392 | + this.$refs.image.click(); | |
393 | + }, | |
394 | + getSchedulesList() { | |
395 | + this.showLoader = true; | |
396 | + http() | |
397 | + .get("/getSchedulesList", { | |
398 | + params: { classId: this.getScheduleData.classId }, | |
399 | + headers: { Authorization: "Bearer " + this.token } | |
400 | + }) | |
401 | + .then(response => { | |
402 | + this.ScheduleData = response.data.data; | |
403 | + // console.log("this.ScheduleData", this.ScheduleData); | |
404 | + this.showLoader = false; | |
405 | + }) | |
406 | + .catch(error => { | |
407 | + // console.log("err====>", err); | |
408 | + this.showLoader = false; | |
409 | + this.loadingSearch = false; | |
410 | + this.snackbar = true; | |
411 | + this.text = error.response.data.message; | |
412 | + if (error.response.status === 401) { | |
413 | + this.$router.replace({ path: "/" }); | |
414 | + this.$store.dispatch("setToken", null); | |
415 | + this.$store.dispatch("Id", null); | |
416 | + } | |
417 | + }); | |
418 | + }, | |
419 | + close() { | |
420 | + this.dialog = false; | |
421 | + }, | |
422 | + submit() { | |
423 | + var examAttendence = { | |
424 | + examId: this.addAttendence.examId, | |
425 | + classId: this.addAttendence.classId, | |
426 | + sectionId: this.addAttendence.sectionId, | |
427 | + subjectId: this.addAttendence.subjectId, | |
428 | + students: [] | |
429 | + }; | |
430 | + for (var j = 0; j < this.studentsData.length; j++) { | |
431 | + console.log("studentdata", this.studentsData); | |
432 | + examAttendence.students.push({ | |
433 | + studentId: this.studentsData[j]._id, | |
434 | + isPresent: this.studentsData[j].attendence | |
435 | + }); | |
436 | + } | |
437 | + console.log("attendence", examAttendence); | |
438 | + if (this.$refs.form.validate()) { | |
439 | + http() | |
440 | + .post("/createExamAttendance", examAttendence) | |
441 | + .then(response => { | |
442 | + this.snackbar = true; | |
443 | + this.color = "success"; | |
444 | + this.text = "Successfully created exam attendence"; | |
445 | + this.addExamAttendenceDialog = false; | |
446 | + this.getExamAttendenceList(); | |
447 | + }) | |
448 | + .catch(error => { | |
449 | + this.snackbar = true; | |
450 | + this.text = error.response.data.message; | |
451 | + }); | |
452 | + } | |
453 | + }, | |
454 | + clear() { | |
455 | + this.$refs.form.reset(); | |
456 | + this.disable = false; | |
457 | + this.loading = false; | |
458 | + }, | |
459 | + getClass() { | |
460 | + http() | |
461 | + .get("/getClassesList", { | |
462 | + headers: { Authorization: "Bearer " + this.token } | |
463 | + }) | |
464 | + .then(response => { | |
465 | + this.classList = response.data.data; | |
466 | + }) | |
467 | + .catch(err => { | |
468 | + // console.log("err====>", err); | |
469 | + }); | |
470 | + }, | |
471 | + getSections(_id) { | |
472 | + for (let i = 0; i < this.classList.length; i++) { | |
473 | + if (_id == this.classList[i]._id) { | |
474 | + // this.subjects = this.classList[i].subjects; | |
475 | + } | |
476 | + } | |
477 | + http() | |
478 | + .get( | |
479 | + "/getSectionsList", | |
480 | + { params: { classId: _id } }, | |
481 | + { | |
482 | + headers: { Authorization: "Bearer " + this.token } | |
483 | + } | |
484 | + ) | |
485 | + .then(response => { | |
486 | + this.addSection = response.data.data; | |
487 | + }) | |
488 | + .catch(err => {}); | |
489 | + }, | |
490 | + getClassSubject(_id) { | |
491 | + this.showLoader = true; | |
492 | + // this.classId = this.classId; | |
493 | + http() | |
494 | + .get( | |
495 | + "/getParticularClass", | |
496 | + { params: { classId: _id } }, | |
497 | + { | |
498 | + headers: { Authorization: "Bearer " + this.token } | |
499 | + } | |
500 | + ) | |
501 | + .then(response => { | |
502 | + this.subjectList = response.data.data; | |
503 | + this.showLoader = false; | |
504 | + }) | |
505 | + .catch(err => { | |
506 | + this.showLoader = false; | |
507 | + }); | |
508 | + }, | |
509 | + getExamList() { | |
510 | + this.showLoader = true; | |
511 | + this.loadingSearch = true; | |
512 | + http() | |
513 | + .get("/getExamsList", { | |
514 | + headers: { Authorization: "Bearer " + this.token } | |
515 | + }) | |
516 | + .then(response => { | |
517 | + this.examList = response.data.data; | |
518 | + this.showLoader = false; | |
519 | + this.loadingSearch = false; | |
520 | + }) | |
521 | + .catch(error => { | |
522 | + this.showLoader = false; | |
523 | + this.loadingSearch = false; | |
524 | + this.snackbar = true; | |
525 | + this.text = error.response.data.message; | |
526 | + if (error.response.status === 401) { | |
527 | + this.$router.replace({ path: "/" }); | |
528 | + this.$store.dispatch("setToken", null); | |
529 | + this.$store.dispatch("Id", null); | |
530 | + } | |
531 | + }); | |
532 | + }, | |
533 | + showTable() { | |
534 | + this.attendeceTable = true; | |
535 | + this.getStudentList(); | |
536 | + }, | |
537 | + getStudentList() { | |
538 | + this.showLoader = true; | |
539 | + http() | |
540 | + .get("/getStudentWithClass", { | |
541 | + params: { | |
542 | + classId: this.addAttendence.classId, | |
543 | + sectionId: this.addAttendence.sectionId | |
544 | + } | |
545 | + }) | |
546 | + .then(response => { | |
547 | + this.studentsData = response.data.data; | |
548 | + this.showLoader = false; | |
549 | + // this.addExamAttendenceDialog = false; | |
550 | + var attendence = ""; | |
551 | + for (let i = 0; i < this.studentsData.length; i++) { | |
552 | + this.studentsData[i].attendence = false; | |
553 | + } | |
554 | + }) | |
555 | + .catch(err => { | |
556 | + console.log("err====>", err); | |
557 | + this.showLoader = false; | |
558 | + }); | |
559 | + }, | |
560 | + getExamAttendenceList() { | |
561 | + this.showLoader = true; | |
562 | + http() | |
563 | + .get("/getExamAttendenceList", { | |
564 | + params: { | |
565 | + examId: this.addAttendence.examId, | |
566 | + classId: this.addAttendence.classId, | |
567 | + sectionId: this.addAttendence.sectionId, | |
568 | + subjectId: this.addAttendence.subjectId | |
569 | + } | |
570 | + }) | |
571 | + .then(response => { | |
572 | + this.examData = response.data.data[0]; | |
573 | + this.showLoader = false; | |
574 | + }) | |
575 | + .catch(error => { | |
576 | + console.log("error", error); | |
577 | + this.showLoader = false; | |
578 | + }); | |
579 | + }, | |
580 | + displaySearch() { | |
581 | + (this.show = false), (this.showSearch = true); | |
582 | + }, | |
583 | + closeSearch() { | |
584 | + this.showSearch = false; | |
585 | + this.show = true; | |
586 | + this.search = ""; | |
587 | + } | |
588 | + }, | |
589 | + mounted() { | |
590 | + this.token = this.$store.state.token; | |
591 | + this.getClass(); | |
592 | + this.getExamList(); | |
593 | + this.role = this.$store.state.role; | |
594 | + } | |
595 | +}; | |
596 | +</script> | |
0 | 597 | \ No newline at end of file | ... | ... |
src/pages/Exam/examSchedule.vue
... | ... | @@ -306,6 +306,7 @@ |
306 | 306 | <v-icon dark>add</v-icon> |
307 | 307 | </v-btn> |
308 | 308 | <v-btn |
309 | + v-if="role != 'TEACHER' " | |
309 | 310 | round |
310 | 311 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
311 | 312 | dark |
... | ... | @@ -355,9 +356,9 @@ |
355 | 356 | <td class="td td-row text-xs-center">{{ dates(props.item.date) }}</td> |
356 | 357 | <td class="td td-row text-xs-center">{{ props.item.timeFrom }} - {{ props.item.timeTo }}</td> |
357 | 358 | <td class="td td-row text-xs-center">{{ props.item.room }}</td> |
358 | - <td class="td td-row text-xs-center"> | |
359 | + <td class="td td-row text-xs-center" v-if="role != 'TEACHER'"> | |
359 | 360 | <span> |
360 | - <v-tooltip top> | |
361 | + <v-tooltip top > | |
361 | 362 | <img |
362 | 363 | slot="activator" |
363 | 364 | style="cursor:pointer; width:25px; height:25px; " |
... | ... | @@ -660,6 +661,7 @@ export default { |
660 | 661 | editExamScheduleDialog: false, |
661 | 662 | profileExamScheduleDialog: false, |
662 | 663 | valid: true, |
664 | + role: "", | |
663 | 665 | pagination: { |
664 | 666 | rowsPerPage: 10 |
665 | 667 | }, |
... | ... | @@ -714,13 +716,13 @@ export default { |
714 | 716 | sortable: false, |
715 | 717 | align: "center" |
716 | 718 | }, |
717 | - { | |
719 | + { | |
718 | 720 | text: "Room", |
719 | 721 | value: "room", |
720 | 722 | sortable: false, |
721 | 723 | align: "center" |
722 | 724 | }, |
723 | - { text: "Action", value: "", sortable: false, align: "center" } | |
725 | + { text: "Action", value: "", sortable: false, align: "center"} | |
724 | 726 | ], |
725 | 727 | classList: [], |
726 | 728 | addSection: [], |
... | ... | @@ -927,6 +929,8 @@ export default { |
927 | 929 | this.token = this.$store.state.token; |
928 | 930 | this.getClass(); |
929 | 931 | this.getExamList(); |
932 | + this.role = this.$store.state.role; | |
933 | + | |
930 | 934 | } |
931 | 935 | }; |
932 | 936 | </script> |
933 | 937 | \ No newline at end of file | ... | ... |
src/pages/Library/books.vue
... | ... | @@ -226,7 +226,7 @@ |
226 | 226 | </td> |
227 | 227 | <td class="text-xs-center td td-row"> |
228 | 228 | <span> |
229 | - <v-tooltip top> | |
229 | + <!-- <v-tooltip top> | |
230 | 230 | <img |
231 | 231 | slot="activator" |
232 | 232 | style="cursor:pointer; width:25px; height:25px; " |
... | ... | @@ -235,7 +235,7 @@ |
235 | 235 | src="/static/icon/view.png" |
236 | 236 | /> |
237 | 237 | <span>View</span> |
238 | - </v-tooltip> | |
238 | + </v-tooltip> --> | |
239 | 239 | <v-tooltip top> |
240 | 240 | <img |
241 | 241 | slot="activator" | ... | ... |
src/pages/Library/eBook.vue
1 | 1 | <template> |
2 | 2 | <v-container fluid class="body-color"> |
3 | 3 | <!-- ****** EDITS EBOOK DETAILS ****** --> |
4 | - <v-dialog v-model="dialog" max-width="1000px" scrollable> | |
5 | - <v-card flat> | |
6 | - <v-toolbar class="grey lighten-2" flat> | |
7 | - <v-spacer></v-spacer> | |
8 | - <v-toolbar-title> | |
9 | - <h3>Edit E-Books</h3> | |
10 | - </v-toolbar-title> | |
11 | - <v-spacer></v-spacer> | |
12 | - </v-toolbar> | |
13 | - <v-card-text style="height:760px;"> | |
14 | - <v-form ref="form"> | |
15 | - <v-container fluid> | |
16 | - <v-layout row> | |
17 | - <v-flex | |
18 | - xs12 | |
19 | - class="text-xs-center text-sm-center text-md-center text-lg-center mr-4" | |
20 | - > | |
21 | - <input | |
22 | - type="file" | |
23 | - style="display: none" | |
24 | - ref="image" | |
25 | - accept="image/*" | |
26 | - multiple | |
27 | - @change="onImagePicked" | |
28 | - /> | |
29 | - <v-layout justify-center> | |
30 | - <v-flex v-if="files != ''"> | |
31 | - <img :src="files" height="200" width="160;" /> | |
32 | - </v-flex> | |
33 | - </v-layout> | |
34 | - <img | |
35 | - v-if="editedItem.coverPhotoUrl && files == '' " | |
36 | - :src="editedItem.coverPhotoUrl" | |
37 | - height="200" | |
38 | - width="160" | |
39 | - alt="eBooks" | |
40 | - class="pa-2" | |
41 | - /> | |
42 | - <!-- <v-layout justify-center> | |
43 | - <v-flex | |
44 | - xs3 | |
45 | - v-for="Image in editedItem.newsImageUrl" | |
46 | - :key="Image._id" | |
47 | - v-if="editedItem.newsImageUrl" | |
48 | - class="profile-image-wrapper" | |
49 | - > | |
50 | - | |
51 | - <v-icon | |
52 | - class="red edit-profile-icon" | |
53 | - dark | |
54 | - @click="deleteImage(Image._id,editedItem._id)" | |
55 | - >close</v-icon> | |
56 | - </v-flex> | |
57 | - <v-flex v-for="(file, index) in files" :key="index"> | |
58 | - <img :src="file" height="160" width="160" class="pa-2" /> | |
59 | - </v-flex> | |
60 | - </v-layout>--> | |
61 | - <img | |
62 | - src="/static/icon/user.png" | |
63 | - v-if="editedItem.coverPhotoUrl == ''" | |
64 | - height="160" | |
65 | - width="160" | |
66 | - alt="Books" | |
67 | - /> | |
68 | - </v-flex> | |
69 | - </v-layout> | |
4 | + <v-dialog v-model="editEbookDialog" max-width="600px"> | |
5 | + <v-card flat class="card-style pa-2" dark> | |
6 | + <v-layout> | |
7 | + <v-flex xs12> | |
8 | + <label class="title text-xs-center">Edit E-Book</label> | |
9 | + <v-icon size="24" class="right" @click="editEbookDialog = false">cancel</v-icon> | |
10 | + </v-flex> | |
11 | + </v-layout> | |
12 | + <v-card-text> | |
13 | + <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center mr-4"> | |
14 | + <input | |
15 | + type="file" | |
16 | + style="display: none" | |
17 | + ref="image" | |
18 | + accept="image/*" | |
19 | + multiple | |
20 | + @change="onImagePicked" | |
21 | + /> | |
22 | + <v-layout justify-center> | |
23 | + <v-flex v-if="files != ''"> | |
24 | + <img :src="files" height="200" width="160;" /> | |
25 | + </v-flex> | |
26 | + </v-layout> | |
27 | + <img | |
28 | + v-if="editedItem.coverPhotoUrl && files == '' " | |
29 | + :src="editedItem.coverPhotoUrl" | |
30 | + height="200" | |
31 | + width="160" | |
32 | + alt="eBooks" | |
33 | + class="pa-2" | |
34 | + /> | |
35 | + <v-layout justify-center> | |
36 | + <v-flex | |
37 | + xs3 | |
38 | + v-for="Image in editedItem.newsImageUrl" | |
39 | + :key="Image._id" | |
40 | + class="profile-image-wrapper" | |
41 | + > | |
42 | + <v-icon | |
43 | + class="red edit-profile-icon" | |
44 | + dark | |
45 | + @click="deleteImage(Image._id,editedItem._id)" | |
46 | + >close</v-icon> | |
47 | + </v-flex> | |
48 | + <v-flex v-for="(file, index) in files" :key="index"> | |
49 | + <img :src="file" height="160" width="160" class="pa-2" /> | |
50 | + </v-flex> | |
51 | + </v-layout> | |
52 | + <img | |
53 | + src="/static/icon/user.png" | |
54 | + v-if="editedItem.coverPhotoUrl == ''" | |
55 | + height="160" | |
56 | + width="160" | |
57 | + alt="Books" | |
58 | + /> | |
59 | + </v-flex> | |
60 | + <v-container grid-list-md> | |
61 | + <v-flex xs12 sm6> | |
70 | 62 | <v-layout> |
71 | - <v-flex xs12 sm12> | |
72 | - <v-layout> | |
73 | - <v-flex xs4 class="pt-4 subheading"> | |
74 | - <label class="right">Name:</label> | |
75 | - </v-flex> | |
76 | - <v-flex xs5 class="ml-3"> | |
77 | - <v-text-field | |
78 | - v-model="editedItem.name" | |
79 | - placeholder="fill your Name" | |
80 | - type="text" | |
81 | - ></v-text-field> | |
82 | - </v-flex> | |
83 | - </v-layout> | |
84 | - </v-flex> | |
85 | - <v-flex xs12 sm12> | |
86 | - <v-layout> | |
87 | - <v-flex xs4 class="pt-4 subheading"> | |
88 | - <label class="right">Author:</label> | |
89 | - </v-flex> | |
90 | - <v-flex xs5 class="ml-3"> | |
91 | - <v-text-field placeholder="fill your Author" v-model="editedItem.author"></v-text-field> | |
92 | - </v-flex> | |
93 | - </v-layout> | |
94 | - </v-flex> | |
95 | - <v-flex xs12 sm12> | |
96 | - <v-layout> | |
97 | - <v-flex xs4 class="pt-4 subheading"> | |
98 | - <label class="right">Class:</label> | |
99 | - </v-flex> | |
100 | - <v-flex xs5 class="ml-3"> | |
101 | - <v-text-field | |
102 | - v-model="editedItem.className" | |
103 | - :items="addClass" | |
104 | - label="Select Class" | |
105 | - item-text="classNum" | |
106 | - item-value="_id" | |
107 | - ></v-text-field> | |
108 | - </v-flex> | |
109 | - </v-layout> | |
63 | + <v-flex xs4 class="pt-4 subheading"> | |
64 | + <label class="right hidden-xs-only hidden-sm-only">Name :</label> | |
65 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name :</label> | |
110 | 66 | </v-flex> |
111 | - <v-flex xs12 sm12> | |
112 | - <v-layout> | |
113 | - <v-flex xs4 class="pt-4 subheading"> | |
114 | - <label class="right">Upload Image:</label> | |
115 | - </v-flex> | |
116 | - <v-flex xs5 class="ml-3"> | |
117 | - <v-text-field | |
118 | - label="Select Image" | |
119 | - @click="pickImage" | |
120 | - v-model="imageName" | |
121 | - append-icon="attach_file" | |
122 | - multiple | |
123 | - ></v-text-field> | |
124 | - </v-flex> | |
125 | - </v-layout> | |
67 | + <v-flex xs8 class="ml-3"> | |
68 | + <v-text-field | |
69 | + v-model="editedItem.name" | |
70 | + placeholder="fill your full Name" | |
71 | + name="name" | |
72 | + type="text" | |
73 | + required | |
74 | + ></v-text-field> | |
126 | 75 | </v-flex> |
127 | - <v-flex xs12 sm12> | |
128 | - <v-layout> | |
129 | - <v-flex xs4 class="pt-4 subheading"> | |
130 | - <label class="right">Upload File:</label> | |
131 | - </v-flex> | |
132 | - <v-flex xs5 class="ml-3"> | |
133 | - <input type="file" style="display: none" ref="file" @change="onFilePicked" /> | |
134 | - <v-text-field | |
135 | - label="Select File" | |
136 | - @click="pickFile" | |
137 | - v-model="fileName" | |
138 | - append-icon="attach_file" | |
139 | - multiple | |
140 | - ></v-text-field> | |
141 | - </v-flex> | |
142 | - </v-layout> | |
76 | + </v-layout> | |
77 | + </v-flex> | |
78 | + <v-flex xs12 sm6> | |
79 | + <v-layout> | |
80 | + <v-flex xs4 class="pt-4 subheading"> | |
81 | + <label class="right hidden-xs-only hidden-sm-only">Author :</label> | |
82 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Author :</label> | |
143 | 83 | </v-flex> |
144 | - <v-flex xs12 sm12> | |
145 | - <v-layout> | |
146 | - <v-flex xs4 class="pt-4 subheading"> | |
147 | - <label class="right">Private:</label> | |
148 | - </v-flex> | |
149 | - <v-flex xs5 class="ml-3"> | |
150 | - <v-checkbox v-model="editedItem.private"></v-checkbox> | |
151 | - </v-flex> | |
152 | - </v-layout> | |
84 | + <v-flex xs8 class="ml-3"> | |
85 | + <v-text-field | |
86 | + v-model="editedItem.author" | |
87 | + placeholder="fill your full author" | |
88 | + name="name" | |
89 | + type="text" | |
90 | + required | |
91 | + ></v-text-field> | |
153 | 92 | </v-flex> |
154 | 93 | </v-layout> |
94 | + </v-flex> | |
95 | + <v-flex xs12 sm6> | |
155 | 96 | <v-layout> |
156 | - <v-flex xs12 sm8 offset-sm2> | |
157 | - <v-card-actions> | |
158 | - <v-btn round dark @click.native="close">Cancel</v-btn> | |
159 | - <v-spacer></v-spacer> | |
160 | - <v-btn round dark @click="save" :loading="loadingUpadte">Save</v-btn> | |
161 | - </v-card-actions> | |
97 | + <v-flex xs4 class="pt-4 subheading"> | |
98 | + <label class="right hidden-xs-only hidden-sm-only">Class :</label> | |
99 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class :</label> | |
100 | + </v-flex> | |
101 | + <v-flex xs8 class="ml-3"> | |
102 | + <v-text-field | |
103 | + v-model="editedItem.classId" | |
104 | + placeholder="fill your full class" | |
105 | + name="classNum" | |
106 | + type="_id" | |
107 | + required | |
108 | + ></v-text-field> | |
162 | 109 | </v-flex> |
163 | 110 | </v-layout> |
164 | - </v-container> | |
165 | - </v-form> | |
111 | + </v-flex> | |
112 | + </v-container> | |
166 | 113 | </v-card-text> |
167 | 114 | </v-card> |
168 | 115 | </v-dialog> |
169 | 116 | |
170 | 117 | <!-- ****** PROFILE VIEW ALL NEWS DEATILS ****** --> |
171 | 118 | |
172 | - <v-dialog v-model="dialog1" max-width="800px" scrollable> | |
173 | - <v-card style="height: 700px;"> | |
174 | - <v-toolbar color="grey lighten-2" flat> | |
175 | - <v-spacer></v-spacer> | |
176 | - <v-toolbar-title> | |
177 | - <h3>E-Books</h3> | |
178 | - </v-toolbar-title> | |
179 | - <v-spacer></v-spacer> | |
180 | - <v-icon @click="close1">close</v-icon> | |
181 | - </v-toolbar> | |
182 | - <v-card-text> | |
183 | - <v-container> | |
184 | - <v-layout wrap> | |
185 | - <v-flex sm12 xs12> | |
186 | - <iframe :src="editedItem.fileUrl" height="600" width="100%"></iframe> | |
187 | - </v-flex> | |
188 | - </v-layout> | |
189 | - </v-container> | |
190 | - </v-card-text> | |
119 | + <v-dialog v-model="viewEbookDialog" max-width="800px" scrollable> | |
120 | + <v-card flat class="card-style pa-3" dark> | |
121 | + <v-layout> | |
122 | + <v-flex xs12> | |
123 | + <label class="title text-xs-center">View E-book Details</label> | |
124 | + <v-icon size="24" class="right" @click="viewEbookDialog = false">cancel</v-icon> | |
125 | + </v-flex> | |
126 | + </v-layout> | |
127 | + <v-layout> | |
128 | + <v-flex align-center justify-center layout text-xs-center class="mt-3"> | |
129 | + <v-avatar size="100px"> | |
130 | + <img src="/static/icon/user.png" v-if="!editedItem.fileUrl" /> | |
131 | + <img :src="editedItem.fileUrl" v-else-if="editedItem.fileUrl" /> | |
132 | + </v-avatar> | |
133 | + </v-flex> | |
134 | + </v-layout> | |
135 | + <v-container grid-list-md> | |
136 | + <v-layout wrap> | |
137 | + <v-flex xs12 sm5> | |
138 | + <v-layout> | |
139 | + <v-flex xs6 sm6> | |
140 | + <h5 class="right my-1"> | |
141 | + <b>Name:</b> | |
142 | + </h5> | |
143 | + </v-flex> | |
144 | + <v-flex sm6 xs6> | |
145 | + <h5 class="my-1 left">{{ editedItem.name }}</h5> | |
146 | + </v-flex> | |
147 | + </v-layout> | |
148 | + </v-flex> | |
149 | + <v-flex xs12 sm7> | |
150 | + <v-layout> | |
151 | + <v-flex xs6 sm4> | |
152 | + <h5 class="right my-1"> | |
153 | + <b>Author:</b> | |
154 | + </h5> | |
155 | + </v-flex> | |
156 | + <v-flex sm8 xs6> | |
157 | + <h5 class="my-1 left">{{ editedItem.author }}</h5> | |
158 | + </v-flex> | |
159 | + </v-layout> | |
160 | + </v-flex> | |
161 | + </v-layout> | |
162 | + <v-layout wrap> | |
163 | + <v-flex xs12 sm5> | |
164 | + <v-layout> | |
165 | + <v-flex xs6 sm6> | |
166 | + <h5 class="right my-1"> | |
167 | + <b>Class:</b> | |
168 | + </h5> | |
169 | + </v-flex> | |
170 | + <v-flex sm6 xs6> | |
171 | + <h5 class="my-1 left">{{ editedItem.classId }}</h5> | |
172 | + </v-flex> | |
173 | + </v-layout> | |
174 | + </v-flex> | |
175 | + </v-layout> | |
176 | + </v-container> | |
191 | 177 | </v-card> |
192 | 178 | </v-dialog> |
193 | 179 | <!-- ****** EXISTING-USERS NEWS TABLE ****** --> |
... | ... | @@ -294,10 +280,7 @@ |
294 | 280 | <v-form ref="form" v-model="valid" lazy-validation> |
295 | 281 | <v-container fluid> |
296 | 282 | <v-layout> |
297 | - <v-flex | |
298 | - xs12 | |
299 | - class="text-xs-center text-sm-center text-md-center text-lg-center" | |
300 | - > | |
283 | + <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center"> | |
301 | 284 | <input |
302 | 285 | type="file" |
303 | 286 | style="display: none" |
... | ... | @@ -321,7 +304,7 @@ |
321 | 304 | <v-flex xs7 class="ml-3"> |
322 | 305 | <v-text-field |
323 | 306 | v-model="addEBooks.name" |
324 | - placeholder="fill your Title" | |
307 | + placeholder="fill name" | |
325 | 308 | name="name" |
326 | 309 | type="text" |
327 | 310 | :rules="titleRules" |
... | ... | @@ -374,7 +357,7 @@ |
374 | 357 | <v-text-field |
375 | 358 | label="Select Image" |
376 | 359 | @click="pickImage" |
377 | - v-model="imageName" | |
360 | + v-model="addEBooks.uploadCover" | |
378 | 361 | append-icon="attach_file" |
379 | 362 | multiple |
380 | 363 | ></v-text-field> |
... | ... | @@ -391,7 +374,7 @@ |
391 | 374 | <v-text-field |
392 | 375 | label="Select File" |
393 | 376 | @click="pickFile" |
394 | - v-model="fileName" | |
377 | + v-model="addEBooks.uploadFile" | |
395 | 378 | append-icon="attach_file" |
396 | 379 | multiple |
397 | 380 | ></v-text-field> |
... | ... | @@ -446,8 +429,8 @@ export default { |
446 | 429 | date: null, |
447 | 430 | search: "", |
448 | 431 | showLoader: false, |
449 | - dialog: false, | |
450 | - dialog1: false, | |
432 | + editEbookDialog: false, | |
433 | + viewEbookDialog: false, | |
451 | 434 | valid: true, |
452 | 435 | addEBookDialog: false, |
453 | 436 | addClass: [], |
... | ... | @@ -489,7 +472,8 @@ export default { |
489 | 472 | private: false |
490 | 473 | }, |
491 | 474 | editedItem: {}, |
492 | - token: "" | |
475 | + token: "", | |
476 | + uploadCover: {} | |
493 | 477 | }), |
494 | 478 | methods: { |
495 | 479 | pickImage() { |
... | ... | @@ -566,12 +550,12 @@ export default { |
566 | 550 | this.editedIndex = this.eBookData.indexOf(item); |
567 | 551 | this.editedItem = Object.assign({}, item); |
568 | 552 | this.editedItem.className = item.classId.classNum; |
569 | - this.dialog = true; | |
553 | + this.editEbookDialog = true; | |
570 | 554 | }, |
571 | 555 | profile(item) { |
572 | 556 | this.editedIndex = this.eBookData.indexOf(item); |
573 | 557 | this.editedItem = Object.assign({}, item); |
574 | - this.dialog1 = true; | |
558 | + this.viewEbookDialog = true; | |
575 | 559 | }, |
576 | 560 | deleteItem(item) { |
577 | 561 | let deleteEBooks = { |
... | ... | @@ -595,10 +579,10 @@ export default { |
595 | 579 | }); |
596 | 580 | }, |
597 | 581 | close() { |
598 | - this.dialog = false; | |
582 | + this.editEbookDialog = false; | |
599 | 583 | }, |
600 | 584 | close1() { |
601 | - this.dialog1 = false; | |
585 | + this.viewEbookDialog = false; | |
602 | 586 | }, |
603 | 587 | submit() { |
604 | 588 | if (this.$refs.form.validate()) { |
... | ... | @@ -612,25 +596,30 @@ export default { |
612 | 596 | this.addEBooks.uploadFile = fileUrl; |
613 | 597 | // console.log("anyFile.split(/,/)", this.addEBooks.uploadFile); |
614 | 598 | } |
615 | - this.addEBooks = this.$store.state.schoolId; | |
616 | - this.loading = true; | |
599 | + let data = { | |
600 | + classId: this.addEBooks.classId, | |
601 | + name: this.addEBooks.name, | |
602 | + author: this.addEBooks.author, | |
603 | + private: this.addEBooks.private, | |
604 | + uploadCover: this.addEBooks.uploadCover, | |
605 | + uploadFile: this.addEBooks.uploadFile | |
606 | + }; | |
617 | 607 | http() |
618 | - .post("/createEBook", this.addEBooks) | |
608 | + .post("/createEBook", data) | |
619 | 609 | .then(response => { |
610 | + this.getEBooksList = []; | |
620 | 611 | this.snackbar = true; |
621 | - this.text = "New E-Book added successfully"; | |
622 | - this.addEBooks.uploadCover = ""; | |
623 | - this.addEBooks.uploadFile = ""; | |
624 | - this.files = ""; | |
625 | - this.getEBooksList(); | |
626 | 612 | this.addEBookDialog = false; |
613 | + this.text = response.data.message; | |
614 | + this.color = "green"; | |
627 | 615 | this.loading = false; |
628 | - this.clear(); | |
616 | + this.addEBooks.uploadCover = ""; | |
617 | + this.addEBooks.uploadFile = ""; | |
629 | 618 | }) |
630 | 619 | .catch(error => { |
631 | 620 | this.snackbar = true; |
632 | 621 | this.text = error.response.data.message; |
633 | - this.loading = false; | |
622 | + this.color = "red"; | |
634 | 623 | }); |
635 | 624 | } |
636 | 625 | }, | ... | ... |
src/pages/Parent/parents.vue
... | ... | @@ -280,6 +280,12 @@ |
280 | 280 | <v-icon size="24" class="right" @click="profileParentDialog = false">cancel</v-icon> |
281 | 281 | </v-flex> |
282 | 282 | </v-layout> |
283 | + <v-flex align-center justify-center layout text-xs-center class="mt-3"> | |
284 | + <v-avatar size="100px"> | |
285 | + <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" /> | |
286 | + <img :src="editedItem.profilePicUrl" v-else-if="editedItem.profilePicUrl" /> | |
287 | + </v-avatar> | |
288 | + </v-flex> | |
283 | 289 | <v-container grid-list-md> |
284 | 290 | <v-layout wrap> |
285 | 291 | <v-flex xs12> |
... | ... | @@ -411,7 +417,7 @@ |
411 | 417 | <v-flex xs6> |
412 | 418 | <h5 class="my-1">{{ editedItem.password }}</h5> |
413 | 419 | </v-flex> |
414 | - </v-layout> --> | |
420 | + </v-layout>--> | |
415 | 421 | </v-flex> |
416 | 422 | </v-layout> |
417 | 423 | </v-flex> |
... | ... | @@ -431,6 +437,7 @@ |
431 | 437 | <v-icon dark>add</v-icon> |
432 | 438 | </v-btn> |
433 | 439 | <v-btn |
440 | + v-if="role != 'TEACHER' " | |
434 | 441 | round |
435 | 442 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
436 | 443 | dark |
... | ... | @@ -485,7 +492,7 @@ |
485 | 492 | /> |
486 | 493 | <span>View</span> |
487 | 494 | </v-tooltip> |
488 | - <v-tooltip top> | |
495 | + <v-tooltip top v-if="role != 'TEACHER' "> | |
489 | 496 | <img |
490 | 497 | slot="activator" |
491 | 498 | style="cursor:pointer; width:20px; height:18px; " |
... | ... | @@ -831,6 +838,8 @@ export default { |
831 | 838 | e1: true, |
832 | 839 | showParent: true, |
833 | 840 | snackbar: false, |
841 | + role: "", | |
842 | + // TEACHER: "", | |
834 | 843 | y: "top", |
835 | 844 | x: "right", |
836 | 845 | color: "", |
... | ... | @@ -861,7 +870,7 @@ export default { |
861 | 870 | v => v <= 10000000000 || "Max 10 characters is required" |
862 | 871 | ], |
863 | 872 | password: [ |
864 | - v => !!v || "Password field is Required.", | |
873 | + v => !!v || "Password field is Required." | |
865 | 874 | // v => (/^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters lower case symbol required' |
866 | 875 | ], |
867 | 876 | editFatherNoRule: [ |
... | ... | @@ -1033,6 +1042,8 @@ export default { |
1033 | 1042 | }, |
1034 | 1043 | mounted() { |
1035 | 1044 | this.getParentDetails(); |
1045 | + // console.log("role", this.$store.state.role); | |
1046 | + this.role = this.$store.state.role; | |
1036 | 1047 | } |
1037 | 1048 | }; |
1038 | 1049 | </script> |
1039 | 1050 | \ No newline at end of file | ... | ... |
src/pages/Report/admitCard.vue
... | ... | @@ -241,10 +241,10 @@ |
241 | 241 | </thead> |
242 | 242 | <tbody |
243 | 243 | style="border: 1px solid lightgrey !important;"> |
244 | - <tr v-for="(scheduleData,index) in getScheduleListArray"> | |
244 | + <tr v-if="(scheduleData) in getScheduleListArray" slot="items" slot-scope="props"> | |
245 | 245 | <td |
246 | 246 | style="border: 1px soild lightgrey !importand;padding:6px;" |
247 | - >{{ index + 1 }}</td> | |
247 | + >{{ props.index + 1 }}</td> | |
248 | 248 | <td |
249 | 249 | style="border: 1px solid lightgrey !important;padding: 6px;" |
250 | 250 | >{{ scheduleData.date }}</td> | ... | ... |
src/pages/Report/progressCardReport.vue
... | ... | @@ -95,6 +95,7 @@ |
95 | 95 | <v-card |
96 | 96 | v-for="(value, id, index) in filterData" |
97 | 97 | :key="index" |
98 | + :items="newData" | |
98 | 99 | flat |
99 | 100 | style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px" |
100 | 101 | > |
... | ... | @@ -115,8 +116,16 @@ |
115 | 116 | </v-flex> |
116 | 117 | <v-flex xs12 sm12 md12 class="text-xs-center student-data"> |
117 | 118 | <v-avatar size="100"> |
118 | - <img :src="value[0].studentId.profilePicUrl" v-if="value[0].studentId.profilePicUrl" width="100px" /> | |
119 | - <img src="/static/icon/user.png" v-else-if="!value[0].studentId.profilePicUrl" width="100px" /> | |
119 | + <img | |
120 | + :src="value[0].studentId.profilePicUrl" | |
121 | + v-if="value[0].studentId.profilePicUrl" | |
122 | + width="100px" | |
123 | + /> | |
124 | + <img | |
125 | + src="/static/icon/user.png" | |
126 | + v-else-if="!value[0].studentId.profilePicUrl" | |
127 | + width="100px" | |
128 | + /> | |
120 | 129 | </v-avatar> |
121 | 130 | <div class="student-info"> |
122 | 131 | <p |
... | ... | @@ -147,49 +156,49 @@ |
147 | 156 | > |
148 | 157 | <thead style="border: 1px solid lightgrey !important;"> |
149 | 158 | <tr style="border: 1px solid lightgrey !important;padding:4px;"> |
150 | - <td | |
151 | - rowspan="2" | |
152 | - style="border: 1px solid lightgrey !important;padding: 10px;" | |
153 | - >Subject</td> | |
154 | - <td | |
159 | + <td rowspan="2">Subject</td> | |
160 | + <!-- <td | |
155 | 161 | v-for="(exam,i) in value[index].studentsMarks" |
156 | 162 | colspan="2" |
157 | 163 | style="border: 1px solid lightgrey !important;padding: 10px;" |
158 | - >{{ exam.markDistributionId.distributionType }}</td> | |
164 | + >{{ exam.markDistributionId.distributionType }}</td>--> | |
159 | 165 | <!-- <template v-for="studentData in value"> |
160 | 166 | <td |
161 | 167 | colspan="2" |
162 | 168 | v-for="studentMark in studentData.studentsMarks" |
163 | 169 | >{{ studentMark.markDistributionId.distributionType }}</td> |
164 | - </template> --> | |
170 | + </template>--> | |
165 | 171 | <!-- <td>{{value[0].studentsMarks[1].markDistributionId.distributionType}}</td> --> |
166 | 172 | |
167 | - <td style="border: 1px solid lightgrey !important;padding: 10px;">Total Marks</td> | |
173 | + <td | |
174 | + style="border: 1px solid lightgrey !important;padding: 10px;" | |
175 | + >Total Marks</td> | |
168 | 176 | </tr> |
169 | - <tr | |
177 | + <!-- <tr | |
170 | 178 | v-for="(subject, ind) in value" |
171 | 179 | v-if="ind == 0" |
172 | 180 | style="border: 1px solid lightgrey !important;" |
173 | - > | |
174 | - <template v-for="(exam, i) in subject.studentsMarks"> | |
181 | + >--> | |
182 | + --> | |
183 | + <!-- <template v-for="(exam, i) in subject.studentsMarks"> | |
175 | 184 | <td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> |
176 | 185 | <td |
177 | 186 | style="border: 1px solid lightgrey !important;padding: 10px;" |
178 | 187 | >Highest Mark</td> |
179 | - </template> | |
180 | - <!-- <td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> --> | |
181 | - </tr> | |
188 | + </template>--> | |
189 | + <!-- <td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> --> | |
190 | + <!-- </tr> --> | |
182 | 191 | </thead> |
183 | 192 | <tbody style="border: 1px solid lightgrey !important;"> |
184 | - <tr | |
193 | + <!-- <tr | |
185 | 194 | v-for="subject in value" |
186 | 195 | style="border: 1px solid lightgrey !important;" |
187 | - > | |
196 | + >--> | |
188 | 197 | <td style="border: 1px solid lightgrey !important;padding: 10px;"></td> |
189 | - <!-- <td | |
198 | + <!-- <td | |
190 | 199 | style="border: 1px solid lightgrey !important;padding: 10px;" |
191 | - >{{subject.subjectName}}</td> --> | |
192 | - <template v-for="(exam, i) in subject.studentsMarks"> | |
200 | + >{{subject.subjectName}}</td>--> | |
201 | + <!-- <template v-for="(exam, i) in subject.studentsMarks"> | |
193 | 202 | <td |
194 | 203 | style="border: 1px solid lightgrey !important;padding: 10px;" |
195 | 204 | >{{exam.marksScored}}</td> |
... | ... | @@ -200,7 +209,7 @@ |
200 | 209 | <td |
201 | 210 | style="border: 1px solid lightgrey !important;padding: 10px;" |
202 | 211 | >{{subject.totalMarks}}</td> |
203 | - </tr> | |
212 | + </tr>--> | |
204 | 213 | </tbody> |
205 | 214 | <!-- <tfoot> |
206 | 215 | <tr> |
... | ... | @@ -262,7 +271,8 @@ export default { |
262 | 271 | getReport: {}, |
263 | 272 | classList: [], |
264 | 273 | output: null, |
265 | - userData: {} | |
274 | + userData: {}, | |
275 | + newData: [], | |
266 | 276 | }), |
267 | 277 | mounted() { |
268 | 278 | this.token = this.$store.state.token; |
... | ... | @@ -372,12 +382,12 @@ export default { |
372 | 382 | // console.log("err====>", err); |
373 | 383 | this.showLoader = false; |
374 | 384 | this.snackbar = true; |
375 | - this.text = error.response.data.message; | |
376 | - if (error.response.status === 401) { | |
377 | - this.$router.replace({ path: "/" }); | |
378 | - this.$store.dispatch("setToken", null); | |
379 | - this.$store.dispatch("Id", null); | |
380 | - } | |
385 | + // this.text = error.response.data.message; | |
386 | + // if (error.response.status === 401) { | |
387 | + // this.$router.replace({ path: "/" }); | |
388 | + // this.$store.dispatch("setToken", null); | |
389 | + // this.$store.dispatch("Id", null); | |
390 | + // } | |
381 | 391 | }); |
382 | 392 | }, |
383 | 393 | printProgressReport() { | ... | ... |
src/pages/Students/students.vue
... | ... | @@ -823,6 +823,7 @@ |
823 | 823 | <v-icon dark>add</v-icon> |
824 | 824 | </v-btn> |
825 | 825 | <v-btn |
826 | + v-if="role != 'TEACHER' " | |
826 | 827 | round |
827 | 828 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
828 | 829 | dark |
... | ... | @@ -965,7 +966,9 @@ |
965 | 966 | /> |
966 | 967 | <span>View</span> |
967 | 968 | </v-tooltip> |
968 | - <v-tooltip top> | |
969 | + <v-tooltip top | |
970 | + v-if="role != 'TEACHER' " | |
971 | + > | |
969 | 972 | <img |
970 | 973 | slot="activator" |
971 | 974 | style="cursor:pointer; width:20px; height:18px; " |
... | ... | @@ -975,7 +978,9 @@ |
975 | 978 | /> |
976 | 979 | <span>Edit</span> |
977 | 980 | </v-tooltip> |
978 | - <v-tooltip top> | |
981 | + <v-tooltip top | |
982 | + v-if="role != 'TEACHER' " | |
983 | + > | |
979 | 984 | <img |
980 | 985 | slot="activator" |
981 | 986 | style="cursor:pointer; width:20px; height:20px; " |
... | ... | @@ -1890,6 +1895,7 @@ export default { |
1890 | 1895 | snackbar: false, |
1891 | 1896 | y: "top", |
1892 | 1897 | x: "right", |
1898 | + role: "", | |
1893 | 1899 | mode: "", |
1894 | 1900 | append: "", |
1895 | 1901 | timeout: 3000, |
... | ... | @@ -2425,6 +2431,7 @@ export default { |
2425 | 2431 | }, |
2426 | 2432 | mounted() { |
2427 | 2433 | const getCountryList = countryList(); |
2434 | + this.role = this.$store.state.role; | |
2428 | 2435 | this.countries = getCountryList; |
2429 | 2436 | var token = this.$store.state.token; |
2430 | 2437 | http() | ... | ... |
src/pages/Teachers/teachers.vue
... | ... | @@ -468,6 +468,7 @@ |
468 | 468 | <v-icon dark>add</v-icon> |
469 | 469 | </v-btn> |
470 | 470 | <v-btn |
471 | + v-if="role != 'TEACHER' " | |
471 | 472 | round |
472 | 473 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
473 | 474 | dark |
... | ... | @@ -529,7 +530,7 @@ |
529 | 530 | /> |
530 | 531 | <span>View</span> |
531 | 532 | </v-tooltip> |
532 | - <v-tooltip top> | |
533 | + <v-tooltip top v-if="role != 'TEACHER' "> | |
533 | 534 | <img |
534 | 535 | slot="activator" |
535 | 536 | style="cursor:pointer; width:20px; height:18px; " |
... | ... | @@ -539,7 +540,7 @@ |
539 | 540 | /> |
540 | 541 | <span>Edit</span> |
541 | 542 | </v-tooltip> |
542 | - <v-tooltip top> | |
543 | + <v-tooltip top v-if="role != 'TEACHER' "> | |
543 | 544 | <img |
544 | 545 | slot="activator" |
545 | 546 | style="cursor:pointer; width:20px; height:20px; " |
... | ... | @@ -924,6 +925,7 @@ export default { |
924 | 925 | snackbar: false, |
925 | 926 | y: "top", |
926 | 927 | x: "right", |
928 | + role: "", | |
927 | 929 | mode: "", |
928 | 930 | timeout: 3000, |
929 | 931 | text: "", |
... | ... | @@ -1267,6 +1269,7 @@ export default { |
1267 | 1269 | const getCountryList = countryList(); |
1268 | 1270 | this.countries = getCountryList; |
1269 | 1271 | this.getTeacherList(); |
1272 | + this.role = this.$store.state.role; | |
1270 | 1273 | } |
1271 | 1274 | }; |
1272 | 1275 | </script> | ... | ... |
src/pages/User/user.vue
... | ... | @@ -682,7 +682,7 @@ |
682 | 682 | </v-flex> |
683 | 683 | </v-layout> |
684 | 684 | <v-layout wrap> |
685 | - <v-flex xs12 sm6> | |
685 | + <!-- <v-flex xs12 sm6> | |
686 | 686 | <v-layout> |
687 | 687 | <v-flex xs4 class="pt-4 subheading"> |
688 | 688 | <label class="right">Username:</label> |
... | ... | @@ -697,7 +697,7 @@ |
697 | 697 | ></v-text-field> |
698 | 698 | </v-flex> |
699 | 699 | </v-layout> |
700 | - </v-flex> | |
700 | + </v-flex> --> | |
701 | 701 | <v-flex xs12 sm6> |
702 | 702 | <v-layout> |
703 | 703 | <v-flex xs4 class="pt-4 subheading"> | ... | ... |
src/router/paths.js
... | ... | @@ -310,18 +310,48 @@ export default [{ |
310 | 310 | ) |
311 | 311 | }, |
312 | 312 | // { |
313 | - // path: '/AttendenceUser', | |
313 | + // path: '/salaryTemplate', | |
314 | 314 | // meta: {}, |
315 | - // name: 'userAttendence', | |
315 | + // name: 'Salary Template', | |
316 | 316 | // props: (route) => ({ type: route.query.type }), |
317 | 317 | // component: () => |
318 | 318 | // import ( |
319 | - // /* webpackChunkName: "routes" */ | |
320 | - // /* webpackMode: "lazy-once" */ | |
321 | - // `@/pages/Attendence/userAttendence.vue` | |
319 | + // `@/pages/Payroll/salaryTemplate.vue` | |
320 | + // ) | |
321 | + // }, | |
322 | + // { | |
323 | + // path: '/hourlyTemplate', | |
324 | + // meta: {}, | |
325 | + // name: 'Hourly Template', | |
326 | + // props: (route) => ({ type: route.query.type }), | |
327 | + // component: () => | |
328 | + // import ( | |
329 | + // `@/pages/Payroll/hourlyTemplate.vue` | |
330 | + // ) | |
331 | + // }, | |
332 | + // { | |
333 | + // path: '/manageSalary', | |
334 | + // meta: {}, | |
335 | + // name: 'Manage Salary', | |
336 | + // props: (route) => ({ type: route.query.type }), | |
337 | + // component: () => | |
338 | + // import ( | |
339 | + // `@/pages/Payroll/manageSalary.vue` | |
322 | 340 | // ) |
323 | 341 | // }, |
324 | 342 | { |
343 | + path: '/AttendenceUser', | |
344 | + meta: {}, | |
345 | + name: 'User Attendence', | |
346 | + props: (route) => ({ type: route.query.type }), | |
347 | + component: () => | |
348 | + import ( | |
349 | + /* webpackChunkName: "routes" */ | |
350 | + /* webpackMode: "lazy-once" */ | |
351 | + `@/pages/Attendence/userAttendence.vue` | |
352 | + ) | |
353 | + }, | |
354 | + { | |
325 | 355 | path: '/feeTypes', |
326 | 356 | meta: {}, |
327 | 357 | name: 'Fee Types', |
... | ... | @@ -526,6 +556,18 @@ export default [{ |
526 | 556 | ) |
527 | 557 | }, |
528 | 558 | { |
559 | + path: '/examAttendence', | |
560 | + meta: {}, | |
561 | + name: 'Exam Attendence', | |
562 | + props: (route) => ({ type: route.query.type }), | |
563 | + component: () => | |
564 | + import ( | |
565 | + /* webpackChunkName: "routes" */ | |
566 | + /* webpackMode: "lazy-once" */ | |
567 | + `@/pages/Exam/examAttendence.vue` | |
568 | + ) | |
569 | + }, | |
570 | + { | |
529 | 571 | path: '/mark', |
530 | 572 | meta: {}, |
531 | 573 | name: 'Mark', |
... | ... | @@ -689,6 +731,46 @@ export default [{ |
689 | 731 | `@/pages/generalSetting/generalSetting.vue` |
690 | 732 | ) |
691 | 733 | }, |
734 | + { | |
735 | + path: '/assignment', | |
736 | + meta: {}, | |
737 | + name: 'Assignment', | |
738 | + props: (route) => ({ type: route.query.type }), | |
739 | + component: () => | |
740 | + import ( | |
741 | + `@/pages/Academic/assignment.vue` | |
742 | + ) | |
743 | + }, | |
744 | + { | |
745 | + path: '/routine', | |
746 | + meta: {}, | |
747 | + name: 'Routine', | |
748 | + props: (route) => ({ type: route.query.type }), | |
749 | + component: () => | |
750 | + import ( | |
751 | + `@/pages/Academic/routine.vue` | |
752 | + ) | |
753 | + }, | |
754 | + { | |
755 | + path: '/subject', | |
756 | + meta: {}, | |
757 | + name: 'Subject', | |
758 | + props: (route) => ({ type: route.query.type }), | |
759 | + component: () => | |
760 | + import ( | |
761 | + `@/pages/Academic/subject.vue` | |
762 | + ) | |
763 | + }, | |
764 | + { | |
765 | + path: '/syllabus', | |
766 | + meta: {}, | |
767 | + name: 'Syllabus', | |
768 | + props: (route) => ({ type: route.query.type }), | |
769 | + component: () => | |
770 | + import ( | |
771 | + `@/pages/Academic/syllabus.vue` | |
772 | + ) | |
773 | + }, | |
692 | 774 | |
693 | 775 | //////SCHOOL |
694 | 776 | ... | ... |
static/icon/dollar.png
4.5 KB
static/icon/hourly-template.png
6.26 KB
static/icon/make-payment.png
2.66 KB
static/icon/manage-salary.png
6.99 KB
static/icon/salary-template.png
2.31 KB
static/icon/school.png
4.43 KB