Commit e05668b28f8a358d7b5f138ceb7fc77782a6ab96

Authored by Shikha Mishra
1 parent 7014df603e

Clear preavious data while selecting class from drop-down in Exam Attendence and…

… show password in video sharing link
src/pages/Dashboard/LiveOnlineClass.vue
1 <template> 1 <template>
2 <div class="body-color"> 2 <div class="body-color">
3 <!-- LOADER --> 3 <!-- LOADER -->
4 <div class="loader" v-if="showLoader"> 4 <div class="loader" v-if="showLoader">
5 <v-progress-circular indeterminate color="white"></v-progress-circular> 5 <v-progress-circular indeterminate color="white"></v-progress-circular>
6 </div> 6 </div>
7 7
8 <!-- SNACKBAR --> 8 <!-- SNACKBAR -->
9 <v-snackbar 9 <v-snackbar
10 :timeout="timeout" 10 :timeout="timeout"
11 :top="y === 'top'" 11 :top="y === 'top'"
12 :right="x === 'right'" 12 :right="x === 'right'"
13 :vertical="mode === 'vertical'" 13 :vertical="mode === 'vertical'"
14 v-model="snackbar" 14 v-model="snackbar"
15 :color="snackbarColor" 15 :color="snackbarColor"
16 > 16 >
17 {{ text }} 17 {{ text }}
18 <v-spacer></v-spacer> 18 <v-spacer></v-spacer>
19 <v-btn flat text @click="snackbar = false">X</v-btn> 19 <v-btn flat text @click="snackbar = false">X</v-btn>
20 </v-snackbar> 20 </v-snackbar>
21 21
22 <v-container grid-list-xl class="pt-0"> 22 <v-container grid-list-xl class="pt-0">
23 <v-layout row wrap class="mt-1"> 23 <v-layout row wrap class="mt-1">
24 <!-- if logged in user is parent --> 24 <!-- if logged in user is parent -->
25 <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' "> 25 <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' ">
26 <v-layout column> 26 <v-layout column>
27 <!-- HEADING --> 27 <!-- HEADING -->
28 <v-flex> 28 <v-flex>
29 <div 29 <div
30 class="title side-bar-color font-weight-bold" 30 class="title side-bar-color font-weight-bold"
31 >Live Online Classes - {{$route.query.chapterName}}</div> 31 >Live Online Classes - {{$route.query.chapterName}}</div>
32 <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> --> 32 <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> -->
33 <!-- <div 33 <!-- <div
34 class="subheading grey--text lighten-1" 34 class="subheading grey--text lighten-1"
35 >The session started at 1:00 there is 1 moderator</div>--> 35 >The session started at 1:00 there is 1 moderator</div>-->
36 </v-flex> 36 </v-flex>
37 37
38 <!-- JOIN OR END SESSION --> 38 <!-- JOIN OR END SESSION -->
39 <v-flex> 39 <v-flex>
40 <div> 40 <div>
41 <v-btn 41 <v-btn
42 round 42 round
43 class="open-dialog-button" 43 class="open-dialog-button"
44 dark 44 dark
45 v-if="studentBtn" 45 v-if="studentBtn"
46 @click="showLoader = true;startChat();" 46 @click="showLoader = true;startChat();"
47 >{{studentBtn}}</v-btn> 47 >{{studentBtn}}</v-btn>
48 <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span> 48 <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span>
49 </div> 49 </div>
50 </v-flex> 50 </v-flex>
51 <v-flex id="studentClone"> 51 <v-flex id="studentClone">
52 <div id="jitsi-container"></div> 52 <div id="jitsi-container"></div>
53 </v-flex> 53 </v-flex>
54 </v-layout> 54 </v-layout>
55 </v-flex> 55 </v-flex>
56 56
57 <!-- if logged in user is teacher --> 57 <!-- if logged in user is teacher -->
58 <v-flex xs12 sm12 md12 v-else> 58 <v-flex xs12 sm12 md12 v-else>
59 <v-layout column> 59 <v-layout column>
60 <!-- HEADING --> 60 <!-- HEADING -->
61 <v-flex> 61 <v-flex>
62 <div 62 <div
63 class="title side-bar-color font-weight-bold" 63 class="title side-bar-color font-weight-bold"
64 >Live Online Classes - {{$route.query.chapterName}}</div> 64 >Live Online Classes - {{$route.query.chapterName}}</div>
65 <!-- <div class="subheading grey--text lighten-1"></div> --> 65 <!-- <div class="subheading grey--text lighten-1"></div> -->
66 <!-- <div 66 <!-- <div
67 class="subheading grey--text lighten-1" 67 class="subheading grey--text lighten-1"
68 >The session started at 1:00 there is 1 moderator</div>--> 68 >The session started at 1:00 there is 1 moderator</div>-->
69 </v-flex> 69 </v-flex>
70 70
71 <!-- JOIN OR END SESSION --> 71 <!-- JOIN OR END SESSION -->
72 <v-flex> 72 <v-flex>
73 <div> 73 <div>
74 <v-btn 74 <v-btn
75 round 75 round
76 class="open-dialog-button" 76 class="open-dialog-button"
77 dark 77 dark
78 @click="showLoader = true;startChat()" 78 @click="showLoader = true;startChat()"
79 >Start Session</v-btn> 79 >Start Session</v-btn>
80 </div> 80 </div>
81 </v-flex> 81 </v-flex>
82 <v-flex id="teacherClone"> 82 <v-flex id="teacherClone">
83 <div id="jitsi-container"></div> 83 <div id="jitsi-container"></div>
84 </v-flex> 84 </v-flex>
85 </v-layout> 85 </v-layout>
86 </v-flex> 86 </v-flex>
87 87
88 <v-spacer></v-spacer> 88 <v-spacer></v-spacer>
89 89
90 <!-- COURSES SIDE BAR- positioned to the right of the page --> 90 <!-- COURSES SIDE BAR- positioned to the right of the page -->
91 <!-- <v-flex xs3> 91 <!-- <v-flex xs3>
92 <v-card class="elevation-0 card-border" height="100%"> 92 <v-card class="elevation-0 card-border" height="100%">
93 <CoursesSideBar></CoursesSideBar> 93 <CoursesSideBar></CoursesSideBar>
94 </v-card> 94 </v-card>
95 </v-flex>--> 95 </v-flex>-->
96 </v-layout> 96 </v-layout>
97 </v-container> 97 </v-container>
98 </div> 98 </div>
99 </template> 99 </template>
100 <script> 100 <script>
101 import AllApiCalls from "@/Services/AllApiCalls.js"; 101 import AllApiCalls from "@/Services/AllApiCalls.js";
102 import http from "@/Services/http.js"; 102 import http from "@/Services/http.js";
103 import moment from "moment"; 103 import moment from "moment";
104 import Meet from "@/pages/Meet/meet.vue"; 104 import Meet from "@/pages/Meet/meet.vue";
105 import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; 105 import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue";
106 export default { 106 export default {
107 mixins: [AllApiCalls], 107 mixins: [AllApiCalls],
108 components: { 108 components: {
109 CoursesSideBar, 109 CoursesSideBar,
110 }, 110 },
111 data() { 111 data() {
112 return { 112 return {
113 startLiveSession: "", 113 startLiveSession: "",
114 studentBtn: "", 114 studentBtn: "",
115 115
116 // DATA TABLE 116 // DATA TABLE
117 search: "", 117 search: "",
118 pagination: { 118 pagination: {
119 rowsPerPage: 10, 119 rowsPerPage: 10,
120 }, 120 },
121 liveOnlineHeaders: [ 121 liveOnlineHeaders: [
122 { 122 {
123 text: "Playback", 123 text: "Playback",
124 value: "attachementUrl", 124 value: "attachementUrl",
125 sortable: false, 125 sortable: false,
126 align: "center", 126 align: "center",
127 }, 127 },
128 { 128 {
129 text: "Meeting", 129 text: "Meeting",
130 align: "center", 130 align: "center",
131 sortable: false, 131 sortable: false,
132 value: "", 132 value: "",
133 }, 133 },
134 { 134 {
135 text: "Recording", 135 text: "Recording",
136 value: "", 136 value: "",
137 sortable: false, 137 sortable: false,
138 align: "center", 138 align: "center",
139 }, 139 },
140 { 140 {
141 text: "Description Preview", 141 text: "Description Preview",
142 value: "", 142 value: "",
143 sortable: false, 143 sortable: false,
144 align: "center", 144 align: "center",
145 }, 145 },
146 { text: "Date", value: "", sortable: false, align: "center" }, 146 { text: "Date", value: "", sortable: false, align: "center" },
147 { text: "Duration", value: "", sortable: false, align: "center" }, 147 { text: "Duration", value: "", sortable: false, align: "center" },
148 { text: "Toolbar", value: "", sortable: false, align: "center" }, 148 { text: "Toolbar", value: "", sortable: false, align: "center" },
149 ], 149 ],
150 liveOnlineItems: [], 150 liveOnlineItems: [],
151 151
152 // JITSI CONTAINER 152 // JITSI CONTAINER
153 liveLink: "", 153 liveLink: "",
154 livePassword: "",
155 token: "", 154 token: "",
156 selectStudents: {}, 155 selectStudents: {},
157 classRules: [(v) => !!v || " Class Name is required"], 156 classRules: [(v) => !!v || " Class Name is required"],
158 sectionRules: [(v) => !!v || " Section Name is required"], 157 sectionRules: [(v) => !!v || " Section Name is required"],
159 addclass: [], 158 addclass: [],
160 addSection: [], 159 addSection: [],
161 loading: false, 160 loading: false,
162 room: "", 161 room: "",
163 username: "", 162 username: "",
164 roomPassword: "", 163 roomPassword: "",
165 counter: 0, 164 counter: 0,
166 }; 165 };
167 }, 166 },
168 methods: { 167 methods: {
169 async startChat() { 168 async startChat() {
170 if (this.$store.state.role === "PARENT") { 169 if (this.$store.state.role === "PARENT") {
171 if (this.counter == 0) { 170 if (this.counter == 0) {
172 // console.log("enter start chat"); 171 // console.log("enter start chat");
173 this.startConference(); 172 this.startConference();
174 this.counter += 1; 173 this.counter += 1;
175 } 174 }
176 } 175 }
177 if (this.$store.state.role === "TEACHER") { 176 if (this.$store.state.role === "TEACHER") {
178 if (this.counter == 0) { 177 if (this.counter == 0) {
179 this.createRoom(); 178 this.createRoom();
180 this.counter += 1; 179 this.counter += 1;
181 } 180 }
182 } 181 }
183 }, 182 },
184 // JITSI CONTAINER 183 // JITSI CONTAINER
185 startConference() { 184 startConference() {
186 // console.log("yes session started"); 185 // console.log("yes session started");
187 var _this = this; 186 var _this = this;
188 try { 187 try {
189 const domain = "meet.intrack.in"; 188 const domain = "meet.intrack.in";
190 const options = { 189 const options = {
191 audioInput: "<deviceLabel>", 190 audioInput: "<deviceLabel>",
192 audioOutput: "<deviceLabel>", 191 audioOutput: "<deviceLabel>",
193 videoInput: "<deviceLabel>", 192 videoInput: "<deviceLabel>",
194 prejoinPageEnabled: false, 193 prejoinPageEnabled: false,
195 roomName: this.room, 194 roomName: this.room,
196 height: 500, 195 height: 500,
197 parentNode: document.getElementById("jitsi-container"), 196 parentNode: document.getElementById("jitsi-container"),
198 interfaceConfigOverwrite: { 197 interfaceConfigOverwrite: {
199 filmStripOnly: false, 198 filmStripOnly: false,
200 SHOW_PROMOTIONAL_CLOSE_PAGE: false, 199 SHOW_PROMOTIONAL_CLOSE_PAGE: false,
201 SHOW_POWERED_BY: false, 200 SHOW_POWERED_BY: false,
202 SHOW_JITSI_WATERMARK: false, 201 SHOW_JITSI_WATERMARK: false,
203 TOOLBAR_BUTTONS: [ 202 TOOLBAR_BUTTONS: [
204 "microphone", 203 "microphone",
205 "camera", 204 "camera",
206 "closedcaptions", 205 "closedcaptions",
207 "desktop", 206 "desktop",
208 "fullscreen", 207 "fullscreen",
209 "fodeviceselection", 208 "fodeviceselection",
210 "hangup", 209 "hangup",
211 "profile", 210 "profile",
212 "info", 211 "info",
213 "chat", 212 "chat",
214 "recording", 213 "recording",
215 "livestreaming", 214 "livestreaming",
216 "etherpad", 215 "etherpad",
217 "sharedvideo", 216 "sharedvideo",
218 "settings", 217 "settings",
219 "raisehand", 218 "raisehand",
220 "videoquality", 219 "videoquality",
221 "filmstrip", 220 "filmstrip",
222 "invite", 221 "invite",
223 "feedback", 222 "feedback",
224 "stats", 223 "stats",
225 "shortcuts", 224 "shortcuts",
226 "tileview", 225 "tileview",
227 ], 226 ],
228 }, 227 },
229 configOverwrite: { 228 configOverwrite: {
230 disableSimulcast: false, 229 disableSimulcast: false,
231 }, 230 },
232 teacherName: "", 231 teacherName: "",
233 romm: "", 232 room: "",
234 }; 233 };
235 _this.api = new JitsiMeetExternalAPI(domain, options); 234 _this.api = new JitsiMeetExternalAPI(domain, options);
236 // console.log("this.api ", this.api); 235 // console.log("this.api ", this.api);
237 _this.api.addEventListener("videoConferenceJoined", () => { 236 _this.api.addEventListener("videoConferenceJoined", () => {
238 // console.log("Local User Joined");
239 this.showLoader = false; 237 this.showLoader = false;
240 _this.api.executeCommand("displayName", _this.username); 238 setTimeout(() => {
241 _this.api.executeCommand("password", _this.roomPassword); 239 _this.api.executeCommand("displayName", _this.username);
240 _this.api.executeCommand("password", _this.roomPassword);
241 }, 1000);
242 }); 242 });
243 243
244 _this.api.on("readyToClose", () => { 244 _this.api.on("readyToClose", () => {
245 this.$router.push({ name: "Refresh" }); 245 this.$router.push({ name: "Refresh" });
246 }); 246 });
247 } catch (error) { 247 } catch (error) {
248 // console.error("Failed to load Jitsi API", error); 248 // console.error("Failed to load Jitsi API", error);
249 } 249 }
250 }, 250 },
251 openRoom() { 251 openRoom() {
252 // verify the JitsiMeetExternalAPI constructor is added to the global.. 252 // verify the JitsiMeetExternalAPI constructor is added to the global..
253 // if (this.teacherName != "" || this.room != "") { 253 // if (this.teacherName != "" || this.room != "") {
254 // if (window.JitsiMeetExternalAPI) { 254 // if (window.JitsiMeetExternalAPI) {
255 // // var person = prompt("Please enter your name:", "Rabie"); 255 // // var person = prompt("Please enter your name:", "Rabie");
256 // if (person != null || person != "") this.username = this.teacherName; 256 // if (person != null || person != "") this.username = this.teacherName;
257 // var room = prompt("Please enter your room:", "Test Room"); 257 // var room = prompt("Please enter your room:", "Test Room");
258 // if (room != null || room != "") this.room = this.room; 258 // if (room != null || room != "") this.room = this.room;
259 // this.startConference(); 259 // this.startConference();
260 // } else alert("Jitsi Meet API script not loaded"); 260 // } else alert("Jitsi Meet API script not loaded");
261 // } 261 // }
262 }, 262 },
263 263
264 createRoom(classId) { 264 createRoom(classId) {
265 // this.showLoader = true; 265 // this.showLoader = true;
266 var classId = { 266 var classId = {
267 classId: classId, 267 classId: classId,
268 }; 268 };
269 http() 269 http()
270 .post("/createLiveClasses", { 270 .post("/createLiveClasses", {
271 classId: this.$route.query.classId, 271 classId: this.$route.query.classId,
272 courseId: this.$route.query.courseId, 272 courseId: this.$route.query.courseId,
273 chapterId: this.$route.query.chapterId, 273 chapterId: this.$route.query.chapterId,
274 }) 274 })
275 .then((response) => { 275 .then((response) => {
276 // this.addSection = response.data.data; 276 // this.addSection = response.data.data;
277 // console.log("CREATE___ROOOM", response.data); 277 // console.log("CREATE___ROOOM", response.data);
278 var room = response.data.data.roomName; 278 var room = response.data.data.roomName;
279 var username = localStorage.getItem("teacherName"); 279 var username = localStorage.getItem("teacherName");
280 var roomPassword = response.data.data.password; 280 var roomPassword = response.data.data.password;
281 // console.log( 281 // console.log(
282 // "room", 282 // "room",
283 // room, 283 // room,
284 // "username", 284 // "username",
285 // username, 285 // username,
286 // "roomPassword", 286 // "roomPassword",
287 // roomPassword 287 // roomPassword
288 // ); 288 // );
289 var this_ = this; 289 var this_ = this;
290 if (username != "" || room != "") { 290 if (username != "" || room != "") {
291 if (window.JitsiMeetExternalAPI) { 291 if (window.JitsiMeetExternalAPI) {
292 // var person = prompt("Please enter your name:", "Rabie"); 292 // var person = prompt("Please enter your name:", "Rabie");
293 if (username != null || username != "") { 293 if (username != null || username != "") {
294 this_.username = username; 294 this_.username = username;
295 } 295 }
296 // var room = prompt("Please enter your room:", "Test Room"); 296 // var room = prompt("Please enter your room:", "Test Room");
297 if (room != null || room != "") { 297 if (room != null || room != "") {
298 this_.room = room; 298 this_.room = room;
299 } 299 }
300 if (roomPassword != null || roomPassword != "") { 300 if (roomPassword != null || roomPassword != "") {
301 this_.password = roomPassword; 301 this_.password = roomPassword;
302 } 302 }
303 } else alert("Jitsi Meet API script not loaded"); 303 } else alert("Jitsi Meet API script not loaded");
304 this_.startConference(); 304 this_.startConference();
305 } 305 }
306 }) 306 })
307 .catch((err) => { 307 .catch((err) => {
308 this.showLoader = false; 308 this.showLoader = false;
309 }); 309 });
310 }, 310 },
311 async studentClasses() { 311 async studentClasses() {
312 this.liveLink = ""; 312 this.liveLink = "";
313 this.livePassword = "";
314 this.room = ""; 313 this.room = "";
315 this.username = ""; 314 this.username = "";
316 this.roomPassword = ""; 315 this.roomPassword = "";
317 /* getLiveClassesesList - To up date line under heading*/ 316 /* getLiveClassesesList - To up date line under heading*/
318 let response = await this.getLiveClassesesList({ 317 let response = await this.getLiveClassesesList({
319 classId: this.$route.query.classId, 318 classId: this.$route.query.classId,
320 courseId: this.$route.query.courseId, 319 courseId: this.$route.query.courseId,
321 chapterId: this.$route.query.chapterId, 320 chapterId: this.$route.query.chapterId,
322 }); 321 });
323 // console.log("response getLiveClassesesList- ", response); 322 // console.log("response getLiveClassesesList- ", response);
324 323
325 /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */ 324 /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */
326 if (response.data.data[0].sessionStatus == "ENDED") { 325 if (response.data.data[0].sessionStatus == "ENDED") {
327 // this.startLiveSession = "Start Session"; 326 // this.startLiveSession = "Start Session";
328 this.studentBtn = ""; 327 this.studentBtn = "";
329 } 328 }
330 if (response.data.data[0].sessionStatus == "STARTED") { 329 if (response.data.data[0].sessionStatus == "STARTED") {
331 // this.startLiveSession = "Join Session"; 330 // this.startLiveSession = "Join Session";
332 this.studentBtn = "Join Session"; 331 this.studentBtn = "Join Session";
333 } 332 }
334 if (response.data.data.length == 0) { 333 if (response.data.data.length == 0) {
335 this.startLiveSession = "Start Session"; 334 this.startLiveSession = "Start Session";
336 this.studentBtn = ""; 335 this.studentBtn = "";
337 } else { 336 } else {
338 this.liveLink = response.data.data[0].link; 337 this.liveLink = response.data.data[0].link;
339 this.livePassword = response.data.data[0].password;
340 var room = response.data.data[0].roomName; 338 var room = response.data.data[0].roomName;
341 var username = this.currentUser; 339 var username = this.currentUser;
342 var roomPassword = response.data.data[0].password; 340 var roomPassword = response.data.data[0].password;
343 var this_ = this; 341 var this_ = this;
344 // console.log(this.room, this.roomPassword, this.username); 342 // console.log(this.room, this.roomPassword, this.username);
345 // console.log("live session link", this.liveLink);
346 // console.log("live session password", this.livePassword);
347 343
348 if (username != "" || room != "") { 344 if (username != "" || room != "") {
349 if (window.JitsiMeetExternalAPI) { 345 if (window.JitsiMeetExternalAPI) {
350 // var person = prompt("Please enter your name:", "Rabie"); 346 // var person = prompt("Please enter your name:", "Rabie");
351 if (username != null || username != "") { 347 if (username != null || username != "") {
352 this_.username = username; 348 this_.username = username;
353 } 349 }
354 if (roomPassword != null || roomPassword != "") { 350 if (roomPassword != null || roomPassword != "") {
355 this_.roomPassword = roomPassword; 351 this_.roomPassword = roomPassword;
356 } 352 }
357 // var room = prompt("Please enter your room:", "Test Room"); 353 // var room = prompt("Please enter your room:", "Test Room");
358 if (room != null || room != "") { 354 if (room != null || room != "") {
359 this_.room = room; 355 this_.room = room;
360 } 356 }
361 // this.startConference(); 357 // this.startConference();
362 } 358 }
363 } 359 }
364 } 360 }
365 }, 361 },
366 }, 362 },
367 363
368 async created() { 364 async created() {
369 // console.log( 365 // console.log(
370 // "this.$store.state.studentsData", 366 // "this.$store.state.studentsData",
371 // this.$store.state.studentsData[0].name 367 // this.$store.state.studentsData[0].name
372 // ); 368 // );
373 this.currentUser = localStorage.getItem("studentName"); 369 this.currentUser = localStorage.getItem("studentName");
374 this.token = this.$store.state.token; 370 this.token = this.$store.state.token;
375 if (this.$store.state.role === "PARENT") { 371 if (this.$store.state.role === "PARENT") {
376 await this.studentClasses(); 372 await this.studentClasses();
377 } 373 }
378 374
379 /* getStudentCourses - to get courseData - defined in GetApis.js*/ 375 /* getStudentCourses - to get courseData - defined in GetApis.js*/
380 if (this.$store.state.role === "PARENT") { 376 if (this.$store.state.role === "PARENT") {
381 await this.getStudentCourses({ 377 await this.getStudentCourses({
382 classId: localStorage.getItem("parentClassId"), 378 classId: localStorage.getItem("parentClassId"),
383 studentId: localStorage.getItem("parentStudentId"), 379 studentId: localStorage.getItem("parentStudentId"),
384 }); 380 });
385 } 381 }
386 }, 382 },
387 }; 383 };
388 </script> 384 </script>
389 <style scoped> 385 <style scoped>
390 .side-bar-color { 386 .side-bar-color {
391 color: #827bfa !important; 387 color: #827bfa !important;
392 /* border-top-right-radius: 74px !important; */ 388 /* border-top-right-radius: 74px !important; */
393 } 389 }
394 .card-border { 390 .card-border {
395 border: 1px #bdbdbd solid; 391 border: 1px #bdbdbd solid;
396 border-radius: 3px; 392 border-radius: 3px;
397 } 393 }
398 .reply-desc { 394 .reply-desc {
399 border: 1px solid #f2f2f2; 395 border: 1px solid #f2f2f2;
400 } 396 }
401 .open-dialog-button { 397 .open-dialog-button {
402 background: #827bfa !important; 398 background: #827bfa !important;
403 border-color: #827bfa !important; 399 border-color: #827bfa !important;
404 text-transform: none !important; 400 text-transform: none !important;
405 } 401 }
406 402
407 .reply-btn { 403 .reply-btn {
408 background: #feb83c !important; 404 background: #feb83c !important;
409 border-color: #feb83c !important; 405 border-color: #feb83c !important;
410 text-transform: none !important; 406 text-transform: none !important;
411 -webkit-box-shadow: none !important; 407 -webkit-box-shadow: none !important;
412 box-shadow: none !important; 408 box-shadow: none !important;
413 } 409 }
414 #jitsi-container { 410 #jitsi-container {
415 height: 100vh; 411 height: 100vh;
src/pages/Dashboard/dashboard.vue
1 <template> 1 <template>
2 <v-app id="pages-dasboard"> 2 <v-app id="pages-dasboard">
3 <!-- ****** VIEW PROFIL NOTICE BOARD ****** --> 3 <!-- ****** VIEW PROFIL NOTICE BOARD ****** -->
4 <!-- <v-dialog v-model="dialogNotice" max-width="940px" scrollable> 4 <!-- <v-dialog v-model="dialogNotice" max-width="940px" scrollable>
5 <v-card> 5 <v-card>
6 <v-toolbar color="grey lighten-2" flat> 6 <v-toolbar color="grey lighten-2" flat>
7 <v-spacer></v-spacer> 7 <v-spacer></v-spacer>
8 <v-toolbar-title> 8 <v-toolbar-title>
9 <h3>Notice Board</h3> 9 <h3>Notice Board</h3>
10 </v-toolbar-title> 10 </v-toolbar-title>
11 <v-spacer></v-spacer> 11 <v-spacer></v-spacer>
12 <v-icon @click="closeNotice">close</v-icon> 12 <v-icon @click="closeNotice">close</v-icon>
13 </v-toolbar> 13 </v-toolbar>
14 <v-card-text> 14 <v-card-text>
15 <v-layout> 15 <v-layout>
16 <v-flex align-center justify-center layout text-xs-center class="mt-2"> 16 <v-flex align-center justify-center layout text-xs-center class="mt-2">
17 <img src="/static/icon/user.png" width="70px" v-if="!notice.eventImageUrl" /> 17 <img src="/static/icon/user.png" width="70px" v-if="!notice.eventImageUrl" />
18 <img :src="notice.eventImageUrl" width="280px" v-else-if="notice.eventImageUrl" /> 18 <img :src="notice.eventImageUrl" width="280px" v-else-if="notice.eventImageUrl" />
19 </v-flex> 19 </v-flex>
20 </v-layout> 20 </v-layout>
21 <v-container grid-list-md> 21 <v-container grid-list-md>
22 <v-layout wrap> 22 <v-layout wrap>
23 <v-flex> 23 <v-flex>
24 <v-layout> 24 <v-layout>
25 <v-flex xs5 sm6> 25 <v-flex xs5 sm6>
26 <h5 class="right my-1"> 26 <h5 class="right my-1">
27 <b>Title:</b> 27 <b>Title:</b>
28 </h5> 28 </h5>
29 </v-flex> 29 </v-flex>
30 <v-flex sm6 xs8> 30 <v-flex sm6 xs8>
31 <h5 class="my-1">{{ notice.title }}</h5> 31 <h5 class="my-1">{{ notice.title }}</h5>
32 </v-flex> 32 </v-flex>
33 </v-layout> 33 </v-layout>
34 <v-layout> 34 <v-layout>
35 <v-flex xs5 sm6> 35 <v-flex xs5 sm6>
36 <h5 class="right my-1"> 36 <h5 class="right my-1">
37 <b>Description:</b> 37 <b>Description:</b>
38 </h5> 38 </h5>
39 </v-flex> 39 </v-flex>
40 <v-flex sm6 xs8> 40 <v-flex sm6 xs8>
41 <h5 class="my-1">{{ notice.description }}</h5> 41 <h5 class="my-1">{{ notice.description }}</h5>
42 </v-flex> 42 </v-flex>
43 </v-layout> 43 </v-layout>
44 </v-flex> 44 </v-flex>
45 </v-layout> 45 </v-layout>
46 </v-container> 46 </v-container>
47 </v-card-text> 47 </v-card-text>
48 </v-card> 48 </v-card>
49 </v-dialog>--> 49 </v-dialog>-->
50 <!-- <v-container fluid grid-list-xl> --> 50 <!-- <v-container fluid grid-list-xl> -->
51 51
52 <!-- LOADER --> 52 <!-- LOADER -->
53 <div class="loader" v-if="showLoader"> 53 <div class="loader" v-if="showLoader">
54 <v-progress-circular indeterminate color="white"></v-progress-circular> 54 <v-progress-circular indeterminate color="white"></v-progress-circular>
55 </div> 55 </div>
56 56
57 <!-- SNACKBAR --> 57 <!-- SNACKBAR -->
58 <v-snackbar 58 <v-snackbar
59 :timeout="timeout" 59 :timeout="timeout"
60 :top="y === 'top'" 60 :top="y === 'top'"
61 :right="x === 'right'" 61 :right="x === 'right'"
62 :vertical="mode === 'vertical'" 62 :vertical="mode === 'vertical'"
63 v-model="snackbar" 63 v-model="snackbar"
64 :color="snackbarColor" 64 :color="snackbarColor"
65 > 65 >
66 {{ text }} 66 {{ text }}
67 <v-spacer></v-spacer> 67 <v-spacer></v-spacer>
68 <v-btn flat text @click="snackbar = false">X</v-btn> 68 <v-btn flat text @click="snackbar = false">X</v-btn>
69 </v-snackbar> 69 </v-snackbar>
70 70
71 <!-- DIALOG BOX EVENT DETAILS --> 71 <!-- DIALOG BOX EVENT DETAILS -->
72 <v-dialog v-model="viewEventDetails" max-width="500" persistent lazy> 72 <v-dialog v-model="viewEventDetails" max-width="500" persistent lazy>
73 <v-card flat class="card-style elevation-0" height="600" dark> 73 <v-card flat class="card-style elevation-0" height="600" dark>
74 <v-layout> 74 <v-layout>
75 <v-flex xs12> 75 <v-flex xs12>
76 <v-icon 76 <v-icon
77 size="24" 77 size="24"
78 class="right" 78 class="right"
79 @click="active=0;displayEventsList=[];dialogSchoolEvents = [];dialogMeetingEvents=[];viewEventDetails = false" 79 @click="active=0;displayEventsList=[];dialogSchoolEvents = [];dialogMeetingEvents=[];viewEventDetails = false"
80 >cancel</v-icon> 80 >cancel</v-icon>
81 </v-flex> 81 </v-flex>
82 </v-layout> 82 </v-layout>
83 <v-tabs v-model="active" color="#7f62f8" dark v-if="displayEventsList.length == 0"> 83 <v-tabs v-model="active" color="#7f62f8" dark v-if="displayEventsList.length == 0">
84 <v-tabs-slider color="yellow"></v-tabs-slider> 84 <v-tabs-slider color="yellow"></v-tabs-slider>
85 <v-tab v-for="(tab,index) in tabs" :key="index"> 85 <v-tab v-for="(tab,index) in tabs" :key="index">
86 <div class="subheading py-1">{{ tab.name }}</div> 86 <div class="subheading py-1">{{ tab.name }}</div>
87 </v-tab> 87 </v-tab>
88 <!-- <v-tab href="#schoolTab" v-if="dialogSchoolEvents.length > 0">School Events</v-tab> 88 <!-- <v-tab href="#schoolTab" v-if="dialogSchoolEvents.length > 0">School Events</v-tab>
89 <v-tab href="#meetingTab" v-if="dialogMeetingEvents.length > 0">Meeting Events</v-tab>--> 89 <v-tab href="#meetingTab" v-if="dialogMeetingEvents.length > 0">Meeting Events</v-tab>-->
90 90
91 <!-- SCHOOL EVENTS--> 91 <!-- SCHOOL EVENTS-->
92 <v-tab-item> 92 <v-tab-item>
93 <v-card flat class="card-style pa-2" dark v-if="dialogSchoolEvents.length > 0"> 93 <v-card flat class="card-style pa-2" dark v-if="dialogSchoolEvents.length > 0">
94 <v-container fluid> 94 <v-container fluid>
95 <v-divider class="white"></v-divider> 95 <v-divider class="white"></v-divider>
96 <v-card 96 <v-card
97 v-for="(particularEvent,index) in dialogSchoolEvents" 97 v-for="(particularEvent,index) in dialogSchoolEvents"
98 :key="index" 98 :key="index"
99 class="mt-3 pa-2 card-style white--text elevation-0" 99 class="mt-3 pa-2 card-style white--text elevation-0"
100 > 100 >
101 <div> 101 <div>
102 <div class="headline">{{particularEvent.title}}</div> 102 <div class="headline">{{particularEvent.title}}</div>
103 <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> 103 <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
104 <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div> 104 <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div>
105 <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div> 105 <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div>
106 <div v-if="particularEvent.link"> 106 <div v-if="particularEvent.link">
107 Link : 107 Link :
108 <a :href="particularEvent.link">{{particularEvent.link}}</a> 108 <a :href="particularEvent.link">{{particularEvent.link}}</a>
109 </div> 109 </div>
110 <div 110 <div
111 v-if="particularEvent.description" 111 v-if="particularEvent.description"
112 >Description : {{particularEvent.description}}</div> 112 >Description : {{particularEvent.description}}</div>
113 </div> 113 </div>
114 <v-divider class="white mt-3"></v-divider> 114 <v-divider class="white mt-3"></v-divider>
115 </v-card> 115 </v-card>
116 </v-container> 116 </v-container>
117 </v-card> 117 </v-card>
118 </v-tab-item> 118 </v-tab-item>
119 119
120 <!-- MEETING EVENTS --> 120 <!-- MEETING EVENTS -->
121 <v-tab-item> 121 <v-tab-item>
122 <v-card v-if="dialogMeetingEvents.length > 0" flat class="card-style pa-2" dark> 122 <v-card v-if="dialogMeetingEvents.length > 0" flat class="card-style pa-2" dark>
123 <v-container fluid> 123 <v-container fluid>
124 <v-divider class="white"></v-divider> 124 <v-divider class="white"></v-divider>
125 <v-card 125 <v-card
126 v-for="(particularEvent,index) in dialogMeetingEvents" 126 v-for="(particularEvent,index) in dialogMeetingEvents"
127 :key="index" 127 :key="index"
128 class="mt-3 pa-2 card-style white--text elevation-0" 128 class="mt-3 pa-2 card-style white--text elevation-0"
129 > 129 >
130 <div> 130 <div>
131 <div class="headline">{{particularEvent.title}}</div> 131 <div class="headline">{{particularEvent.title}}</div>
132 <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> 132 <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
133 <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div> 133 <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div>
134 <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div> 134 <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div>
135 <div v-if="particularEvent.link"> 135 <div v-if="particularEvent.link">
136 Link : 136 Link :
137 <a :href="particularEvent.link">{{particularEvent.link}}</a> 137 <a :href="particularEvent.link">{{particularEvent.link}}</a>
138 </div> 138 </div>
139 <div 139 <div
140 v-if="particularEvent.description" 140 v-if="particularEvent.description"
141 >Description : {{particularEvent.description}}</div> 141 >Description : {{particularEvent.description}}</div>
142 </div> 142 </div>
143 <v-divider class="white mt-3"></v-divider> 143 <v-divider class="white mt-3"></v-divider>
144 </v-card> 144 </v-card>
145 </v-container> 145 </v-container>
146 </v-card> 146 </v-card>
147 </v-tab-item> 147 </v-tab-item>
148 </v-tabs> 148 </v-tabs>
149 149
150 <!-- IF NO MULTIPLE EVENTS ON SAME DATE --> 150 <!-- IF NO MULTIPLE EVENTS ON SAME DATE -->
151 <v-card flat class="card-style pa-2 elevation-0" dark v-else> 151 <v-card flat class="card-style pa-2 elevation-0" dark v-else>
152 <v-container fluid> 152 <v-container fluid>
153 <v-divider class="white"></v-divider> 153 <v-divider class="white"></v-divider>
154 <v-card 154 <v-card
155 v-for="(particularEvent,index) in displayEventsList" 155 v-for="(particularEvent,index) in displayEventsList"
156 :key="index" 156 :key="index"
157 class="mt-3 pa-2 card-style white--text elevation-0" 157 class="mt-3 pa-2 card-style white--text elevation-0"
158 > 158 >
159 <div> 159 <div>
160 <div class="headline">{{particularEvent.title}}</div> 160 <div class="headline">{{particularEvent.title}}</div>
161 <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> 161 <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
162 <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div> 162 <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div>
163 <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div> 163 <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div>
164 <div v-if="particularEvent.link"> 164 <div v-if="particularEvent.link">
165 Link : 165 Link :
166 <a :href="particularEvent.link">{{particularEvent.link}}</a> 166 <a :href="particularEvent.link">{{particularEvent.link}}</a>
167 </div> 167 </div>
168 <div 168 <div
169 v-if="particularEvent.description" 169 v-if="particularEvent.description"
170 >Description : {{particularEvent.description}}</div> 170 >Description : {{particularEvent.description}}</div>
171 </div> 171 </div>
172 <v-divider class="white mt-3"></v-divider> 172 <v-divider class="white mt-3"></v-divider>
173 </v-card> 173 </v-card>
174 </v-container> 174 </v-container>
175 </v-card> 175 </v-card>
176 </v-card> 176 </v-card>
177 </v-dialog> 177 </v-dialog>
178 178
179 <v-layout wrap row> 179 <v-layout wrap row>
180 <v-flex xs12 sm12 md8> 180 <v-flex xs12 sm12 md8>
181 <v-container fluid grid-list-xl> 181 <v-container fluid grid-list-xl>
182 <!-- ***** Total Students ***** --> 182 <!-- ***** Total Students ***** -->
183 <v-layout wrap class v-if="$store.state.role != 'PARENT' "> 183 <v-layout wrap class v-if="$store.state.role != 'PARENT' ">
184 <v-flex xs12 sm12 md3> 184 <v-flex xs12 sm12 md3>
185 <router-link :to="{ name:'Students' }"> 185 <router-link :to="{ name:'Students' }">
186 <v-card class="card pink-bgcolor"> 186 <v-card class="card pink-bgcolor">
187 <v-card-title primary-title class="titleCard white--text py-3">Students</v-card-title> 187 <v-card-title primary-title class="titleCard white--text py-3">Students</v-card-title>
188 <img src="/static/icon/student.png" class="ml-2" width="40" alt="icons" /> 188 <img src="/static/icon/student.png" class="ml-2" width="40" alt="icons" />
189 <v-card-title class="headline py-1 white--text">{{ students.length }}</v-card-title> 189 <v-card-title class="headline py-1 white--text">{{ students.length }}</v-card-title>
190 </v-card> 190 </v-card>
191 </router-link> 191 </router-link>
192 </v-flex> 192 </v-flex>
193 <!-- ***** Total Teachers***** --> 193 <!-- ***** Total Teachers***** -->
194 <v-flex xs12 sm12 md3> 194 <v-flex xs12 sm12 md3>
195 <router-link :to="{ name:'Teachers' }"> 195 <router-link :to="{ name:'Teachers' }">
196 <v-card flat class="card elevation-2 firozi-bgcolor"> 196 <v-card flat class="card elevation-2 firozi-bgcolor">
197 <v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title> 197 <v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title>
198 <img src="/static/icon/teacher.png" class="ml-2" width="40" alt="icons" /> 198 <img src="/static/icon/teacher.png" class="ml-2" width="40" alt="icons" />
199 199
200 <v-card-title class="headline py-1 white--text">{{ teachers.length }}</v-card-title> 200 <v-card-title class="headline py-1 white--text">{{ teachers.length }}</v-card-title>
201 </v-card> 201 </v-card>
202 </router-link> 202 </router-link>
203 </v-flex> 203 </v-flex>
204 <!-- ***** Total Parents ***** --> 204 <!-- ***** Total Parents ***** -->
205 <v-flex xs12 sm12 md3> 205 <v-flex xs12 sm12 md3>
206 <router-link :to="{ name:'Parents' }"> 206 <router-link :to="{ name:'Parents' }">
207 <v-card flat class="card yellow darken-3"> 207 <v-card flat class="card yellow darken-3">
208 <v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title> 208 <v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title>
209 <img src="/static/icon/parents.png" class="ml-3" width="40px" alt="icons" /> 209 <img src="/static/icon/parents.png" class="ml-3" width="40px" alt="icons" />
210 <v-card-title class="headline py-1 white--text">{{ parents.length }}</v-card-title> 210 <v-card-title class="headline py-1 white--text">{{ parents.length }}</v-card-title>
211 </v-card> 211 </v-card>
212 </router-link> 212 </router-link>
213 </v-flex> 213 </v-flex>
214 <!-- ***** Total Class***** --> 214 <!-- ***** Total Class***** -->
215 <v-flex xs12 sm12 md3> 215 <v-flex xs12 sm12 md3>
216 <router-link :to="{ name:'Class' }"> 216 <router-link :to="{ name:'Class' }">
217 <v-card flat class="card darkBlue-bgcolor"> 217 <v-card flat class="card darkBlue-bgcolor">
218 <v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title> 218 <v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title>
219 <img src="/static/icon/class.png" width="40" alt="icons" class="ml-2" /> 219 <img src="/static/icon/class.png" width="40" alt="icons" class="ml-2" />
220 <v-card-title class="headline py-1 white--text">{{ classes.length }}</v-card-title> 220 <v-card-title class="headline py-1 white--text">{{ classes.length }}</v-card-title>
221 </v-card> 221 </v-card>
222 </router-link> 222 </router-link>
223 </v-flex> 223 </v-flex>
224 </v-layout> 224 </v-layout>
225 225
226 <p 226 <p
227 v-if="studentsData.length === 0 && role == 'PARENT'" 227 v-if="studentsData.length === 0 && role == 'PARENT'"
228 class="text-center title grey lighten-4 error--text" 228 class="text-center title grey lighten-4 error--text"
229 >You have no student registered with school</p> 229 >You have no student registered with school</p>
230 <!-- ACCOUNT --> 230 <!-- ACCOUNT -->
231 <v-layout v-if="role == 'SUPERADMIN'|| role == 'ADMIN'"> 231 <v-layout v-if="role == 'SUPERADMIN'|| role == 'ADMIN'">
232 <v-flex xs12> 232 <v-flex xs12>
233 <v-card class="card mt-2 account-Card"> 233 <v-card class="card mt-2 account-Card">
234 <h4> 234 <h4>
235 <b>Account</b> 235 <b>Account</b>
236 </h4> 236 </h4>
237 <v-layout wrap> 237 <v-layout wrap>
238 <v-flex xs12 sm12 md3> 238 <v-flex xs12 sm12 md3>
239 <v-list two-line> 239 <v-list two-line>
240 <template> 240 <template>
241 <v-list-tile> 241 <v-list-tile>
242 <v-list-tile-avatar> 242 <v-list-tile-avatar>
243 <v-icon class="account-circle darkBlue-color">panorama_fish_eye</v-icon> 243 <v-icon class="account-circle darkBlue-color">panorama_fish_eye</v-icon>
244 </v-list-tile-avatar> 244 </v-list-tile-avatar>
245 <v-list-tile-content> 245 <v-list-tile-content>
246 <v-list-tile-title class="mt-2"> 246 <v-list-tile-title class="mt-2">
247 <p class="subheading font-color">Fees</p> 247 <p class="subheading font-color">Fees</p>
248 </v-list-tile-title> 248 </v-list-tile-title>
249 <v-list-tile-title>Rs. {{ feeData.totalFees }}</v-list-tile-title> 249 <v-list-tile-title>Rs. {{ feeData.totalFees }}</v-list-tile-title>
250 </v-list-tile-content> 250 </v-list-tile-content>
251 </v-list-tile> 251 </v-list-tile>
252 <v-list-tile> 252 <v-list-tile>
253 <v-list-tile-avatar> 253 <v-list-tile-avatar>
254 <v-icon class="account-circle yellowDark-color">panorama_fish_eye</v-icon> 254 <v-icon class="account-circle yellowDark-color">panorama_fish_eye</v-icon>
255 </v-list-tile-avatar> 255 </v-list-tile-avatar>
256 <v-list-tile-content> 256 <v-list-tile-content>
257 <v-list-tile-title class="mt-2"> 257 <v-list-tile-title class="mt-2">
258 <p class="subheading font-color">Collection</p> 258 <p class="subheading font-color">Collection</p>
259 </v-list-tile-title> 259 </v-list-tile-title>
260 <v-list-tile-title>Rs. {{ feeData.totalCollection }}</v-list-tile-title> 260 <v-list-tile-title>Rs. {{ feeData.totalCollection }}</v-list-tile-title>
261 </v-list-tile-content> 261 </v-list-tile-content>
262 </v-list-tile> 262 </v-list-tile>
263 <v-list-tile> 263 <v-list-tile>
264 <v-list-tile-avatar> 264 <v-list-tile-avatar>
265 <v-icon class="account-circle pink-color">panorama_fish_eye</v-icon> 265 <v-icon class="account-circle pink-color">panorama_fish_eye</v-icon>
266 </v-list-tile-avatar> 266 </v-list-tile-avatar>
267 <v-list-tile-content> 267 <v-list-tile-content>
268 <v-list-tile-title class="mt-2"> 268 <v-list-tile-title class="mt-2">
269 <p class="subheading font-color">Expences</p> 269 <p class="subheading font-color">Expences</p>
270 </v-list-tile-title> 270 </v-list-tile-title>
271 <v-list-tile-title>Rs. {{ expenseData.sum }}</v-list-tile-title> 271 <v-list-tile-title>Rs. {{ expenseData.sum }}</v-list-tile-title>
272 </v-list-tile-content> 272 </v-list-tile-content>
273 </v-list-tile> 273 </v-list-tile>
274 </template> 274 </template>
275 </v-list> 275 </v-list>
276 </v-flex> 276 </v-flex>
277 <v-flex xs12 sm12 md9 lg9> 277 <v-flex xs12 sm12 md9 lg9>
278 <div id="chart"> 278 <div id="chart">
279 <div v-if="showChart"> 279 <div v-if="showChart">
280 <apexchart 280 <apexchart
281 type="bar" 281 type="bar"
282 height="250" 282 height="250"
283 style="max-width: 800px !important" 283 style="max-width: 800px !important"
284 :options="chartOptions" 284 :options="chartOptions"
285 :series="series" 285 :series="series"
286 ></apexchart> 286 ></apexchart>
287 </div> 287 </div>
288 </div> 288 </div>
289 </v-flex> 289 </v-flex>
290 </v-layout> 290 </v-layout>
291 </v-card> 291 </v-card>
292 </v-flex> 292 </v-flex>
293 </v-layout> 293 </v-layout>
294 294
295 <!-- FOR ADMIN,TEACHER ROLE --> 295 <!-- FOR ADMIN,TEACHER ROLE -->
296 <v-layout row wrap v-if="role == 'ADMIN'||role == 'TEACHER'"> 296 <v-layout row wrap v-if="role == 'ADMIN'||role == 'TEACHER'">
297 <!-- NOTICE --> 297 <!-- NOTICE -->
298 <v-flex xs12 sm6> 298 <v-flex xs12 sm6>
299 <v-card class="card"> 299 <v-card class="card">
300 <v-container> 300 <v-container>
301 <v-card-title class="justify-center subheading font-weight-bold">Notice</v-card-title> 301 <v-card-title class="justify-center subheading font-weight-bold">Notice</v-card-title>
302 302
303 <v-data-table 303 <v-data-table
304 :items="noticeData" 304 :items="noticeData"
305 class="elevation-0" 305 class="elevation-0"
306 flat 306 flat
307 hide-actions 307 hide-actions
308 hide-headers 308 hide-headers
309 style="border-spacing: 0 !important;" 309 style="border-spacing: 0 !important;"
310 > 310 >
311 <template 311 <template
312 slot="items" 312 slot="items"
313 slot-scope="props" 313 slot-scope="props"
314 v-if="props.index < 5" 314 v-if="props.index < 5"
315 style="border-spacing: 0 !important;" 315 style="border-spacing: 0 !important;"
316 > 316 >
317 <tr class="td-notice"> 317 <tr class="td-notice">
318 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td> 318 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
319 <td> 319 <td>
320 <span class="grey--text caption">{{ date(props.item.created) }}</span> 320 <span class="grey--text caption">{{ date(props.item.created) }}</span>
321 <br /> 321 <br />
322 <span class="body-2">{{ props.item.title}}</span> 322 <span class="body-2">{{ props.item.title}}</span>
323 </td> 323 </td>
324 <!-- <td class="grey--text mt-2" >{{ props.item.description}}</td> --> 324 <!-- <td class="grey--text mt-2" >{{ props.item.description}}</td> -->
325 325
326 <td class="text-xs-center"> 326 <td class="text-xs-center">
327 <span> 327 <span>
328 <v-tooltip top> 328 <v-tooltip top>
329 <img 329 <img
330 slot="activator" 330 slot="activator"
331 style="cursor:pointer; width:25px; height:25px; " 331 style="cursor:pointer; width:25px; height:25px; "
332 @click="profile" 332 @click="profile"
333 src="/static/icon/view.png" 333 src="/static/icon/view.png"
334 /> 334 />
335 <span>View</span> 335 <span>View</span>
336 </v-tooltip> 336 </v-tooltip>
337 </span> 337 </span>
338 </td> 338 </td>
339 </tr> 339 </tr>
340 </template> 340 </template>
341 </v-data-table> 341 </v-data-table>
342 </v-container> 342 </v-container>
343 </v-card> 343 </v-card>
344 </v-flex> 344 </v-flex>
345 345
346 <!-- SCHOOL EVENTS --> 346 <!-- SCHOOL EVENTS -->
347 347
348 <v-flex xs12 sm6> 348 <v-flex xs12 sm6>
349 <v-card class="card"> 349 <v-card class="card">
350 <v-container> 350 <v-container>
351 <v-card-title class="justify-center subheading font-weight-bold">School Events</v-card-title> 351 <v-card-title class="justify-center subheading font-weight-bold">School Events</v-card-title>
352 <div 352 <div
353 v-for="(schoolEvent,index) in schoolEvents" 353 v-for="(schoolEvent,index) in schoolEvents"
354 :key="schoolEvent.title" 354 :key="schoolEvent.title"
355 class="mt-2" 355 class="mt-2"
356 style="cursor: pointer;" 356 style="cursor: pointer;"
357 @click="seeEventDetails(schoolEvent,'schoolEvent')" 357 @click="seeEventDetails(schoolEvent,'schoolEvent')"
358 > 358 >
359 <!-- color dot--> 359 <!-- color dot-->
360 <span 360 <span
361 :style="{ 'background-color': colorsArray[index%colorsArray.length] }" 361 :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
362 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" 362 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
363 ></span> 363 ></span>
364 <div style="display: inline-block;" class="ml-2"> 364 <div style="display: inline-block;" class="ml-2">
365 <div> 365 <div>
366 <!-- date of event --> 366 <!-- date of event -->
367 <div 367 <div
368 class="grey--text lighten-1 caption" 368 class="grey--text lighten-1 caption"
369 v-if="schoolEvent.dateOfEvent" 369 v-if="schoolEvent.dateOfEvent"
370 >{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> 370 >{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
371 <!-- event title--> 371 <!-- event title-->
372 <div class="body-1" v-if="schoolEvent.title">{{schoolEvent.title}}</div> 372 <div class="body-1" v-if="schoolEvent.title">{{schoolEvent.title}}</div>
373 </div> 373 </div>
374 </div> 374 </div>
375 </div> 375 </div>
376 <div v-if="schoolEvents.length == 0"> 376 <div v-if="schoolEvents.length == 0">
377 <p class="text-center title grey lighten-4 error--text">No Data Found!</p> 377 <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
378 </div> 378 </div>
379 </v-container> 379 </v-container>
380 </v-card> 380 </v-card>
381 </v-flex> 381 </v-flex>
382 </v-layout> 382 </v-layout>
383 383
384 <!-- FOR TEACHER ROLE --> 384 <!-- FOR TEACHER ROLE -->
385 <!-- <v-card class="mt-2 card" v-if="role == 'TEACHER'"> 385 <!-- <v-card class="mt-2 card" v-if="role == 'TEACHER'">
386 <v-layout> 386 <v-layout>
387 <v-flex xs6 sm6 md6> 387 <v-flex xs6 sm6 md6>
388 <h4 class="pa-3"> 388 <h4 class="pa-3">
389 <b>Notice</b> 389 <b>Notice</b>
390 </h4> 390 </h4>
391 <v-data-table 391 <v-data-table
392 :items="noticeData" 392 :items="noticeData"
393 class="elevation-0" 393 class="elevation-0"
394 flat 394 flat
395 hide-actions 395 hide-actions
396 hide-headers 396 hide-headers
397 style="border-spacing: 0 !important;" 397 style="border-spacing: 0 !important;"
398 > 398 >
399 <template 399 <template
400 slot="items" 400 slot="items"
401 slot-scope="props" 401 slot-scope="props"
402 v-if="props.index < 5" 402 v-if="props.index < 5"
403 style="border-spacing: 0 !important;" 403 style="border-spacing: 0 !important;"
404 > 404 >
405 <tr class="td-notice"> 405 <tr class="td-notice">
406 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td> 406 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
407 <td> 407 <td>
408 <span class="grey--text caption">{{ date(props.item.created) }}</span> 408 <span class="grey--text caption">{{ date(props.item.created) }}</span>
409 <br /> 409 <br />
410 <span class="body-2">{{ props.item.title}}</span> 410 <span class="body-2">{{ props.item.title}}</span>
411 </td> 411 </td>
412 <td class="grey--text mt-2">{{ props.item.description}}</td> 412 <td class="grey--text mt-2">{{ props.item.description}}</td>
413 413
414 <td class="text-xs-center"> 414 <td class="text-xs-center">
415 <span> 415 <span>
416 <v-tooltip top> 416 <v-tooltip top>
417 <img 417 <img
418 slot="activator" 418 slot="activator"
419 style="cursor:pointer; width:25px; height:25px; " 419 style="cursor:pointer; width:25px; height:25px; "
420 @click="profile" 420 @click="profile"
421 src="/static/icon/view.png" 421 src="/static/icon/view.png"
422 /> 422 />
423 <span>View</span> 423 <span>View</span>
424 </v-tooltip> 424 </v-tooltip>
425 </span> 425 </span>
426 </td> 426 </td>
427 </tr> 427 </tr>
428 </template> 428 </template>
429 </v-data-table> 429 </v-data-table>
430 </v-flex> 430 </v-flex>
431 431
432 <v-flex xs6 sm6 md6> 432 <v-flex xs6 sm6 md6>
433 <v-card-text> 433 <v-card-text>
434 <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title> 434 <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title>
435 <div 435 <div
436 v-for="(activity,index) in activityList" 436 v-for="(activity,index) in activityList"
437 :key="index" 437 :key="index"
438 class="mt-2" 438 class="mt-2"
439 style="cursor: pointer;" 439 style="cursor: pointer;"
440 @click="seeEventDetails(activity)" 440 @click="seeEventDetails(activity)"
441 > 441 >
442 <span 442 <span
443 :style="{ 'background-color': colorsArray[index%colorsArray.length] }" 443 :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
444 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" 444 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
445 ></span> 445 ></span>
446 <div style="display: inline-block;" class="ml-2"> 446 <div style="display: inline-block;" class="ml-2">
447 <div> 447 <div>
448 <div 448 <div
449 class="grey--text lighten-1 caption" 449 class="grey--text lighten-1 caption"
450 v-if="activity.dateOfEvent" 450 v-if="activity.dateOfEvent"
451 >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div> 451 >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
452 <div class="body-2" v-if="activity.title">{{activity.title}}</div> 452 <div class="body-2" v-if="activity.title">{{activity.title}}</div>
453 </div> 453 </div>
454 </div> 454 </div>
455 </div> 455 </div>
456 <div v-if="activityList.length == 0"> 456 <div v-if="activityList.length == 0">
457 <p class="text-center title grey lighten-4 error--text">No Data Found!</p> 457 <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
458 </div> 458 </div>
459 </v-card-text> 459 </v-card-text>
460 </v-flex> 460 </v-flex>
461 </v-layout> 461 </v-layout>
462 </v-card>--> 462 </v-card>-->
463 463
464 <!-- ROLE == PARENT, MY COURSES --> 464 <!-- ROLE == PARENT, MY COURSES -->
465 <v-layout v-if="role == 'PARENT'"> 465 <v-layout v-if="role == 'PARENT'">
466 <v-flex xs12> 466 <v-flex xs12>
467 <v-card class="elevation-0 account-Card"> 467 <v-card class="elevation-0 account-Card">
468 <v-container> 468 <v-container>
469 <v-card-title class="justify-center title font-weight-bold">My Courses</v-card-title> 469 <v-card-title class="justify-center title font-weight-bold">My Courses</v-card-title>
470 <v-layout wrap> 470 <v-layout wrap>
471 <v-flex xs12 sm12> 471 <v-flex xs12 sm12>
472 <v-list two-line> 472 <v-list two-line>
473 <template> 473 <template>
474 <v-list-tile v-for="(course,i) in courseData" :key="i"> 474 <v-list-tile v-for="(course,i) in courseData" :key="i">
475 <v-list-tile-avatar> 475 <v-list-tile-avatar>
476 <!-- <v-icon 476 <!-- <v-icon
477 class="account-circle darkBlue-color" 477 class="account-circle darkBlue-color"
478 style="cursor: pointer;" 478 style="cursor: pointer;"
479 @click="routeToCourseDetails(course._id)" 479 @click="routeToCourseDetails(course._id)"
480 >panorama_fish_eye</v-icon>--> 480 >panorama_fish_eye</v-icon>-->
481 <span> 481 <span>
482 <v-tooltip top> 482 <v-tooltip top>
483 <img 483 <img
484 slot="activator" 484 slot="activator"
485 style="cursor:pointer; width:25px; height:25px; " 485 style="cursor:pointer; width:25px; height:25px; "
486 src="/static/icon/view.png" 486 src="/static/icon/view.png"
487 @click="routeToCourseDetails(course._id)" 487 @click="routeToCourseDetails(course._id)"
488 /> 488 />
489 <span>View</span> 489 <span>View</span>
490 </v-tooltip> 490 </v-tooltip>
491 </span> 491 </span>
492 </v-list-tile-avatar> 492 </v-list-tile-avatar>
493 <v-list-tile-content> 493 <v-list-tile-content>
494 <v-list-tile-title 494 <v-list-tile-title
495 style="cursor: pointer;" 495 style="cursor: pointer;"
496 @click="routeToCourseDetails(course._id)" 496 @click="routeToCourseDetails(course._id)"
497 >{{ course.courseName }}</v-list-tile-title> 497 >{{ course.courseName }}</v-list-tile-title>
498 </v-list-tile-content> 498 </v-list-tile-content>
499 </v-list-tile> 499 </v-list-tile>
500 </template> 500 </template>
501 </v-list> 501 </v-list>
502 </v-flex> 502 </v-flex>
503 </v-layout> 503 </v-layout>
504 </v-container> 504 </v-container>
505 </v-card> 505 </v-card>
506 </v-flex> 506 </v-flex>
507 </v-layout> 507 </v-layout>
508 508
509 <v-layout row wrap v-if="role == 'PARENT'"> 509 <v-layout row wrap v-if="role == 'PARENT'">
510 <!-- LATEST ANNOUNCEMENTSS , IF ROLE == PARENT --> 510 <!-- LATEST ANNOUNCEMENTSS , IF ROLE == PARENT -->
511 <v-flex xs6> 511 <v-flex xs6>
512 <v-card class="card"> 512 <v-card class="card">
513 <v-container> 513 <v-container>
514 <v-card-title 514 <v-card-title
515 class="justify-center subheading font-weight-bold" 515 class="justify-center subheading font-weight-bold"
516 >Latest Announcements</v-card-title> 516 >Latest Announcements</v-card-title>
517 517
518 <v-data-table 518 <v-data-table
519 :items="annoucementData" 519 :items="annoucementData"
520 class="elevation-0" 520 class="elevation-0"
521 flat 521 flat
522 hide-actions 522 hide-actions
523 hide-headers 523 hide-headers
524 style="border-spacing: 0 !important;" 524 style="border-spacing: 0 !important;"
525 > 525 >
526 <template 526 <template
527 slot="items" 527 slot="items"
528 slot-scope="props" 528 slot-scope="props"
529 v-if="props.index < 5" 529 v-if="props.index < 5"
530 style="border-spacing: 0 !important;" 530 style="border-spacing: 0 !important;"
531 > 531 >
532 <tr class="td-notice"> 532 <tr class="td-notice">
533 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td> 533 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
534 <td> 534 <td>
535 <span class="grey--text caption">{{ date(props.item.created) }}</span> 535 <span class="grey--text caption">{{ date(props.item.created) }}</span>
536 <br /> 536 <br />
537 <span class="body-2">{{ props.item.discussionType}}</span> 537 <span class="body-2">{{ props.item.discussionType}}</span>
538 </td> 538 </td>
539 <td class="text-xs-center"> 539 <td class="text-xs-center">
540 <span> 540 <span>
541 <v-tooltip top> 541 <v-tooltip top>
542 <img 542 <img
543 slot="activator" 543 slot="activator"
544 style="cursor:pointer; width:25px; height:25px; " 544 style="cursor:pointer; width:25px; height:25px; "
545 src="/static/icon/view.png" 545 src="/static/icon/view.png"
546 /> 546 />
547 <span>View</span> 547 <span>View</span>
548 </v-tooltip> 548 </v-tooltip>
549 </span> 549 </span>
550 </td> 550 </td>
551 </tr> 551 </tr>
552 </template> 552 </template>
553 </v-data-table> 553 </v-data-table>
554 </v-container> 554 </v-container>
555 </v-card> 555 </v-card>
556 </v-flex> 556 </v-flex>
557 <!-- IF ROLE == PARENT, SCHOOL EVENTS --> 557 <!-- IF ROLE == PARENT, SCHOOL EVENTS -->
558 <v-flex xs6> 558 <v-flex xs6>
559 <v-card class="card"> 559 <v-card class="card">
560 <v-container> 560 <v-container>
561 <v-card-title class="justify-center subheading font-weight-bold">School Events</v-card-title> 561 <v-card-title class="justify-center subheading font-weight-bold">School Events</v-card-title>
562 <div 562 <div
563 v-for="(schoolEvent,index) in schoolEvents" 563 v-for="(schoolEvent,index) in schoolEvents"
564 :key="schoolEvent.title" 564 :key="schoolEvent.title"
565 class="mt-2" 565 class="mt-2"
566 style="cursor: pointer;" 566 style="cursor: pointer;"
567 @click="seeEventDetails(schoolEvent,'schoolEvent')" 567 @click="seeEventDetails(schoolEvent,'schoolEvent')"
568 > 568 >
569 <!-- color dot--> 569 <!-- color dot-->
570 <span 570 <span
571 :style="{ 'background-color': colorsArray[index%colorsArray.length] }" 571 :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
572 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" 572 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
573 ></span> 573 ></span>
574 <div style="display: inline-block;" class="ml-2"> 574 <div style="display: inline-block;" class="ml-2">
575 <div> 575 <div>
576 <!-- date of event --> 576 <!-- date of event -->
577 <div 577 <div
578 class="grey--text lighten-1 caption" 578 class="grey--text lighten-1 caption"
579 v-if="schoolEvent.dateOfEvent" 579 v-if="schoolEvent.dateOfEvent"
580 >{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> 580 >{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
581 <!-- event title--> 581 <!-- event title-->
582 <div class="body-1" v-if="schoolEvent.title">{{schoolEvent.title}}</div> 582 <div class="body-1" v-if="schoolEvent.title">{{schoolEvent.title}}</div>
583 </div> 583 </div>
584 </div> 584 </div>
585 </div> 585 </div>
586 <div v-if="schoolEvents.length == 0"> 586 <div v-if="schoolEvents.length == 0">
587 <p class="text-center title grey lighten-4 error--text">No Data Found!</p> 587 <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
588 </div> 588 </div>
589 </v-container> 589 </v-container>
590 </v-card> 590 </v-card>
591 </v-flex> 591 </v-flex>
592 <!-- ONLINE USER , IF ROLE == PARENT --> 592 <!-- ONLINE USER , IF ROLE == PARENT -->
593 <!-- <v-flex xs6> 593 <!-- <v-flex xs6>
594 <v-card class="card"> 594 <v-card class="card">
595 <v-container> 595 <v-container>
596 <v-card-title class="justify-center subheading font-weight-bold">Online user</v-card-title> 596 <v-card-title class="justify-center subheading font-weight-bold">Online user</v-card-title>
597 597
598 <v-data-table 598 <v-data-table
599 :items="onlineUser" 599 :items="onlineUser"
600 class="elevation-0" 600 class="elevation-0"
601 flat 601 flat
602 hide-actions 602 hide-actions
603 hide-headers 603 hide-headers
604 style="border-spacing: 0 !important;" 604 style="border-spacing: 0 !important;"
605 > 605 >
606 <template 606 <template
607 slot="items" 607 slot="items"
608 slot-scope="props" 608 slot-scope="props"
609 v-if="props.index < 5" 609 v-if="props.index < 5"
610 style="border-spacing: 0 !important;" 610 style="border-spacing: 0 !important;"
611 > 611 >
612 <tr class="td-notice"> 612 <tr class="td-notice">
613 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td> 613 <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
614 <td> 614 <td>
615 <span class="body-2">{{ props.item.user }}</span> 615 <span class="body-2">{{ props.item.user }}</span>
616 </td> 616 </td>
617 <td class="text-xs-center"> 617 <td class="text-xs-center">
618 <span> 618 <span>
619 <v-tooltip top> 619 <v-tooltip top>
620 <img 620 <img
621 slot="activator" 621 slot="activator"
622 style="cursor:pointer; width:25px; height:25px; " 622 style="cursor:pointer; width:25px; height:25px; "
623 src="/static/icon/view.png" 623 src="/static/icon/view.png"
624 /> 624 />
625 <span>View</span> 625 <span>View</span>
626 </v-tooltip> 626 </v-tooltip>
627 </span> 627 </span>
628 </td> 628 </td>
629 </tr> 629 </tr>
630 </template> 630 </template>
631 </v-data-table> 631 </v-data-table>
632 </v-container> 632 </v-container>
633 </v-card> 633 </v-card>
634 </v-flex> --> 634 </v-flex>-->
635 </v-layout> 635 </v-layout>
636 </v-container> 636 </v-container>
637 </v-flex> 637 </v-flex>
638 <v-spacer></v-spacer> 638 <v-spacer></v-spacer>
639 <!-- SIDE BAR --> 639 <!-- SIDE BAR -->
640 <v-flex xs12 sm12 md4> 640 <v-flex xs12 sm12 md4>
641 <v-card height="100%" class="elevation-0 mt-3 profileDasboard"> 641 <v-card height="100%" class="elevation-0 mt-3 profileDasboard">
642 <v-card-text class="px-2"> 642 <v-card-text class="px-2">
643 <h4 class="text-xs-center py-3"> 643 <h4 class="text-xs-center py-3">
644 <b>Profile</b> 644 <b>Profile</b>
645 </h4> 645 </h4>
646 <v-flex xs12 class="py-3"> 646 <v-flex xs12 class="py-3">
647 <v-layout wrap> 647 <v-layout wrap>
648 <v-flex xs12 sm12 md4> 648 <v-flex xs12 sm12 md4>
649 <img 649 <img
650 src="/static/icon/user.png" 650 src="/static/icon/user.png"
651 v-if="!userData.profilePicUrl && !userData.schoolLogoUrl" 651 v-if="!userData.profilePicUrl && !userData.schoolLogoUrl"
652 width="80" 652 width="80"
653 /> 653 />
654 <img 654 <img
655 :src="userData.profilePicUrl" 655 :src="userData.profilePicUrl"
656 onerror="this.src='/static/icon/user.png';" 656 onerror="this.src='/static/icon/user.png';"
657 v-if="userData.profilePicUrl" 657 v-if="userData.profilePicUrl"
658 width="80" 658 width="80"
659 /> 659 />
660 <img 660 <img
661 :src="userData.schoolLogoUrl" 661 :src="userData.schoolLogoUrl"
662 onerror="this.src='/static/icon/user.png';" 662 onerror="this.src='/static/icon/user.png';"
663 v-if="userData.schoolLogoUrl" 663 v-if="userData.schoolLogoUrl"
664 width="80" 664 width="80"
665 /> 665 />
666 </v-flex> 666 </v-flex>
667 <v-flex xs12 sm12 md6> 667 <v-flex xs12 sm12 md6>
668 <p class="mb-0 body-1"> 668 <p class="mb-0 body-1">
669 <i>{{ userData.name }}</i> 669 <i>{{ userData.name }}</i>
670 </p> 670 </p>
671 <p class="mb-0 caption grey--text">{{ userData.email }}</p> 671 <p class="mb-0 caption grey--text">{{ userData.email }}</p>
672 <p class="mb-0 caption grey--text">{{ userData.mobile }}</p> 672 <p class="mb-0 caption grey--text">{{ userData.mobile }}</p>
673 <address class="caption grey--text mb-3">{{ userData.address }}</address> 673 <address class="caption grey--text mb-3">{{ userData.address }}</address>
674 </v-flex> 674 </v-flex>
675 </v-layout> 675 </v-layout>
676 </v-flex> 676 </v-flex>
677 <hr /> 677 <hr />
678 <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div> 678 <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div>
679 679
680 <vue-event-calendar :events="activityEvents" @day-changed="handleDayChanged($event)"></vue-event-calendar> 680 <vue-event-calendar :events="activityEvents" @day-changed="handleDayChanged($event)"></vue-event-calendar>
681 681
682 <!-- MEETING EVENTS --> 682 <!-- MEETING EVENTS -->
683 <!-- IF ROLE IS ADMIN --> 683 <!-- IF ROLE IS ADMIN -->
684 <v-card class="my-3 elevation-0"> 684 <v-card class="my-3 elevation-0">
685 <v-card-text v-if="$store.state.role === 'ADMIN' "> 685 <v-card-text v-if="$store.state.role === 'ADMIN' ">
686 <!-- MEETING EVENTS --> 686 <!-- MEETING EVENTS -->
687 <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title> 687 <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title>
688 <div 688 <div
689 v-for="(activity,index) in activityList" 689 v-for="(activity,index) in activityList"
690 :key="index" 690 :key="index"
691 class="mt-2" 691 class="mt-2"
692 style="cursor: pointer;" 692 style="cursor: pointer;"
693 @click="seeEventDetails(activity)" 693 @click="seeEventDetails(activity)"
694 > 694 >
695 <span 695 <span
696 :style="{ 'background-color': colorsArray[index%colorsArray.length] }" 696 :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
697 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" 697 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
698 ></span> 698 ></span>
699 <div style="display: inline-block;" class="ml-2"> 699 <div style="display: inline-block;" class="ml-2">
700 <div> 700 <div>
701 <div 701 <div
702 class="grey--text lighten-1 caption" 702 class="grey--text lighten-1 caption"
703 v-if="activity.dateOfEvent" 703 v-if="activity.dateOfEvent"
704 >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div> 704 >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
705 <div class="body-1" v-if="activity.title">{{activity.title}}</div> 705 <div class="body-1" v-if="activity.title">{{activity.title}}</div>
706 </div> 706 </div>
707 </div> 707 </div>
708 </div> 708 </div>
709 <div v-if="activityList.length == 0"> 709 <div v-if="activityList.length == 0">
710 <p class="text-center title grey lighten-4 error--text">No Data Found!</p> 710 <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
711 </div> 711 </div>
712 </v-card-text> 712 </v-card-text>
713 713
714 <!-- ROLE IS NOT ADMIN --> 714 <!-- ROLE IS NOT ADMIN -->
715 <v-card-text v-if="$store.state.role != 'ADMIN'"> 715 <v-card-text v-if="$store.state.role != 'ADMIN'">
716 <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title> 716 <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title>
717 <div 717 <div
718 v-for="(activity,index) in activityList" 718 v-for="(activity,index) in activityList"
719 :key="index" 719 :key="index"
720 class="mt-2" 720 class="mt-2"
721 style="cursor: pointer;" 721 style="cursor: pointer;"
722 @click="seeEventDetails(activity)" 722 @click="seeEventDetails(activity)"
723 > 723 >
724 <span 724 <span
725 :style="{ 'background-color': colorsArray[index%colorsArray.length] }" 725 :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
726 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;" 726 style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
727 ></span> 727 ></span>
728 <div style="display: inline-block;" class="ml-2"> 728 <div style="display: inline-block;" class="ml-2">
729 <!-- MEETING EVENTS FOR PARENT --> 729 <!-- MEETING EVENTS FOR PARENT -->
730 <div v-if="$store.state.role === 'PARENT' "> 730 <div v-if="$store.state.role === 'PARENT' ">
731 <div 731 <div
732 class="grey--text lighten-1 caption" 732 class="grey--text lighten-1 caption"
733 v-if="activity.meetingEvent" 733 v-if="activity.meetingEvent"
734 >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div> 734 >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
735 <div 735 <div
736 class="body-2" 736 class="body-2"
737 v-if="activity.meetingEvent" 737 v-if="activity.meetingEvent"
738 >{{activity.meetingEvent.title}}</div> 738 >{{activity.meetingEvent.title}}</div>
739 </div> 739 </div>
740 740
741 <!-- MEETING EVENTS FOR TEACHER --> 741 <!-- MEETING EVENTS FOR TEACHER -->
742 <div v-if="role === 'TEACHER'"> 742 <div v-if="role === 'TEACHER'">
743 <div 743 <div
744 class="grey--text lighten-1 caption" 744 class="grey--text lighten-1 caption"
745 v-if="activity.dateOfEvent" 745 v-if="activity.dateOfEvent"
746 >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div> 746 >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
747 <div class="body-2" v-if="activity.title">{{activity.title}}</div> 747 <div class="body-2" v-if="activity.title">{{activity.title}}</div>
748 </div> 748 </div>
749 </div> 749 </div>
750 <div v-if="activityList.length == 0"> 750 <div v-if="activityList.length == 0">
751 <p class="text-center title grey lighten-4 error--text">No Data Found!</p> 751 <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
752 </div> 752 </div>
753 </div> 753 </div>
754 </v-card-text> 754 </v-card-text>
755 </v-card> 755 </v-card>
756 </v-card-text> 756 </v-card-text>
757 </v-card> 757 </v-card>
758 </v-flex> 758 </v-flex>
759 </v-layout> 759 </v-layout>
760 760
761 <v-dialog v-model="dialog" max-width="500" persistent> 761 <v-dialog v-model="dialog" max-width="500" persistent>
762 <v-card color="grey lighten-4" flat> 762 <v-card color="grey lighten-4" flat>
763 <v-toolbar dark color="fixcolors"> 763 <v-toolbar dark color="fixcolors">
764 <v-spacer></v-spacer> 764 <v-spacer></v-spacer>
765 <v-btn icon @click="dialog= false"> 765 <v-btn icon @click="dialog= false">
766 <v-icon>close</v-icon> 766 <v-icon>close</v-icon>
767 </v-btn> 767 </v-btn>
768 </v-toolbar> 768 </v-toolbar>
769 <v-flex class="py-4"> 769 <v-flex class="py-4">
770 <v-list-tile> 770 <v-list-tile>
771 <v-list-tile-action> 771 <v-list-tile-action>
772 <v-icon>edit</v-icon> 772 <v-icon>edit</v-icon>
773 </v-list-tile-action> 773 </v-list-tile-action>
774 <v-list-tile-content> 774 <v-list-tile-content>
775 <v-list-tile-title>{{ selected.title }}</v-list-tile-title> 775 <v-list-tile-title>{{ selected.title }}</v-list-tile-title>
776 </v-list-tile-content> 776 </v-list-tile-content>
777 </v-list-tile> 777 </v-list-tile>
778 <v-list-tile> 778 <v-list-tile>
779 <v-list-tile-action> 779 <v-list-tile-action>
780 <v-icon>access_time</v-icon> 780 <v-icon>access_time</v-icon>
781 </v-list-tile-action> 781 </v-list-tile-action>
782 <v-list-tile-content> 782 <v-list-tile-content>
783 <v-list-tile-title>{{ date(selected.start)}}</v-list-tile-title> 783 <v-list-tile-title>{{ date(selected.start)}}</v-list-tile-title>
784 </v-list-tile-content> 784 </v-list-tile-content>
785 </v-list-tile> 785 </v-list-tile>
786 </v-flex> 786 </v-flex>
787 </v-card> 787 </v-card>
788 </v-dialog> 788 </v-dialog>
789 </v-app> 789 </v-app>
790 </template> 790 </template>
791 791
792 <script> 792 <script>
793 import http from "@/Services/http.js"; 793 import http from "@/Services/http.js";
794 import moment from "moment"; 794 import moment from "moment";
795 import AllApiCalls from "@/Services/AllApiCalls.js"; 795 import AllApiCalls from "@/Services/AllApiCalls.js";
796 // import { FunctionalCalendar } from "vue-functional-calendar"; 796 // import { FunctionalCalendar } from "vue-functional-calendar";
797 797
798 export default { 798 export default {
799 components: { 799 components: {
800 // FunctionalCalendar 800 // FunctionalCalendar
801 }, 801 },
802 mixins: [AllApiCalls], 802 mixins: [AllApiCalls],
803 data() { 803 data() {
804 return { 804 return {
805 // data: { 805 // data: {
806 // clieckedToday: false 806 // clieckedToday: false
807 // }, 807 // },
808 // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"], 808 // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"],
809 // calendarData: {}, 809 // calendarData: {},
810 // calendar: {}, 810 // calendar: {},
811 811
812 // DIALOG BOX EVENT DETAILS 812 // DIALOG BOX EVENT DETAILS
813 tabs: [ 813 tabs: [
814 { name: "School Events", icon: "mdi-account" }, 814 { name: "School Events", icon: "mdi-account" },
815 { name: "Meeting Events", icon: "mdi-account-outline" }, 815 { name: "Meeting Events", icon: "mdi-account-outline" },
816 ], 816 ],
817 viewEventDetails: false, 817 viewEventDetails: false,
818 active: 0, 818 active: 0,
819 particularEvent: [], 819 particularEvent: [],
820 displayEventsList: [], 820 displayEventsList: [],
821 dialogSchoolEvents: [], 821 dialogSchoolEvents: [],
822 dialogMeetingEvents: [], 822 dialogMeetingEvents: [],
823 823
824 // CALENDER 824 // CALENDER
825 moment: moment, 825 moment: moment,
826 activityEvents: [], 826 activityEvents: [],
827 onlineUser: [ 827 onlineUser: [
828 { 828 {
829 user: "Student Demo", 829 user: "Student Demo",
830 }, 830 },
831 { 831 {
832 user: "Teacher Demo", 832 user: "Teacher Demo",
833 }, 833 },
834 { 834 {
835 user: "Priyansh Gupta", 835 user: "Priyansh Gupta",
836 }, 836 },
837 { 837 {
838 user: "Gaurav Aggarwal", 838 user: "Gaurav Aggarwal",
839 }, 839 },
840 { 840 {
841 user: "Approve Arorra", 841 user: "Approve Arorra",
842 }, 842 },
843 ], 843 ],
844 showLoader: false, 844 showLoader: false,
845 calendarData: {}, 845 calendarData: {},
846 dialog: false, 846 dialog: false,
847 dialogNotice: false, 847 dialogNotice: false,
848 HolidaysList: [], 848 HolidaysList: [],
849 EventsList: [], 849 EventsList: [],
850 events: [], 850 events: [],
851 config: { 851 config: {
852 eventClick: (event) => { 852 eventClick: (event) => {
853 this.selected = event; 853 this.selected = event;
854 this.dialog = true; 854 this.dialog = true;
855 }, 855 },
856 }, 856 },
857 selected: {}, 857 selected: {},
858 barGraph: [], 858 barGraph: [],
859 // notice: {}, 859 // notice: {},
860 userData: {}, 860 userData: {},
861 dated: new Date(2018, 0, 9), 861 dated: new Date(2018, 0, 9),
862 userList: [], 862 userList: [],
863 sectionList: [], 863 sectionList: [],
864 students: "", 864 students: "",
865 parents: "", 865 parents: "",
866 teachers: "", 866 teachers: "",
867 classes: "", 867 classes: "",
868 noticeData: [], 868 noticeData: [],
869 expenseData: [], 869 expenseData: [],
870 feeData: [], 870 feeData: [],
871 collectionData: [], 871 collectionData: [],
872 courseData: [], 872 courseData: [],
873 studentsData: [], 873 studentsData: [],
874 annoucementData: [], 874 annoucementData: [],
875 role: "", 875 role: "",
876 attrs: [ 876 attrs: [
877 { 877 {
878 key: "today", 878 key: "today",
879 highlight: true, 879 highlight: true,
880 dates: new Date(), 880 dates: new Date(),
881 }, 881 },
882 ], 882 ],
883 drawer: true, 883 drawer: true,
884 items: [ 884 items: [
885 { title: "Home", icon: "dashboard" }, 885 { title: "Home", icon: "dashboard" },
886 { title: "About", icon: "question_answer" }, 886 { title: "About", icon: "question_answer" },
887 ], 887 ],
888 right: null, 888 right: null,
889 889
890 series: [ 890 series: [
891 { 891 {
892 name: "Total", 892 name: "Total",
893 data: [], 893 data: [],
894 }, 894 },
895 ], 895 ],
896 showChart: false, 896 showChart: false,
897 chartOptions: { 897 chartOptions: {
898 chart: { 898 chart: {
899 type: "bar", 899 type: "bar",
900 height: 150, 900 height: 150,
901 stacked: true, 901 stacked: true,
902 // animations: { 902 // animations: {
903 // enabled: true, 903 // enabled: true,
904 // easing: "easeinout", 904 // easing: "easeinout",
905 // speed: 1200, 905 // speed: 1200,
906 // animateGradually: { 906 // animateGradually: {
907 // enabled: true, 907 // enabled: true,
908 // delay: 450 908 // delay: 450
909 // }, 909 // },
910 // dynamicAnimation: { 910 // dynamicAnimation: {
911 // enabled: true, 911 // enabled: true,
912 // speed: 450 912 // speed: 450
913 // } 913 // }
914 // } 914 // }
915 }, 915 },
916 plotOptions: { 916 plotOptions: {
917 bar: { 917 bar: {
918 horizontal: false, 918 horizontal: false,
919 columnWidth: "25%", 919 columnWidth: "25%",
920 // endingShape: "rounded", 920 // endingShape: "rounded",
921 distributed: true, 921 distributed: true,
922 }, 922 },
923 }, 923 },
924 responsive: [ 924 responsive: [
925 { 925 {
926 breakpoint: 480, 926 breakpoint: 480,
927 options: { 927 options: {
928 legend: { 928 legend: {
929 position: "bottom", 929 position: "bottom",
930 offsetX: -10, 930 offsetX: -10,
931 offsetY: 0, 931 offsetY: 0,
932 }, 932 },
933 }, 933 },
934 }, 934 },
935 ], 935 ],
936 legend: { 936 legend: {
937 show: false, 937 show: false,
938 }, 938 },
939 colors: ["#7852cc", "#f9a825", "#ff8a89"], 939 colors: ["#7852cc", "#f9a825", "#ff8a89"],
940 dataLabels: { 940 dataLabels: {
941 enabled: false, 941 enabled: false,
942 }, 942 },
943 stroke: { 943 stroke: {
944 show: true, 944 show: true,
945 width: 2, 945 width: 2,
946 colors: ["transparent"], 946 colors: ["transparent"],
947 }, 947 },
948 xaxis: { 948 xaxis: {
949 categories: ["Fee", "Collections", "Expences"], 949 categories: ["Fee", "Collections", "Expences"],
950 }, 950 },
951 yaxis: { 951 yaxis: {
952 title: { 952 title: {
953 text: "", 953 text: "",
954 }, 954 },
955 }, 955 },
956 fill: { 956 fill: {
957 opacity: 1, 957 opacity: 1,
958 }, 958 },
959 tooltip: { 959 tooltip: {
960 y: { 960 y: {
961 formatter: function (val, opts) { 961 formatter: function (val, opts) {
962 return "" + val + " "; 962 return "" + val + " ";
963 }, 963 },
964 }, 964 },
965 }, 965 },
966 }, 966 },
967 967
968 // LATEST ACTIVITY 968 // LATEST ACTIVITY
969 colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"], 969 colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"],
970 activityList: [], 970 activityList: [],
971 }; 971 };
972 }, 972 },
973 973
974 methods: { 974 methods: {
975 test(e) { 975 test(e) {
976 // console.log(" test - ", e); 976 // console.log(" test - ", e);
977 }, 977 },
978 978
979 /*WHEN CALENDER IS CLICKED - DISPLAYS EVENTS IN DIALOG BOX */ 979 /*WHEN CALENDER IS CLICKED - DISPLAYS EVENTS IN DIALOG BOX */
980 async handleDayChanged(e) { 980 async handleDayChanged(e) {
981 // console.log("event calender - ", e); 981 // console.log("event calender - ", e);
982 /*the list of events that will be used in dialog box to display events */ 982 /*the list of events that will be used in dialog box to display events */
983 983
984 this.dialogMeetingEvents = []; 984 this.dialogMeetingEvents = [];
985 this.dialogSchoolEvents = []; 985 this.dialogSchoolEvents = [];
986 986
987 for (var i = 0; i < e.events.length; i++) { 987 for (var i = 0; i < e.events.length; i++) {
988 if (e.events[i].eventType == "meetingEvent") { 988 if (e.events[i].eventType == "meetingEvent") {
989 let meetingEventResponse = await this.getParticularMeetingEvent({ 989 let meetingEventResponse = await this.getParticularMeetingEvent({
990 meetingEventId: e.events[i]._id, 990 meetingEventId: e.events[i]._id,
991 }); 991 });
992 this.dialogMeetingEvents.push(meetingEventResponse.data.data); 992 this.dialogMeetingEvents.push(meetingEventResponse.data.data);
993 } 993 }
994 if (e.events[i].eventType == "schoolEvent") { 994 if (e.events[i].eventType == "schoolEvent") {
995 let schoolEventResponse = await this.getParticularSchoolEvent({ 995 let schoolEventResponse = await this.getParticularSchoolEvent({
996 schoolEventId: e.events[i]._id, 996 schoolEventId: e.events[i]._id,
997 }); 997 });
998 this.dialogSchoolEvents.push(schoolEventResponse.data.data); 998 this.dialogSchoolEvents.push(schoolEventResponse.data.data);
999 } 999 }
1000 } 1000 }
1001 /* Opens the dialog box */ 1001 /* Opens the dialog box */
1002 this.viewEventDetails = true; 1002 this.viewEventDetails = true;
1003 }, 1003 },
1004 1004
1005 /* see meeting events, school events individually (when calender is not clicked) */ 1005 /* see meeting events, school events individually (when calender is not clicked) */
1006 async seeEventDetails(activity, message) { 1006 async seeEventDetails(activity, message) {
1007 // if (this.$store.state.role === "TEACHER") { 1007 // if (this.$store.state.role === "TEACHER") {
1008 // let response = await this.getParticularMeetingEvent({ 1008 // let response = await this.getParticularMeetingEvent({
1009 // meetingEventId: activity._id, 1009 // meetingEventId: activity._id,
1010 // }); 1010 // });
1011 // this.displayEventsList = []; 1011 // this.displayEventsList = [];
1012 // this.displayEventsList.push(response.data.data); 1012 // this.displayEventsList.push(response.data.data);
1013 // this.viewEventDetails = true; 1013 // this.viewEventDetails = true;
1014 // } 1014 // }
1015 if (this.$store.state.role === "PARENT") { 1015 if (this.$store.state.role === "PARENT") {
1016 if (message == "schoolEvent") { 1016 if (message == "schoolEvent") {
1017 let response = await this.getParticularSchoolEvent({ 1017 let response = await this.getParticularSchoolEvent({
1018 schoolEventId: activity._id, 1018 schoolEventId: activity._id,
1019 }); 1019 });
1020 this.displayEventsList = []; 1020 this.displayEventsList = [];
1021 this.displayEventsList.push(response.data.data); 1021 this.displayEventsList.push(response.data.data);
1022 } else { 1022 } else {
1023 let response = await this.getParticularMeetingEvent({ 1023 let response = await this.getParticularMeetingEvent({
1024 meetingEventId: activity.meetingEvent._id, 1024 meetingEventId: activity.meetingEvent._id,
1025 }); 1025 });
1026 this.displayEventsList = []; 1026 this.displayEventsList = [];
1027 this.displayEventsList.push(response.data.data); 1027 this.displayEventsList.push(response.data.data);
1028 } 1028 }
1029 this.viewEventDetails = true; 1029 this.viewEventDetails = true;
1030 } 1030 }
1031 if ( 1031 if (
1032 this.$store.state.role === "ADMIN" || 1032 this.$store.state.role === "ADMIN" ||
1033 this.$store.state.role === "TEACHER" 1033 this.$store.state.role === "TEACHER"
1034 ) { 1034 ) {
1035 if (message == "schoolEvent") { 1035 if (message == "schoolEvent") {
1036 let response = await this.getParticularSchoolEvent({ 1036 let response = await this.getParticularSchoolEvent({
1037 schoolEventId: activity._id, 1037 schoolEventId: activity._id,
1038 }); 1038 });
1039 this.displayEventsList = []; 1039 this.displayEventsList = [];
1040 this.displayEventsList.push(response.data.data); 1040 this.displayEventsList.push(response.data.data);
1041 } else { 1041 } else {
1042 let response = await this.getParticularMeetingEvent({ 1042 let response = await this.getParticularMeetingEvent({
1043 meetingEventId: activity._id, 1043 meetingEventId: activity._id,
1044 }); 1044 });
1045 this.displayEventsList = []; 1045 this.displayEventsList = [];
1046 this.displayEventsList.push(response.data.data); 1046 this.displayEventsList.push(response.data.data);
1047 } 1047 }
1048 this.viewEventDetails = true; 1048 this.viewEventDetails = true;
1049 } 1049 }
1050 }, 1050 },
1051 async routeToCourseDetails(courseId) { 1051 async routeToCourseDetails(courseId) {
1052 /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ 1052 /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/
1053 let response = await this.getParticularCourseDetail(courseId); 1053 let response = await this.getParticularCourseDetail(courseId);
1054 1054
1055 /* If the response is null then dont route */ 1055 /* If the response is null then dont route */
1056 if (response.data.data.length > 0) { 1056 if (response.data.data.length > 0) {
1057 this.$router.push({ 1057 this.$router.push({
1058 name: "Course Details", 1058 name: "Course Details",
1059 query: { courseId: courseId }, 1059 query: { courseId: courseId },
1060 }); 1060 });
1061 } else { 1061 } else {
1062 this.seeSnackbar("No Data Available", "warning"); 1062 this.seeSnackbar("No Data Available", "warning");
1063 } 1063 }
1064 }, 1064 },
1065 1065
1066 closeNotice() { 1066 closeNotice() {
1067 this.dialogNotice = false; 1067 this.dialogNotice = false;
1068 }, 1068 },
1069 profile() { 1069 profile() {
1070 // this.editedIndex = this.desserts.indexOf(item); 1070 // this.editedIndex = this.desserts.indexOf(item);
1071 // this.notice = Object.assign({}, item); 1071 // this.notice = Object.assign({}, item);
1072 // this.dialogNotice = true; 1072 // this.dialogNotice = true;
1073 this.$router.push("/noticeBoard"); 1073 this.$router.push("/noticeBoard");
1074 }, 1074 },
1075 date: function (date) { 1075 date: function (date) {
1076 return moment(date).format("MMMM DD, YYYY HH:mm"); 1076 return moment(date).format("MMMM DD, YYYY HH:mm");
1077 }, 1077 },
1078 activityDate(date) { 1078 activityDate(date) {
1079 return moment(date).format("MMMM DD, YYYY"); 1079 return moment(date).format("MMMM DD, YYYY");
1080 }, 1080 },
1081 refreshEvents() { 1081 refreshEvents() {
1082 this.$refs.calendar.$emit("refetch-events"); 1082 this.$refs.calendar.$emit("refetch-events");
1083 }, 1083 },
1084 removeEvent() { 1084 removeEvent() {
1085 this.$refs.calendar.$emit("remove-event", this.selected); 1085 this.$refs.calendar.$emit("remove-event", this.selected);
1086 this.selected = {}; 1086 this.selected = {};
1087 }, 1087 },
1088 eventSelected(event) { 1088 eventSelected(event) {
1089 this.selected = event; 1089 this.selected = event;
1090 }, 1090 },
1091 // eventDropStart: function(event) { 1091 // eventDropStart: function(event) {
1092 // event.editable = false; 1092 // event.editable = false;
1093 // }, 1093 // },
1094 eventCreated(...test) { 1094 eventCreated(...test) {
1095 // console.log(test); 1095 // console.log(test);
1096 }, 1096 },
1097 getStudents() { 1097 getStudents() {
1098 http() 1098 http()
1099 .get("/getStudentsList") 1099 .get("/getStudentsList")
1100 .then((response) => { 1100 .then((response) => {
1101 this.students = response.data.data; 1101 this.students = response.data.data;
1102 this.showLoader = false; 1102 this.showLoader = false;
1103 }) 1103 })
1104 .catch((error) => { 1104 .catch((error) => {
1105 // console.log("err====>", err); 1105 // console.log("err====>", err);
1106 this.showLoader = false; 1106 this.showLoader = false;
1107 if (error.response.status === 401) { 1107 if (error.response.status === 401) {
1108 this.$router.replace({ path: "/" }); 1108 this.$router.replace({ path: "/" });
1109 this.$store.dispatch("setToken", null); 1109 this.$store.dispatch("setToken", null);
1110 this.$store.dispatch("Id", null); 1110 this.$store.dispatch("Id", null);
1111 } 1111 }
1112 }); 1112 });
1113 }, 1113 },
1114 getParents() { 1114 getParents() {
1115 http() 1115 http()
1116 .get("/getParentsList") 1116 .get("/getParentsList")
1117 .then((response) => { 1117 .then((response) => {
1118 this.parents = response.data.data; 1118 this.parents = response.data.data;
1119 this.showLoader = false; 1119 this.showLoader = false;
1120 }) 1120 })
1121 .catch((error) => { 1121 .catch((error) => {
1122 // console.log("err====>", err); 1122 // console.log("err====>", err);
1123 this.showLoader = false; 1123 this.showLoader = false;
1124 }); 1124 });
1125 }, 1125 },
1126 getTeachers() { 1126 getTeachers() {
1127 http() 1127 http()
1128 .get("/getTeachersList") 1128 .get("/getTeachersList")
1129 .then((response) => { 1129 .then((response) => {
1130 this.teachers = response.data.data; 1130 this.teachers = response.data.data;
1131 this.showLoader = false; 1131 this.showLoader = false;
1132 }) 1132 })
1133 .catch((error) => { 1133 .catch((error) => {
1134 // console.log("err====>", err); 1134 // console.log("err====>", err);
1135 this.showLoader = false; 1135 this.showLoader = false;
1136 }); 1136 });
1137 }, 1137 },
1138 getClasses() { 1138 getClasses() {
1139 http() 1139 http()
1140 .get("/getClassesList") 1140 .get("/getClassesList")
1141 .then((response) => { 1141 .then((response) => {
1142 this.classes = response.data.data; 1142 this.classes = response.data.data;
1143 this.showLoader = false; 1143 this.showLoader = false;
1144 }) 1144 })
1145 .catch((error) => { 1145 .catch((error) => {
1146 this.showLoader = false; 1146 this.showLoader = false;
1147 }); 1147 });
1148 }, 1148 },
1149 getNoticeData() { 1149 getNoticeData() {
1150 this.showLoader = true; 1150 this.showLoader = true;
1151 http() 1151 http()
1152 .get("/getEventsList") 1152 .get("/getEventsList")
1153 .then((response) => { 1153 .then((response) => {
1154 this.noticeData = response.data.data; 1154 this.noticeData = response.data.data;
1155 this.showLoader = false; 1155 this.showLoader = false;
1156 }) 1156 })
1157 .catch((error) => { 1157 .catch((error) => {
1158 this.showLoader = false; 1158 this.showLoader = false;
1159 }); 1159 });
1160 }, 1160 },
1161 getUserData() { 1161 getUserData() {
1162 // this.showLoader = true; 1162 // this.showLoader = true;
1163 if (this.$store.state.role === "PARENT") { 1163 if (this.$store.state.role === "PARENT") {
1164 http() 1164 http()
1165 .get("/getParticularUserDetail", { 1165 .get("/getParticularUserDetail", {
1166 params: { 1166 params: {
1167 studentId: localStorage.getItem("parentStudentId"), 1167 studentId: localStorage.getItem("parentStudentId"),
1168 }, 1168 },
1169 }) 1169 })
1170 .then((response) => { 1170 .then((response) => {
1171 this.userData = response.data.data; 1171 this.userData = response.data.data;
1172 this.showLoader = false; 1172 this.showLoader = false;
1173 }) 1173 })
1174 .catch((error) => { 1174 .catch((error) => {
1175 this.showLoader = false; 1175 this.showLoader = false;
1176 }); 1176 });
1177 } else { 1177 } else {
1178 http() 1178 http()
1179 .get("/getParticularUserDetail") 1179 .get("/getParticularUserDetail")
1180 .then((response) => { 1180 .then((response) => {
1181 this.userData = response.data.data; 1181 this.userData = response.data.data;
1182 this.showLoader = false; 1182 this.showLoader = false;
1183 }) 1183 })
1184 .catch((error) => { 1184 .catch((error) => {
1185 this.showLoader = false; 1185 this.showLoader = false;
1186 }); 1186 });
1187 } 1187 }
1188 }, 1188 },
1189 1189
1190 getFeesAndCollectionsData() { 1190 getFeesAndCollectionsData() {
1191 http() 1191 http()
1192 .get("/getTotalFeesAndCollections") 1192 .get("/getTotalFeesAndCollections")
1193 .then((response) => { 1193 .then((response) => {
1194 this.feeData = response.data.data; 1194 this.feeData = response.data.data;
1195 // this.collectionData = response.data.data; 1195 // this.collectionData = response.data.data;
1196 this.series[0].data[0] = this.feeData.totalFees; 1196 this.series[0].data[0] = this.feeData.totalFees;
1197 this.series[0].data[1] = this.feeData.totalCollection; 1197 this.series[0].data[1] = this.feeData.totalCollection;
1198 this.showLoader = false; 1198 this.showLoader = false;
1199 }) 1199 })
1200 .catch((error) => { 1200 .catch((error) => {
1201 this.showLoader = false; 1201 this.showLoader = false;
1202 }); 1202 });
1203 }, 1203 },
1204 getExpensesData() { 1204 getExpensesData() {
1205 http() 1205 http()
1206 .get("/getTotalExpenses") 1206 .get("/getTotalExpenses")
1207 .then((response) => { 1207 .then((response) => {
1208 this.expenseData = response.data.data; 1208 this.expenseData = response.data.data;
1209 // var array = response.data.data.sum; 1209 // var array = response.data.data.sum;
1210 this.series[0].data[2] = this.expenseData.sum; 1210 this.series[0].data[2] = this.expenseData.sum;
1211 this.showChart = true; 1211 this.showChart = true;
1212 // this.series = [ 1212 // this.series = [
1213 // { 1213 // {
1214 // name: "Total", 1214 // name: "Total",
1215 // data: array 1215 // data: array
1216 // } 1216 // }
1217 // ]; 1217 // ];
1218 this.showLoader = false; 1218 this.showLoader = false;
1219 }) 1219 })
1220 .catch((error) => { 1220 .catch((error) => {
1221 this.showLoader = false; 1221 this.showLoader = false;
1222 }); 1222 });
1223 }, 1223 },
1224 // async getparentStudents() { 1224 // async getparentStudents() {
1225 // this.showLoader = true; 1225 // this.showLoader = true;
1226 // await http() 1226 // await http()
1227 // .get("/parentStudentsList") 1227 // .get("/parentStudentsList")
1228 // .then((response) => { 1228 // .then((response) => {
1229 1229
1230 // /* set values in local storage */ 1230 // /* set values in local storage */
1231 // this.studentsData = response.data.data.students; 1231 // this.studentsData = response.data.data.students;
1232 // this.showLoader = false; 1232 // this.showLoader = false;
1233 // }) 1233 // })
1234 // .catch((err) => { 1234 // .catch((err) => {
1235 // console.log("err====>", err); 1235 // console.log("err====>", err);
1236 // this.showLoader = false; 1236 // this.showLoader = false;
1237 // }); 1237 // });
1238 // await this.getCourses(parentStudentsId, classId); 1238 // await this.getCourses(parentStudentsId, classId);
1239 // await this.getAnnoucementes(classId); 1239 // await this.getAnnoucementes(classId);
1240 // }, 1240 // },
1241 async getCourses(parentStudentsId, classId) { 1241 async getCourses(parentStudentsId, classId) {
1242 /* getStudentCourses - to get courseData - defined in GetApis.js*/ 1242 /* getStudentCourses - to get courseData - defined in GetApis.js*/
1243 await this.getStudentCourses({ 1243 await this.getStudentCourses({
1244 classId: localStorage.getItem("parentClassId"), 1244 classId: localStorage.getItem("parentClassId"),
1245 studentId: localStorage.getItem("parentStudentId"), 1245 studentId: localStorage.getItem("parentStudentId"),
1246 }); 1246 });
1247 }, 1247 },
1248 getAnnoucementes(classId) { 1248 getAnnoucementes(classId) {
1249 this.showLoader = true; 1249 this.showLoader = true;
1250 http() 1250 http()
1251 .get("/getAnnoucementesList", { 1251 .get("/getAnnoucementesList", {
1252 params: { 1252 params: {
1253 classId: localStorage.getItem("parentClassId"), 1253 classId: localStorage.getItem("parentClassId"),
1254 }, 1254 },
1255 }) 1255 })
1256 .then((response) => { 1256 .then((response) => {
1257 this.annoucementData = response.data.data; 1257 this.annoucementData = response.data.data;
1258 this.showLoader = false; 1258 this.showLoader = false;
1259 }) 1259 })
1260 .catch((err) => { 1260 .catch((err) => {
1261 // console.log("err====>", err); 1261 // console.log("err====>", err);
1262 this.showLoader = false; 1262 this.showLoader = false;
1263 this.snackbar = true; 1263 this.snackbar = true;
1264 this.color = "error"; 1264 this.color = "error";
1265 this.text = error.response.data.message; 1265 this.text = error.response.data.message;
1266 }); 1266 });
1267 }, 1267 },
1268 1268
1269 /* MEETING EVENTS, SCHOOL EVENTS */ 1269 /* MEETING EVENTS, SCHOOL EVENTS */
1270 async getMeetingEventes() { 1270 async getMeetingEventes() {
1271 if (this.role == "TEACHER" || this.role === "ADMIN") { 1271 if (this.role == "TEACHER" || this.role === "ADMIN") {
1272 this.showLoader = true; 1272 this.showLoader = true;
1273 await http() 1273 await http()
1274 .get("/getMeetingEventesList") 1274 .get("/getMeetingEventesList")
1275 .then((response) => { 1275 .then((response) => {
1276 var activityList = response.data.data; 1276 var activityList = response.data.data;
1277 this.activityList = activityList; 1277 this.activityList = activityList;
1278 this.showLoader = false; 1278 this.showLoader = false;
1279 1279
1280 /* set meetingEvents in activityEvents array to highlight event dates in calender */ 1280 /* set meetingEvents in activityEvents array to highlight event dates in calender */
1281 for (var i = 0; i < this.activityList.length; i++) { 1281 for (var i = 0; i < this.activityList.length; i++) {
1282 let obj = {}; 1282 let obj = {};
1283 obj.date = moment(this.activityList[i].dateOfEvent).format( 1283 obj.date = moment(this.activityList[i].dateOfEvent).format(
1284 "YYYY/MM/DD" 1284 "YYYY/MM/DD"
1285 ); 1285 );
1286 obj.title = this.activityList[i].title; 1286 obj.title = this.activityList[i].title;
1287 obj._id = this.activityList[i]._id; 1287 obj._id = this.activityList[i]._id;
1288 obj.eventType = "meetingEvent"; 1288 obj.eventType = "meetingEvent";
1289 /* activityEvents is an array used to display events in calender on particular dates */ 1289 /* activityEvents is an array used to display events in calender on particular dates */
1290 this.activityEvents.push(obj); 1290 this.activityEvents.push(obj);
1291 } 1291 }
1292 }) 1292 })
1293 .catch((error) => { 1293 .catch((error) => {
1294 this.showLoader = false; 1294 this.showLoader = false;
1295 }); 1295 });
1296 } 1296 }
1297 /* If role is ADMIN,TEACHER, PARENT then school events need to be displayed too */ 1297 /* If role is ADMIN,TEACHER, PARENT then school events need to be displayed too */
1298 if ( 1298 if (
1299 this.role === "ADMIN" || 1299 this.role === "ADMIN" ||
1300 this.role === "TEACHER" || 1300 this.role === "TEACHER" ||
1301 this.role === "PARENT" 1301 this.role === "PARENT"
1302 ) { 1302 ) {
1303 /* this will get data in a "schoolEvents" data property */ 1303 /* this will get data in a "schoolEvents" data property */
1304 await this.getSchoolEventsList(); 1304 await this.getSchoolEventsList();
1305 /* set schoolEvents in activityEvents array to highlight event dates in calender */ 1305 /* set schoolEvents in activityEvents array to highlight event dates in calender */
1306 for (var i = 0; i < this.schoolEvents.length; i++) { 1306 for (var i = 0; i < this.schoolEvents.length; i++) {
1307 let obj = {}; 1307 let obj = {};
1308 obj.date = moment(this.schoolEvents[i].dateOfEvent).format( 1308 obj.date = moment(this.schoolEvents[i].dateOfEvent).format(
1309 "YYYY/MM/DD" 1309 "YYYY/MM/DD"
1310 ); 1310 );
1311 obj.title = this.schoolEvents[i].title; 1311 obj.title = this.schoolEvents[i].title;
1312 obj._id = this.schoolEvents[i]._id; 1312 obj._id = this.schoolEvents[i]._id;
1313 obj.eventType = "schoolEvent"; 1313 obj.eventType = "schoolEvent";
1314 /* activityEvents is an array used to display events in calender on particular dates */ 1314 /* activityEvents is an array used to display events in calender on particular dates */
1315 this.activityEvents.push(obj); 1315 this.activityEvents.push(obj);
1316 } 1316 }
1317 } 1317 }
1318 }, 1318 },
1319 }, 1319 },
1320 1320
1321 mounted() { 1321 mounted() {
1322 // = this.$store.state.schoolToken; 1322 // = this.$store.state.schoolToken;
1323 // console.log("this.$store.state.role", this.token); 1323 // console.log("this.$store.state.role", this.token);
1324 // this.getUsersList(); 1324 // this.getUsersList();
1325 }, 1325 },
1326 1326
1327 async created() { 1327 async created() {
1328 if (this.$store.state.role === "ADMIN") { 1328 if (this.$store.state.role === "ADMIN") {
1329 // this.token = this.$store.state.token; 1329 // this.token = this.$store.state.token;
1330 await this.getFeesAndCollectionsData(); 1330 await this.getFeesAndCollectionsData();
1331 await this.getExpensesData(); 1331 await this.getExpensesData();
1332 } else if (this.$store.state.schoolRole === "SUPERADMIN") { 1332 } else if (this.$store.state.schoolRole === "SUPERADMIN") {
1333 // this.token = this.$store.state.schoolToken; 1333 // this.token = this.$store.state.schoolToken;
1334 await this.getFeesAndCollectionsData(); 1334 await this.getFeesAndCollectionsData();
1335 await this.getExpensesData(); 1335 await this.getExpensesData();
1336 } else if (this.$store.state.role === "TEACHER") { 1336 } else if (this.$store.state.role === "TEACHER") {
1337 // this.token = this.$store.state.token; 1337 // this.token = this.$store.state.token;
1338 } else if (this.$store.state.role === "ACCOUNTANT") { 1338 } else if (this.$store.state.role === "ACCOUNTANT") {
1339 // this.token = this.$store.state.token; 1339 // this.token = this.$store.state.token;
1340 } else if (this.$store.state.role === "LIBRARIAN") { 1340 } else if (this.$store.state.role === "LIBRARIAN") {
1341 // this.token = this.$store.state.token; 1341 // this.token = this.$store.state.token;
1342 } else if (this.$store.state.role === "PARENT") { 1342 } else if (this.$store.state.role === "PARENT") {
1343 // this.token = this.$store.state.token; 1343 // this.token = this.$store.state.token;
1344 // await this.getparentStudents(); 1344 // await this.getparentStudents();
1345 this.studentsData = this.$store.getters.GET_STUDENTS_DATA; 1345 this.studentsData = this.$store.getters.GET_STUDENTS_DATA;
1346 // console.log("students data - ", this.studentsData); 1346 // console.log("students data - ", this.studentsData);
1347 await this.getCourses(); 1347 await this.getCourses();
1348 await this.getAnnoucementes(); 1348 await this.getAnnoucementes();
1349 } 1349 }
1350 this.role = this.$store.state.role; 1350 this.role = this.$store.state.role;
1351 1351
1352 await this.getStudents(); 1352 await this.getStudents();
1353 await this.getTeachers(); 1353 await this.getTeachers();
1354 await this.getParents(); 1354 await this.getParents();
1355 await this.getClasses(); 1355 await this.getClasses();
1356 await this.getNoticeData(); 1356 await this.getNoticeData();
1357 await this.getUserData(); 1357 await this.getUserData();
1358 1358
1359 /* get Latest events list for student login*/ 1359 /* get Latest events list for student login*/
1360 if (this.$store.state.role == "PARENT") { 1360 if (this.$store.state.role == "PARENT") {
1361 let response = await this.studentMeetingEvents({ 1361 let response = await this.studentMeetingEvents({
1362 studentId: localStorage.getItem("parentStudentId"), 1362 studentId: localStorage.getItem("parentStudentId"),
1363 }); 1363 });
1364 this.activityList = response.data.data; 1364 this.activityList = response.data.data;
1365 1365
1366 /* set activityEvents array to highlight event dates in calender */ 1366 /* set activityEvents array to highlight event dates in calender */
1367 for (var i = 0; i < this.activityList.length; i++) { 1367 for (var i = 0; i < this.activityList.length; i++) {
1368 let obj = {}; 1368 let obj = {};
1369 obj.date = moment(this.activityList[i].meetingEvent.dateOfEvent).format( 1369 obj.date = moment(this.activityList[i].meetingEvent.dateOfEvent).format(
1370 "YYYY/MM/DD" 1370 "YYYY/MM/DD"
1371 ); 1371 );
1372 obj.title = this.activityList[i].meetingEvent.title; 1372 obj.title = this.activityList[i].meetingEvent.title;
1373 obj._id = this.activityList[i].meetingEvent._id; 1373 obj._id = this.activityList[i].meetingEvent._id;
1374 obj.eventType = "meetingEvent"; 1374 obj.eventType = "meetingEvent";
1375 this.activityEvents.push(obj); 1375 this.activityEvents.push(obj);
1376 } 1376 }
1377 } 1377 }
1378 1378
1379 /* get Latest events list for teacher login*/ 1379 /* get Latest events list for teacher login*/
1380 if ( 1380 if (
1381 this.role == "TEACHER" || 1381 this.role == "TEACHER" ||
1382 this.role == "ADMIN" || 1382 this.role == "ADMIN" ||
1383 this.role == "PARENT" 1383 this.role == "PARENT"
1384 ) { 1384 ) {
1385 await this.getMeetingEventes(); 1385 await this.getMeetingEventes();
1386 } 1386 }
1387 }, 1387 },
1388 }; 1388 };
1389 </script> 1389 </script>
1390 1390
1391 <style scoped> 1391 <style scoped>
1392 @import "fullcalendar/dist/fullcalendar.css"; 1392 @import "fullcalendar/dist/fullcalendar.css";
1393 .wrap-text { 1393 .wrap-text {
1394 -webkit-line-clamp: unset !important; 1394 -webkit-line-clamp: unset !important;
1395 } 1395 }
1396 1396
1397 a { 1397 a {
1398 color: white; 1398 color: white;
1399 } 1399 }
1400 </style> 1400 </style>
src/pages/Exam/examAttendence.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ***** Exam Schedule TABLE****** --> 3 <!-- ***** Exam Schedule TABLE****** -->
4 <v-toolbar color="transparent" flat> 4 <v-toolbar color="transparent" flat>
5 <v-btn 5 <v-btn
6 fab 6 fab
7 dark 7 dark
8 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 8 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
9 small 9 small
10 @click="addExamAttendenceDialog = true" 10 @click="addExamAttendenceDialog = true"
11 > 11 >
12 <v-icon dark>add</v-icon> 12 <v-icon dark>add</v-icon>
13 </v-btn> 13 </v-btn>
14 <v-btn 14 <v-btn
15 round 15 round
16 class="open-dialog-button hidden-sm-only hidden-xs-only" 16 class="open-dialog-button hidden-sm-only hidden-xs-only"
17 dark 17 dark
18 @click="addExamAttendenceDialog = true" 18 @click="addExamAttendenceDialog = true"
19 > 19 >
20 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Attendence 20 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Exam Attendence
21 </v-btn> 21 </v-btn>
22 <v-spacer></v-spacer> 22 <v-spacer></v-spacer>
23 <v-flex xs8 sm3 md2 class="mr-3"> 23 <v-flex xs8 sm3 md2 class="mr-3">
24 <v-select 24 <v-select
25 v-model="getAttendence.examId" 25 v-model="getAttendence.examId"
26 label="Select Exam" 26 label="Select Exam"
27 :rules="examRules" 27 :rules="examRules"
28 :items="examList" 28 :items="examList"
29 item-text="examName" 29 item-text="examName"
30 item-value="_id" 30 item-value="_id"
31 required 31 required
32 ></v-select> 32 ></v-select>
33 </v-flex> 33 </v-flex>
34 <v-flex xs8 sm3 md2 class="mr-3"> 34 <v-flex xs8 sm3 md2 class="mr-3">
35 <v-select 35 <v-select
36 v-model="getAttendence.classId" 36 v-model="getAttendence.classId"
37 label="Select your class" 37 label="Select your class"
38 type="text" 38 type="text"
39 :items="classList" 39 :items="classList"
40 item-text="classNum" 40 item-text="classNum"
41 item-value="_id" 41 item-value="_id"
42 @change="getSections(getAttendence.classId)" 42 @change="getSections(getAttendence.classId)"
43 required 43 required
44 ></v-select> 44 ></v-select>
45 </v-flex> 45 </v-flex>
46 <v-flex xs8 sm3 md2 class="mr-3"> 46 <v-flex xs8 sm3 md2 class="mr-3">
47 <v-select 47 <v-select
48 v-model="getAttendence.sectionId" 48 v-model="getAttendence.sectionId"
49 label="Select your section" 49 label="Select your section"
50 type="text" 50 type="text"
51 :items="addSection" 51 :items="addSection"
52 item-text="name" 52 item-text="name"
53 item-value="_id" 53 item-value="_id"
54 @change="getClassSubject(getAttendence.classId)" 54 @change="getClassSubject(getAttendence.classId)"
55 required 55 required
56 ></v-select> 56 ></v-select>
57 </v-flex> 57 </v-flex>
58 <v-flex xs8 sm3 md2 class="mr-3"> 58 <v-flex xs8 sm3 md2 class="mr-3">
59 <v-select 59 <v-select
60 v-model="getAttendence.subjectId" 60 v-model="getAttendence.subjectId"
61 label="Select Subject" 61 label="Select Subject"
62 :rules="subjectRules" 62 :rules="subjectRules"
63 :items="subjectList.subjects" 63 :items="subjectList.subjects"
64 item-text="subjectName" 64 item-text="subjectName"
65 item-value="_id" 65 item-value="_id"
66 @change="getExamAttendenceList()" 66 @change="getExamAttendenceList()"
67 required 67 required
68 ></v-select> 68 ></v-select>
69 </v-flex> 69 </v-flex>
70 70
71 <v-card-title class="body-1" v-show="show"> 71 <v-card-title class="body-1" v-show="show">
72 <v-btn icon large flat @click="displaySearch"> 72 <v-btn icon large flat @click="displaySearch">
73 <v-avatar size="27"> 73 <v-avatar size="27">
74 <img src="/static/icon/search.png" alt="icon" /> 74 <img src="/static/icon/search.png" alt="icon" />
75 </v-avatar> 75 </v-avatar>
76 </v-btn> 76 </v-btn>
77 </v-card-title> 77 </v-card-title>
78 <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> 78 <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
79 <v-layout> 79 <v-layout>
80 <v-text-field 80 <v-text-field
81 autofocus 81 autofocus
82 v-model="search" 82 v-model="search"
83 label="Search" 83 label="Search"
84 prepend-inner-icon="search" 84 prepend-inner-icon="search"
85 color="primary" 85 color="primary"
86 ></v-text-field> 86 ></v-text-field>
87 <v-icon @click="closeSearch" color="error">close</v-icon> 87 <v-icon @click="closeSearch" color="error">close</v-icon>
88 </v-layout> 88 </v-layout>
89 </v-flex> 89 </v-flex>
90 </v-toolbar> 90 </v-toolbar>
91 91
92 <v-data-table 92 <v-data-table
93 v-if="showData" 93 v-if="showData"
94 :headers="headers" 94 :headers="headers"
95 :items="examData.students" 95 :items="examData.students"
96 :pagination.sync="pagination" 96 :pagination.sync="pagination"
97 :search="search" 97 :search="search"
98 > 98 >
99 <template slot="items" slot-scope="props"> 99 <template slot="items" slot-scope="props">
100 <tr class="tr"> 100 <tr class="tr">
101 <td class="td td-row">{{ props.index + 1}}</td> 101 <td class="td td-row">{{ props.index + 1}}</td>
102 <td class="text-xs-center td td-row"> 102 <td class="text-xs-center td td-row">
103 <v-avatar size="40"> 103 <v-avatar size="40">
104 <img 104 <img
105 :src="props.item.studentId.profilePicUrl" 105 :src="props.item.studentId.profilePicUrl"
106 v-if="props.item.studentId.profilePicUrl" 106 v-if="props.item.studentId.profilePicUrl"
107 /> 107 />
108 <img src="/static/icon/user.png" v-else-if="!props.item.studentId.profilePicUrl" /> 108 <img src="/static/icon/user.png" v-else-if="!props.item.studentId.profilePicUrl" />
109 </v-avatar> 109 </v-avatar>
110 </td> 110 </td>
111 <td class="td td-row text-xs-center">{{ props.item.studentId.name}}</td> 111 <td class="td td-row text-xs-center">{{ props.item.studentId.name}}</td>
112 <td class="td td-row text-xs-center">{{ props.item.studentId.rollNo}}</td> 112 <td class="td td-row text-xs-center">{{ props.item.studentId.rollNo}}</td>
113 <td class="td td-row text-xs-center">{{ props.item.studentId.email }}</td> 113 <td class="td td-row text-xs-center">{{ props.item.studentId.email }}</td>
114 <td class="td td-row text-xs-center"> 114 <td class="td td-row text-xs-center">
115 <!-- <v-radio-group v-model="isPresent" row> 115 <!-- <v-radio-group v-model="isPresent" row>
116 <v-radio :value="props.item.isPresent"></v-radio> 116 <v-radio :value="props.item.isPresent"></v-radio>
117 </v-radio-group>--> 117 </v-radio-group>-->
118 <v-checkbox 118 <v-checkbox
119 v-model="props.item.isPresent" 119 v-model="props.item.isPresent"
120 @click="markStudentAttendence(props.item)" 120 @click="markStudentAttendence(props.item)"
121 primary 121 primary
122 hide-details 122 hide-details
123 ></v-checkbox> 123 ></v-checkbox>
124 </td> 124 </td>
125 </tr> 125 </tr>
126 </template> 126 </template>
127 <v-alert 127 <v-alert
128 slot="no-results" 128 slot="no-results"
129 :value="true" 129 :value="true"
130 color="error" 130 color="error"
131 icon="warning" 131 icon="warning"
132 >Your search for "{{ search }}" found no results.</v-alert> 132 >Your search for "{{ search }}" found no results.</v-alert>
133 </v-data-table> 133 </v-data-table>
134 134
135 <!-- ****** ADD Student Attendence ****** --> 135 <!-- ****** ADD Student Attendence ****** -->
136 <v-dialog v-model="changeStudentAttendenceDialog" max-width="500px" persistent> 136 <v-dialog v-model="changeStudentAttendenceDialog" max-width="500px" persistent>
137 <v-card flat> 137 <v-card flat>
138 <v-layout class="pa-3 card-style white--text"> 138 <v-layout class="pa-3 card-style white--text">
139 <v-flex xs12> 139 <v-flex xs12>
140 <label class="title text-xs-center">Change Student's Attendence</label> 140 <label class="title text-xs-center">Change Student's Attendence</label>
141 <v-icon 141 <v-icon
142 size="24" 142 size="24"
143 class="right white--text" 143 class="right white--text"
144 @click="changeStudentAttendenceDialog = false" 144 @click="changeStudentAttendenceDialog = false"
145 >cancel</v-icon> 145 >cancel</v-icon>
146 </v-flex> 146 </v-flex>
147 </v-layout> 147 </v-layout>
148 <v-container fluid> 148 <v-container fluid>
149 <v-flex xs12> 149 <v-flex xs12>
150 <h3>Are you sure you want to change the attendence</h3> 150 <h3>Are you sure you want to change the attendence</h3>
151 </v-flex> 151 </v-flex>
152 <v-spacer></v-spacer> 152 <v-spacer></v-spacer>
153 153
154 <v-flex xs12> 154 <v-flex xs12>
155 <v-card-actions> 155 <v-card-actions>
156 <v-spacer></v-spacer> 156 <v-spacer></v-spacer>
157 <v-btn 157 <v-btn
158 @click.native="closeStudentAttendenceDialog" 158 @click.native="closeStudentAttendenceDialog"
159 round 159 round
160 dark 160 dark
161 class="clear-button" 161 class="clear-button"
162 >cancel</v-btn> 162 >cancel</v-btn>
163 <v-btn 163 <v-btn
164 @click="selectParticularStudent" 164 @click="selectParticularStudent"
165 round 165 round
166 dark 166 dark
167 :loading="loading" 167 :loading="loading"
168 class="add-button" 168 class="add-button"
169 >Yes</v-btn> 169 >Yes</v-btn>
170 </v-card-actions> 170 </v-card-actions>
171 </v-flex> 171 </v-flex>
172 </v-container> 172 </v-container>
173 </v-card> 173 </v-card>
174 </v-dialog> 174 </v-dialog>
175 175
176 <!-- ****** ADD Exam Attendence ****** --> 176 <!-- ****** ADD Exam Attendence ****** -->
177 <v-dialog 177 <v-dialog
178 v-model="addExamAttendenceDialog" 178 v-model="addExamAttendenceDialog"
179 max-width="800px" 179 max-width="800px"
180 v-if="addExamAttendenceDialog" 180 v-if="addExamAttendenceDialog"
181 persistent 181 persistent
182 > 182 >
183 <v-card flat> 183 <v-card flat>
184 <v-layout class="pa-3 card-style white--text"> 184 <v-layout class="pa-3 card-style white--text">
185 <v-flex xs12> 185 <v-flex xs12>
186 <label class="title text-xs-center">Add Exam Attendence</label> 186 <label class="title text-xs-center">Add Exam Attendence</label>
187 <v-icon size="24" class="right white--text" @click="closeAttendenceModel">cancel</v-icon> 187 <v-icon size="24" class="right white--text" @click="closeAttendenceModel">cancel</v-icon>
188 </v-flex> 188 </v-flex>
189 </v-layout> 189 </v-layout>
190 <v-form ref="form" v-model="valid" lazy-validation class="text-xs-center"> 190 <v-form ref="form" v-model="valid" lazy-validation class="text-xs-center">
191 <v-container fluid> 191 <v-container fluid>
192 <v-flex xs12> 192 <v-flex xs12>
193 <v-layout> 193 <v-layout>
194 <v-flex xs5 class="pt-4 subheading"> 194 <v-flex xs5 class="pt-4 subheading">
195 <label class="right">Exam Name:</label> 195 <label class="right">Exam Name:</label>
196 </v-flex> 196 </v-flex>
197 <v-flex xs7 sm7 md6 class="ml-3"> 197 <v-flex xs7 sm7 md6 class="ml-3">
198 <v-select 198 <v-select
199 label="Select Exam" 199 label="Select Exam"
200 :rules="examRules" 200 :rules="examRules"
201 :items="examList" 201 :items="examList"
202 v-model="addAttendence.examId" 202 v-model="addAttendence.examId"
203 item-text="examName" 203 item-text="examName"
204 item-value="_id" 204 item-value="_id"
205 ></v-select> 205 ></v-select>
206 </v-flex> 206 </v-flex>
207 </v-layout> 207 </v-layout>
208 </v-flex> 208 </v-flex>
209 <v-flex xs12> 209 <v-flex xs12>
210 <v-layout> 210 <v-layout>
211 <v-flex xs5 class="pt-4 subheading"> 211 <v-flex xs5 class="pt-4 subheading">
212 <label class="right">Class:</label> 212 <label class="right">Class:</label>
213 </v-flex> 213 </v-flex>
214 <v-flex xs7 sm7 md6 class="ml-3"> 214 <v-flex xs7 sm7 md6 class="ml-3">
215 <v-select 215 <v-select
216 v-model="addAttendence.classId" 216 v-model="addAttendence.classId"
217 label="Select Class" 217 label="Select Class"
218 type="text" 218 type="text"
219 :items="classList" 219 :items="classList"
220 item-text="classNum" 220 item-text="classNum"
221 item-value="_id" 221 item-value="_id"
222 :rules="classRules" 222 :rules="classRules"
223 @change="getSections(addAttendence.classId)" 223 @change="getSections(addAttendence.classId)"
224 required 224 required
225 ></v-select> 225 ></v-select>
226 </v-flex> 226 </v-flex>
227 </v-layout> 227 </v-layout>
228 </v-flex> 228 </v-flex>
229 <v-flex xs12> 229 <v-flex xs12>
230 <v-layout> 230 <v-layout>
231 <v-flex xs5 class="pt-4 subheading"> 231 <v-flex xs5 class="pt-4 subheading">
232 <label class="right">Section:</label> 232 <label class="right">Section:</label>
233 </v-flex> 233 </v-flex>
234 <v-flex xs7 sm7 md6 class="ml-3"> 234 <v-flex xs7 sm7 md6 class="ml-3">
235 <v-select 235 <v-select
236 :items="addSection" 236 :items="addSection"
237 label="Select Section" 237 label="Select Section"
238 v-model="addAttendence.sectionId" 238 v-model="addAttendence.sectionId"
239 item-text="name" 239 item-text="name"
240 item-value="_id" 240 item-value="_id"
241 name="Select Section" 241 name="Select Section"
242 :rules="sectionRules" 242 :rules="sectionRules"
243 @change="getClassSubject(addAttendence.classId)" 243 @change="getClassSubject(addAttendence.classId)"
244 required 244 required
245 ></v-select> 245 ></v-select>
246 </v-flex> 246 </v-flex>
247 </v-layout> 247 </v-layout>
248 </v-flex> 248 </v-flex>
249 <v-flex xs12> 249 <v-flex xs12>
250 <v-layout> 250 <v-layout>
251 <v-flex xs5 class="pt-4 subheading"> 251 <v-flex xs5 class="pt-4 subheading">
252 <label class="right">Subject Name:</label> 252 <label class="right">Subject Name:</label>
253 </v-flex> 253 </v-flex>
254 <v-flex xs7 sm7 md6 class="ml-3"> 254 <v-flex xs7 sm7 md6 class="ml-3">
255 <v-select 255 <v-select
256 :items="subjectList.subjects" 256 :items="subjectList.subjects"
257 label="Select Subject" 257 label="Select Subject"
258 item-text="subjectName" 258 item-text="subjectName"
259 v-model="addAttendence.subjectId" 259 v-model="addAttendence.subjectId"
260 item-value="_id" 260 item-value="_id"
261 name="Select Subject" 261 name="Select Subject"
262 :rules="subjectRules" 262 :rules="subjectRules"
263 required 263 required
264 ></v-select> 264 ></v-select>
265 </v-flex> 265 </v-flex>
266 </v-layout> 266 </v-layout>
267 </v-flex> 267 </v-flex>
268 <v-layout> 268 <v-layout>
269 <v-flex xs12> 269 <v-flex xs12>
270 <v-card-actions> 270 <v-card-actions>
271 <v-spacer class="hidden-xs-only"></v-spacer> 271 <v-spacer class="hidden-xs-only"></v-spacer>
272 <v-btn 272 <v-btn
273 round 273 round
274 dark 274 dark
275 @click="showTable" 275 @click="showTable"
276 :loading="loading" 276 :loading="loading"
277 class="add-button" 277 class="add-button"
278 >Attendence</v-btn> 278 >Attendence</v-btn>
279 </v-card-actions> 279 </v-card-actions>
280 </v-flex> 280 </v-flex>
281 </v-layout> 281 </v-layout>
282 </v-container> 282 </v-container>
283 </v-form> 283 </v-form>
284 <v-flex xs12 v-show="attendeceTable" class> 284 <v-flex xs12 v-show="attendeceTable" class>
285 <v-data-table 285 <v-data-table
286 :headers="studentheader" 286 :headers="studentheader"
287 :items="studentsData" 287 :items="studentsData"
288 :pagination.sync="pagination" 288 :pagination.sync="pagination"
289 :search="search" 289 :search="search"
290 select-all 290 select-all
291 v-model="selected" 291 v-model="selected"
292 item-key="_id" 292 item-key="_id"
293 > 293 >
294 <template slot="items" slot-scope="props"> 294 <template slot="items" slot-scope="props">
295 <tr class="tr"> 295 <tr class="tr">
296 <!-- <td class="td td-row">{{ props.index + 1}}</td> --> 296 <!-- <td class="td td-row">{{ props.index + 1}}</td> -->
297 <td class="td td-row"> 297 <td class="td td-row">
298 <v-checkbox 298 <v-checkbox
299 v-model="props.item.attendence" 299 v-model="props.item.attendence"
300 @change="markParticularStudentAttendence(props.item)" 300 @change="markParticularStudentAttendence(props.item)"
301 primary 301 primary
302 hide-details 302 hide-details
303 ></v-checkbox> 303 ></v-checkbox>
304 </td> 304 </td>
305 <td class="text-xs-center td td-row"> 305 <td class="text-xs-center td td-row">
306 <v-avatar size="40"> 306 <v-avatar size="40">
307 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> 307 <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" />
308 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> 308 <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" />
309 </v-avatar> 309 </v-avatar>
310 </td> 310 </td>
311 <td class="td td-row text-xs-center">{{ props.item.name}}</td> 311 <td class="td td-row text-xs-center">{{ props.item.name}}</td>
312 <td class="td td-row text-xs-center">{{ props.item.rollNo}}</td> 312 <td class="td td-row text-xs-center">{{ props.item.rollNo}}</td>
313 <td class="td td-row text-xs-center">{{ props.item.email }}</td> 313 <td class="td td-row text-xs-center">{{ props.item.email }}</td>
314 <!-- <td class="td td-row text-xs-center"> 314 <!-- <td class="td td-row text-xs-center">
315 <v-radio-group v-model="props.item.attendence" :mandatory="false" row> 315 <v-radio-group v-model="props.item.attendence" :mandatory="false" row>
316 <v-radio 316 <v-radio
317 v-for="attendences in attendenceType" 317 v-for="attendences in attendenceType"
318 :key="attendences.value" 318 :key="attendences.value"
319 :label="`${attendences.label}`" 319 :label="`${attendences.label}`"
320 :value="attendences.value" 320 :value="attendences.value"
321 ></v-radio> 321 ></v-radio>
322 </v-radio-group> 322 </v-radio-group>
323 </td>--> 323 </td>-->
324 </tr> 324 </tr>
325 </template> 325 </template>
326 <template slot="headers" slot-scope="props"> 326 <template slot="headers" slot-scope="props">
327 <tr> 327 <tr>
328 <th> 328 <th>
329 <v-checkbox 329 <v-checkbox
330 :input-value="props.all" 330 :input-value="props.all"
331 :indeterminate="props.indeterminate" 331 :indeterminate="props.indeterminate"
332 primary 332 primary
333 hide-details 333 hide-details
334 @click.native="selectAll" 334 @click.native="selectAll"
335 ></v-checkbox> 335 ></v-checkbox>
336 </th> 336 </th>
337 <th 337 <th
338 v-for="header in props.headers" 338 v-for="header in props.headers"
339 :key="header.text" 339 :key="header.text"
340 :class="['column sortable', pagination.descending ? 'desc' : 'asc', header.value === pagination.sortBy ? 'active' : '']" 340 :class="['column sortable', pagination.descending ? 'desc' : 'asc', header.value === pagination.sortBy ? 'active' : '']"
341 @click="changeSort(header.value)" 341 @click="changeSort(header.value)"
342 > 342 >
343 <v-icon small>arrow_upward</v-icon> 343 <v-icon small>arrow_upward</v-icon>
344 {{ header.text }} 344 {{ header.text }}
345 </th> 345 </th>
346 </tr> 346 </tr>
347 </template> 347 </template>
348 <v-alert 348 <v-alert
349 slot="no-results" 349 slot="no-results"
350 :value="true" 350 :value="true"
351 color="error" 351 color="error"
352 icon="warning" 352 icon="warning"
353 >Your search for "{{ search }}" found no results.</v-alert> 353 >Your search for "{{ search }}" found no results.</v-alert>
354 </v-data-table> 354 </v-data-table>
355 <v-flex xs12 sm12> 355 <v-flex xs12 sm12>
356 <v-card-actions> 356 <v-card-actions>
357 <v-spacer></v-spacer> 357 <v-spacer></v-spacer>
358 <v-btn @click="submit()" round dark :loading="loading" class="add-button">Submit</v-btn> 358 <v-btn @click="submit()" round dark :loading="loading" class="add-button">Submit</v-btn>
359 </v-card-actions> 359 </v-card-actions>
360 </v-flex> 360 </v-flex>
361 </v-flex> 361 </v-flex>
362 </v-card> 362 </v-card>
363 </v-dialog> 363 </v-dialog>
364 <v-snackbar 364 <v-snackbar
365 :timeout="timeout" 365 :timeout="timeout"
366 :top="y === 'top'" 366 :top="y === 'top'"
367 :right="x === 'right'" 367 :right="x === 'right'"
368 :vertical="mode === 'vertical'" 368 :vertical="mode === 'vertical'"
369 v-model="snackbar" 369 v-model="snackbar"
370 :color="color" 370 :color="color"
371 >{{ text }}</v-snackbar> 371 >{{ text }}</v-snackbar>
372 <div class="loader" v-if="showLoader"> 372 <div class="loader" v-if="showLoader">
373 <v-progress-circular indeterminate color="white"></v-progress-circular> 373 <v-progress-circular indeterminate color="white"></v-progress-circular>
374 </div> 374 </div>
375 </v-container> 375 </v-container>
376 </template> 376 </template>
377 377
378 <script> 378 <script>
379 import http from "@/Services/http.js"; 379 import http from "@/Services/http.js";
380 import Util from "@/util"; 380 import Util from "@/util";
381 import moment from "moment"; 381 import moment from "moment";
382 382
383 export default { 383 export default {
384 data: () => ({ 384 data: () => ({
385 snackbar: false, 385 snackbar: false,
386 editDate: false, 386 editDate: false,
387 menu1: false, 387 menu1: false,
388 menuB: false, 388 menuB: false,
389 menu2: false, 389 menu2: false,
390 menuEdit: false, 390 menuEdit: false,
391 timeToEdit: false, 391 timeToEdit: false,
392 show: true, 392 show: true,
393 showSearch: false, 393 showSearch: false,
394 addExamAttendenceDialog: false, 394 addExamAttendenceDialog: false,
395 color: "", 395 color: "",
396 y: "top", 396 y: "top",
397 x: "right", 397 x: "right",
398 mode: "", 398 mode: "",
399 timeout: 10000, 399 timeout: 10000,
400 text: "", 400 text: "",
401 loading: false, 401 loading: false,
402 search: "", 402 search: "",
403 showLoader: false, 403 showLoader: false,
404 valid: true, 404 valid: true,
405 role: "", 405 role: "",
406 pagination: { 406 pagination: {
407 rowsPerPage: 10, 407 rowsPerPage: 10,
408 }, 408 },
409 attendeceTable: false, 409 attendeceTable: false,
410 isPresent: true, 410 isPresent: true,
411 411
412 examRules: [(v) => !!v || "Exam Name is required"], 412 examRules: [(v) => !!v || "Exam Name is required"],
413 classRules: [(v) => !!v || "Class Name is required"], 413 classRules: [(v) => !!v || "Class Name is required"],
414 sectionRules: [(v) => !!v || "section is required"], 414 sectionRules: [(v) => !!v || "section is required"],
415 subjectRules: [(v) => !!v || "Subject is required"], 415 subjectRules: [(v) => !!v || "Subject is required"],
416 timeInRules: [(v) => !!v || "Time In is required"], 416 timeInRules: [(v) => !!v || "Time In is required"],
417 timeOutRules: [(v) => !!v || "time Out s is required"], 417 timeOutRules: [(v) => !!v || "time Out s is required"],
418 roomRules: [(v) => !!v || "Room is required"], 418 roomRules: [(v) => !!v || "Room is required"],
419 examScheduleDateRules: [(v) => !!v || "Date is required"], 419 examScheduleDateRules: [(v) => !!v || "Date is required"],
420 studentsData: [], 420 studentsData: [],
421 examData: [], 421 examData: [],
422 students: [], 422 students: [],
423 423
424 headers: [ 424 headers: [
425 { 425 {
426 align: "", 426 align: "",
427 text: "No", 427 text: "No",
428 sortable: false, 428 sortable: false,
429 value: "No", 429 value: "No",
430 }, 430 },
431 { 431 {
432 text: "Profile Pic", 432 text: "Profile Pic",
433 value: "profilePicUrl", 433 value: "profilePicUrl",
434 sortable: false, 434 sortable: false,
435 align: "center", 435 align: "center",
436 }, 436 },
437 { 437 {
438 text: "Name", 438 text: "Name",
439 value: "name", 439 value: "name",
440 sortable: false, 440 sortable: false,
441 align: "center", 441 align: "center",
442 }, 442 },
443 { 443 {
444 text: "Roll No", 444 text: "Roll No",
445 value: "rollNo", 445 value: "rollNo",
446 sortable: false, 446 sortable: false,
447 align: "center", 447 align: "center",
448 }, 448 },
449 { 449 {
450 text: "Email", 450 text: "Email",
451 value: "email", 451 value: "email",
452 sortable: false, 452 sortable: false,
453 align: "center", 453 align: "center",
454 }, 454 },
455 { 455 {
456 text: "Action", 456 text: "Action",
457 value: "isPresent", 457 value: "isPresent",
458 sortable: false, 458 sortable: false,
459 align: "center", 459 align: "center",
460 }, 460 },
461 ], 461 ],
462 studentheader: [ 462 studentheader: [
463 { 463 {
464 text: "Profile Pic", 464 text: "Profile Pic",
465 value: "profilePicUrl", 465 value: "profilePicUrl",
466 sortable: false, 466 sortable: false,
467 align: "center", 467 align: "center",
468 }, 468 },
469 { 469 {
470 text: "Name", 470 text: "Name",
471 value: "name", 471 value: "name",
472 sortable: false, 472 sortable: false,
473 align: "center", 473 align: "center",
474 }, 474 },
475 { 475 {
476 text: "Roll No", 476 text: "Roll No",
477 value: "rollNo", 477 value: "rollNo",
478 sortable: false, 478 sortable: false,
479 align: "center", 479 align: "center",
480 }, 480 },
481 { 481 {
482 text: "Email", 482 text: "Email",
483 value: "email", 483 value: "email",
484 sortable: false, 484 sortable: false,
485 align: "center", 485 align: "center",
486 }, 486 },
487 ], 487 ],
488 attendenceType: [ 488 attendenceType: [
489 { 489 {
490 label: "", 490 label: "",
491 value: true, 491 value: true,
492 }, 492 },
493 ], 493 ],
494 classList: [], 494 classList: [],
495 addSection: [], 495 addSection: [],
496 examList: [], 496 examList: [],
497 subjectList: [], 497 subjectList: [],
498 subjects: [], 498 subjects: [],
499 addAttendence: {}, 499 addAttendence: {},
500 getAttendence: {}, 500 getAttendence: {},
501 editedItem: { 501 editedItem: {
502 sectionId: { 502 sectionId: {
503 name: "", 503 name: "",
504 }, 504 },
505 }, 505 },
506 getScheduleData: {}, 506 getScheduleData: {},
507 ScheduleData: [], 507 ScheduleData: [],
508 token: "", 508 token: "",
509 showData: false, 509 showData: false,
510 selected: [], 510 selected: [],
511 changeStudentAttendenceDialog: false, 511 changeStudentAttendenceDialog: false,
512 closeStudentAttendenceDialog() { 512 closeStudentAttendenceDialog() {
513 this.changeStudentAttendenceDialog = false; 513 this.changeStudentAttendenceDialog = false;
514 }, 514 },
515 selectedStudent: {}, 515 selectedStudent: {},
516 presentStudent: [], 516 presentStudent: [],
517 absentStudent: [], 517 absentStudent: [],
518 }), 518 }),
519 watch: { 519 watch: {
520 addExamAttendenceDialog: function (val) { 520 addExamAttendenceDialog: function (val) {
521 if (!val) { 521 if (!val) {
522 this.studentsData = []; 522 this.studentsData = [];
523 this.selected = []; 523 this.selected = [];
524 this.attendeceTable = false; 524 this.attendeceTable = false;
525 this.valid = false; 525 this.valid = false;
526 this.addAttendence = []; 526 this.addAttendence = [];
527 } 527 }
528 }, 528 },
529 }, 529 },
530 methods: { 530 methods: {
531 pickFile() { 531 pickFile() {
532 this.$refs.image.click(); 532 this.$refs.image.click();
533 }, 533 },
534 markStudentAttendence(item) { 534 markStudentAttendence(item) {
535 this.selectedStudent = { 535 this.selectedStudent = {
536 id: item.studentId._id, 536 id: item.studentId._id,
537 isPresent: !item.isPresent, 537 isPresent: !item.isPresent,
538 }; 538 };
539 this.changeStudentAttendenceDialog = true; 539 this.changeStudentAttendenceDialog = true;
540 }, 540 },
541 getSchedulesList() { 541 getSchedulesList() {
542 this.showLoader = true; 542 this.showLoader = true;
543 http() 543 http()
544 .get("/getSchedulesList", { 544 .get("/getSchedulesList", {
545 params: { classId: this.getScheduleData.classId }, 545 params: { classId: this.getScheduleData.classId },
546 headers: { Authorization: "Bearer " + this.token }, 546 headers: { Authorization: "Bearer " + this.token },
547 }) 547 })
548 .then((response) => { 548 .then((response) => {
549 this.ScheduleData = response.data.data; 549 this.ScheduleData = response.data.data;
550 this.showLoader = false; 550 this.showLoader = false;
551 }) 551 })
552 .catch((error) => { 552 .catch((error) => {
553 // console.log("err====>", err); 553 // console.log("err====>", err);
554 this.showLoader = false; 554 this.showLoader = false;
555 this.loadingSearch = false; 555 this.loadingSearch = false;
556 this.snackbar = true; 556 this.snackbar = true;
557 this.text = error.response.data.message; 557 this.text = error.response.data.message;
558 if (error.response.status === 401) { 558 if (error.response.status === 401) {
559 this.$router.replace({ path: "/" }); 559 this.$router.replace({ path: "/" });
560 this.$store.dispatch("setToken", null); 560 this.$store.dispatch("setToken", null);
561 this.$store.dispatch("Id", null); 561 this.$store.dispatch("Id", null);
562 } 562 }
563 }); 563 });
564 }, 564 },
565 close() { 565 close() {
566 this.dialog = false; 566 this.dialog = false;
567 }, 567 },
568 closeAttendenceModel() { 568 closeAttendenceModel() {
569 this.addExamAttendenceDialog = false; 569 this.addExamAttendenceDialog = false;
570 this.studentsData = []; 570 this.studentsData = [];
571 this.selected = []; 571 this.selected = [];
572 this.attendeceTable = false; 572 this.attendeceTable = false;
573 this.valid = false; 573 this.valid = false;
574 this.addAttendence = []; 574 this.addAttendence = [];
575 }, 575 },
576 submit() { 576 submit() {
577 var examAttendence = { 577 var examAttendence = {
578 examId: this.addAttendence.examId, 578 examId: this.addAttendence.examId,
579 classId: this.addAttendence.classId, 579 classId: this.addAttendence.classId,
580 sectionId: this.addAttendence.sectionId, 580 sectionId: this.addAttendence.sectionId,
581 subjectId: this.addAttendence.subjectId, 581 subjectId: this.addAttendence.subjectId,
582 students: [], 582 students: [],
583 }; 583 };
584 for (var j = 0; j < this.presentStudent.length; j++) { 584 for (var j = 0; j < this.presentStudent.length; j++) {
585 examAttendence.students.push({ 585 examAttendence.students.push({
586 studentId: this.presentStudent[j], 586 studentId: this.presentStudent[j],
587 isPresent: true, 587 isPresent: true,
588 }); 588 });
589 } 589 }
590 for (var j = 0; j < this.absentStudent.length; j++) { 590 for (var j = 0; j < this.absentStudent.length; j++) {
591 examAttendence.students.push({ 591 examAttendence.students.push({
592 studentId: this.absentStudent[j], 592 studentId: this.absentStudent[j],
593 isPresent: false, 593 isPresent: false,
594 }); 594 });
595 } 595 }
596 if (this.$refs.form.validate()) { 596 if (this.$refs.form.validate()) {
597 http() 597 http()
598 .post("/createExamAttendance", examAttendence) 598 .post("/createExamAttendance", examAttendence)
599 .then((response) => { 599 .then((response) => {
600 this.snackbar = true; 600 this.snackbar = true;
601 this.color = "success"; 601 this.color = "success";
602 this.text = "Successfully created exam attendence"; 602 this.text = "Successfully created exam attendence";
603 this.addExamAttendenceDialog = false; 603 this.addExamAttendenceDialog = false;
604 this.studentsData = []; 604 this.studentsData = [];
605 this.selected = []; 605 this.selected = [];
606 this.attendeceTable = false; 606 this.attendeceTable = false;
607 this.valid = false; 607 this.valid = false;
608 this.addAttendence = []; 608 this.addAttendence = [];
609 }) 609 })
610 .catch((error) => { 610 .catch((error) => {
611 this.snackbar = true; 611 this.snackbar = true;
612 this.text = error.response.data.message; 612 this.text = error.response.data.message;
613 }); 613 });
614 } 614 }
615 }, 615 },
616 clear() { 616 clear() {
617 this.$refs.form.reset(); 617 this.$refs.form.reset();
618 this.disable = false; 618 this.disable = false;
619 this.loading = false; 619 this.loading = false;
620 }, 620 },
621 getClass() { 621 getClass() {
622 http() 622 http()
623 .get("/getClassesList", { 623 .get("/getClassesList", {
624 headers: { Authorization: "Bearer " + this.token }, 624 headers: { Authorization: "Bearer " + this.token },
625 }) 625 })
626 .then((response) => { 626 .then((response) => {
627 this.classList = response.data.data; 627 this.classList = response.data.data;
628 }) 628 })
629 .catch((err) => { 629 .catch((err) => {
630 // console.log("err====>", err); 630 // console.log("err====>", err);
631 }); 631 });
632 }, 632 },
633 getSections(_id) { 633 getSections(_id) {
634 for (let i = 0; i < this.classList.length; i++) { 634 for (let i = 0; i < this.classList.length; i++) {
635 if (_id == this.classList[i]._id) { 635 if (_id == this.classList[i]._id) {
636 // this.subjects = this.classList[i].subjects; 636 // this.subjects = this.classList[i].subjects;
637 } 637 }
638 } 638 }
639 this.examData = [];
639 http() 640 http()
640 .get( 641 .get(
641 "/getSectionsList", 642 "/getSectionsList",
642 { params: { classId: _id } }, 643 { params: { classId: _id } },
643 { 644 {
644 headers: { Authorization: "Bearer " + this.token }, 645 headers: { Authorization: "Bearer " + this.token },
645 } 646 }
646 ) 647 )
647 .then((response) => { 648 .then((response) => {
648 this.addSection = response.data.data; 649 this.addSection = response.data.data;
649 }) 650 })
650 .catch((err) => {}); 651 .catch((err) => {});
651 }, 652 },
652 getClassSubject(_id) { 653 getClassSubject(_id) {
653 this.showLoader = true; 654 this.showLoader = true;
654 // this.classId = this.classId; 655 // this.classId = this.classId;
655 http() 656 http()
656 .get( 657 .get(
657 "/getParticularClass", 658 "/getParticularClass",
658 { params: { classId: _id } }, 659 { params: { classId: _id } },
659 { 660 {
660 headers: { Authorization: "Bearer " + this.token }, 661 headers: { Authorization: "Bearer " + this.token },
661 } 662 }
662 ) 663 )
663 .then((response) => { 664 .then((response) => {
664 this.subjectList = response.data.data; 665 this.subjectList = response.data.data;
665 this.showLoader = false; 666 this.showLoader = false;
666 }) 667 })
667 .catch((err) => { 668 .catch((err) => {
668 this.showLoader = false; 669 this.showLoader = false;
669 }); 670 });
670 }, 671 },
671 getExamList() { 672 getExamList() {
672 this.showLoader = true; 673 this.showLoader = true;
673 this.loadingSearch = true; 674 this.loadingSearch = true;
674 http() 675 http()
675 .get("/getExamsList", { 676 .get("/getExamsList", {
676 headers: { Authorization: "Bearer " + this.token }, 677 headers: { Authorization: "Bearer " + this.token },
677 }) 678 })
678 .then((response) => { 679 .then((response) => {
679 this.examList = response.data.data; 680 this.examList = response.data.data;
680 this.showLoader = false; 681 this.showLoader = false;
681 this.loadingSearch = false; 682 this.loadingSearch = false;
682 }) 683 })
683 .catch((error) => { 684 .catch((error) => {
684 this.showLoader = false; 685 this.showLoader = false;
685 this.loadingSearch = false; 686 this.loadingSearch = false;
686 this.snackbar = true; 687 this.snackbar = true;
687 this.text = error.response.data.message; 688 this.text = error.response.data.message;
688 if (error.response.status === 401) { 689 if (error.response.status === 401) {
689 this.$router.replace({ path: "/" }); 690 this.$router.replace({ path: "/" });
690 this.$store.dispatch("setToken", null); 691 this.$store.dispatch("setToken", null);
691 this.$store.dispatch("Id", null); 692 this.$store.dispatch("Id", null);
692 } 693 }
693 }); 694 });
694 }, 695 },
695 showTable() { 696 showTable() {
696 this.attendeceTable = true; 697 this.attendeceTable = true;
697 this.getStudentList(); 698 this.getStudentList();
698 }, 699 },
699 getStudentList() { 700 getStudentList() {
700 this.showLoader = true; 701 this.showLoader = true;
701 http() 702 http()
702 .get("/getStudentWithClass", { 703 .get("/getStudentWithClass", {
703 params: { 704 params: {
704 classId: this.addAttendence.classId, 705 classId: this.addAttendence.classId,
705 sectionId: this.addAttendence.sectionId, 706 sectionId: this.addAttendence.sectionId,
706 }, 707 },
707 }) 708 })
708 .then((response) => { 709 .then((response) => {
709 this.studentsData = response.data.data; 710 this.studentsData = response.data.data;
710 this.showLoader = false; 711 this.showLoader = false;
711 // this.addExamAttendenceDialog = false; 712 // this.addExamAttendenceDialog = false;
712 var attendence = ""; 713 var attendence = "";
713 for (let i = 0; i < this.studentsData.length; i++) { 714 for (let i = 0; i < this.studentsData.length; i++) {
714 this.studentsData[i].attendence = false; 715 this.studentsData[i].attendence = false;
715 } 716 }
716 }) 717 })
717 .catch((err) => { 718 .catch((err) => {
718 // console.log("err====>", err); 719 // console.log("err====>", err);
719 this.showLoader = false; 720 this.showLoader = false;
720 this.snackbar = true; 721 this.snackbar = true;
721 this.color = "error"; 722 this.color = "error";
722 this.text = error.response.data.message; 723 this.text = error.response.data.message;
723 }); 724 });
724 }, 725 },
725 getExamAttendenceList() { 726 getExamAttendenceList() {
726 this.showLoader = true; 727 this.showLoader = true;
727 http() 728 http()
728 .get("/getExamAttendenceList", { 729 .get("/getExamAttendenceList", {
729 params: { 730 params: {
730 examId: this.getAttendence.examId, 731 examId: this.getAttendence.examId,
731 classId: this.getAttendence.classId, 732 classId: this.getAttendence.classId,
732 sectionId: this.getAttendence.sectionId, 733 sectionId: this.getAttendence.sectionId,
733 subjectId: this.getAttendence.subjectId, 734 subjectId: this.getAttendence.subjectId,
734 }, 735 },
735 }) 736 })
736 .then((response) => { 737 .then((response) => {
737 this.examData = response.data.data; 738 this.examData = response.data.data;
738 if (this.examData.length === 0) { 739 if (this.examData.length === 0) {
739 this.showLoader = false; 740 this.showLoader = false;
740 this.snackbar = true; 741 this.snackbar = true;
741 this.text = "No Attendence found!"; 742 this.text = "No Attendence found!";
742 this.color = "error"; 743 this.color = "error";
743 return; 744 return;
744 } 745 }
745 this.examData = this.examData[0]; 746 this.examData = this.examData[0];
746 // if (this.examData.students.length === 0) { 747 // if (this.examData.students.length === 0) {
747 // this.showLoader = false; 748 // this.showLoader = false;
748 // this.snackbar = true; 749 // this.snackbar = true;
749 // this.text = "No Students found!"; 750 // this.text = "No Students found!";
750 // this.color = "error"; 751 // this.color = "error";
751 // return; 752 // return;
752 // } 753 // }
753 this.showData = true; 754 this.showData = true;
754 this.showLoader = false; 755 this.showLoader = false;
755 }) 756 })
756 .catch((error) => { 757 .catch((error) => {
757 // console.log("error", error); 758 // console.log("error", error);
758 this.showLoader = false; 759 this.showLoader = false;
759 this.snackbar = true; 760 this.snackbar = true;
760 this.color = "error"; 761 this.color = "error";
761 this.text = error.response.data.message; 762 this.text = error.response.data.message;
762 }); 763 });
763 }, 764 },
764 markParticularStudentAttendence(selected) { 765 markParticularStudentAttendence(selected) {
765 if (selected.attendence) { 766 if (selected.attendence) {
766 this.selected.push(selected); 767 this.selected.push(selected);
767 } else { 768 } else {
768 for (var i = 0; i < this.selected.length; i++) { 769 for (var i = 0; i < this.selected.length; i++) {
769 if (this.selected[i]._id === selected._id) { 770 if (this.selected[i]._id === selected._id) {
770 this.selected.splice(i, 1); 771 this.selected.splice(i, 1);
771 break; 772 break;
772 } 773 }
773 } 774 }
774 } 775 }
775 let presentIndex = this.presentStudent.indexOf(selected._id); 776 let presentIndex = this.presentStudent.indexOf(selected._id);
776 let absentIndex = this.absentStudent.indexOf(selected._id); 777 let absentIndex = this.absentStudent.indexOf(selected._id);
777 if (presentIndex > -1) { 778 if (presentIndex > -1) {
778 this.presentStudent.splice(presentIndex, 1); 779 this.presentStudent.splice(presentIndex, 1);
779 this.absentStudent.push(selected._id); 780 this.absentStudent.push(selected._id);
780 } else { 781 } else {
781 if (absentIndex > -1) { 782 if (absentIndex > -1) {
782 this.absentStudent.splice(absentIndex, 1); 783 this.absentStudent.splice(absentIndex, 1);
783 } 784 }
784 this.presentStudent.push(selected._id); 785 this.presentStudent.push(selected._id);
785 } 786 }
786 }, 787 },
787 selectAll() { 788 selectAll() {
788 let markAbsent = false; 789 let markAbsent = false;
789 if (this.selected.length === this.studentsData.length) markAbsent = true; 790 if (this.selected.length === this.studentsData.length) markAbsent = true;
790 791
791 this.presentStudent = []; 792 this.presentStudent = [];
792 this.absentStudent = []; 793 this.absentStudent = [];
793 this.selected = []; 794 this.selected = [];
794 795
795 for (let i = 0; i < this.studentsData.length; i++) { 796 for (let i = 0; i < this.studentsData.length; i++) {
796 if (markAbsent) { 797 if (markAbsent) {
797 this.studentsData[i].attendence = false; 798 this.studentsData[i].attendence = false;
798 this.absentStudent.push(this.studentsData[i]._id); 799 this.absentStudent.push(this.studentsData[i]._id);
799 } else { 800 } else {
800 this.studentsData[i].attendence = true; 801 this.studentsData[i].attendence = true;
801 this.presentStudent.push(this.studentsData[i]._id); 802 this.presentStudent.push(this.studentsData[i]._id);
802 this.selected.push(this.studentsData[i]); 803 this.selected.push(this.studentsData[i]);
803 } 804 }
804 } 805 }
805 }, 806 },
806 selectParticularStudent(_id) { 807 selectParticularStudent(_id) {
807 var payload = { 808 var payload = {
808 examAttendanceId: this.examData._id, 809 examAttendanceId: this.examData._id,
809 studentId: this.selectedStudent.id, 810 studentId: this.selectedStudent.id,
810 isPresent: this.selectedStudent.isPresent, 811 isPresent: this.selectedStudent.isPresent,
811 }; 812 };
812 813
813 http() 814 http()
814 .put("/updateExamAttendance", payload) 815 .put("/updateExamAttendance", payload)
815 .then((response) => { 816 .then((response) => {
816 this.snackbar = true; 817 this.snackbar = true;
817 this.color = "success"; 818 this.color = "success";
818 this.text = "Successfully change attendence"; 819 this.text = "Successfully change attendence";
819 this.changeStudentAttendenceDialog = false; 820 this.changeStudentAttendenceDialog = false;
820 this.selectedStudent = {}; 821 this.selectedStudent = {};
821 this.getExamAttendenceList(); 822 this.getExamAttendenceList();
822 }) 823 })
823 .catch((error) => { 824 .catch((error) => {
824 this.snackbar = true; 825 this.snackbar = true;
825 this.text = error.response.data.message; 826 this.text = error.response.data.message;
826 }); 827 });
827 }, 828 },
828 changeSort(column) { 829 changeSort(column) {
829 if (this.pagination.sortBy === column) { 830 if (this.pagination.sortBy === column) {
830 this.pagination.descending = !this.pagination.descending; 831 this.pagination.descending = !this.pagination.descending;
831 } else { 832 } else {
832 this.pagination.sortBy = column; 833 this.pagination.sortBy = column;
833 this.pagination.descending = false; 834 this.pagination.descending = false;
834 } 835 }
835 }, 836 },
836 displaySearch() { 837 displaySearch() {
837 (this.show = false), (this.showSearch = true); 838 (this.show = false), (this.showSearch = true);
838 }, 839 },
839 closeSearch() { 840 closeSearch() {
840 this.showSearch = false; 841 this.showSearch = false;
841 this.show = true; 842 this.show = true;
842 this.search = ""; 843 this.search = "";
843 }, 844 },
844 }, 845 },
845 mounted() { 846 mounted() {
846 this.token = this.$store.state.token; 847 this.token = this.$store.state.token;
847 this.getClass(); 848 this.getClass();
848 this.getExamList(); 849 this.getExamList();
849 this.role = this.$store.state.role; 850 this.role = this.$store.state.role;
850 }, 851 },
851 }; 852 };
852 </script> 853 </script>