Commit 01a4a5246d77ebe4d7c0095b3b91f9d95bd9bf3c
1 parent
2f9211c744
Exists in
master
and in
2 other branches
When the modal was closed, the data to be displayed was also deleted is corrected
Showing
8 changed files
with
65 additions
and
40 deletions
Show diff stats
src/pages/Academic/assignment.vue
src/pages/Academic/syllabus.vue
src/pages/Attendence/studentAttendence.vue
src/pages/Course/course.vue
src/pages/Course/courseDetail.vue
... | ... | @@ -873,6 +873,7 @@ export default { |
873 | 873 | addChapterItem: {}, |
874 | 874 | addChapterItemObj: {}, |
875 | 875 | addChapterDialog: false, |
876 | + showData: false, | |
876 | 877 | }), |
877 | 878 | methods: { |
878 | 879 | getCourses(classId) { |
... | ... | @@ -904,6 +905,14 @@ export default { |
904 | 905 | }) |
905 | 906 | .then((response) => { |
906 | 907 | this.CourseDetailsList = response.data.data; |
908 | + if (this.CourseDetailsList.length === 0) { | |
909 | + this.showLoader = false; | |
910 | + this.snackbar = true; | |
911 | + this.text = "Data not found!"; | |
912 | + this.color = "error"; | |
913 | + return; | |
914 | + } | |
915 | + this.showData = true; | |
907 | 916 | if (response.data.data[0]) { |
908 | 917 | this.chapters = response.data.data[0].chapters; |
909 | 918 | } | ... | ... |
src/pages/Course/courseDiscussion.vue
... | ... | @@ -156,7 +156,13 @@ |
156 | 156 | </v-card-title> |
157 | 157 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
158 | 158 | <v-layout> |
159 | - <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | |
159 | + <v-text-field | |
160 | + autofocus | |
161 | + v-model="search" | |
162 | + label="Search" | |
163 | + prepend-inner-icon="search" | |
164 | + color="primary" | |
165 | + ></v-text-field> | |
160 | 166 | <v-icon @click="closeSearch" color="error">close</v-icon> |
161 | 167 | </v-layout> |
162 | 168 | </v-flex> |
... | ... | @@ -218,7 +224,7 @@ |
218 | 224 | :right="x === 'right'" |
219 | 225 | :vertical="mode === 'vertical'" |
220 | 226 | v-model="snackbar" |
221 | - color="success" | |
227 | + :color="color" | |
222 | 228 | >{{ text }}</v-snackbar> |
223 | 229 | <div class="loader" v-if="showLoader"> |
224 | 230 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
... | ... | @@ -238,6 +244,7 @@ export default { |
238 | 244 | mode: "", |
239 | 245 | timeout: 3000, |
240 | 246 | text: "", |
247 | + color: "", | |
241 | 248 | show: true, |
242 | 249 | showSearch: false, |
243 | 250 | showLoader: false, |
... | ... | @@ -246,35 +253,35 @@ export default { |
246 | 253 | search: "", |
247 | 254 | addclass: [], |
248 | 255 | pagination: { |
249 | - rowsPerPage: 10 | |
256 | + rowsPerPage: 10, | |
250 | 257 | }, |
251 | 258 | headers: [ |
252 | 259 | { |
253 | 260 | text: "Image", |
254 | 261 | value: "subjattachementUrlect", |
255 | 262 | sortable: false, |
256 | - align: "center" | |
263 | + align: "center", | |
257 | 264 | }, |
258 | 265 | { |
259 | 266 | text: "Discussion", |
260 | 267 | value: "subject", |
261 | 268 | sortable: false, |
262 | - align: "center" | |
269 | + align: "center", | |
263 | 270 | }, |
264 | 271 | { text: "Started", value: "studentId", sortable: false, align: "center" }, |
265 | 272 | { |
266 | 273 | text: "Last Post", |
267 | 274 | value: "forumThread", |
268 | 275 | sortable: false, |
269 | - align: "center" | |
276 | + align: "center", | |
270 | 277 | }, |
271 | 278 | { text: "replies", value: "email", sortable: false, align: "center" }, |
272 | - { text: "Action", value: "", sortable: false, align: "center" } | |
279 | + { text: "Action", value: "", sortable: false, align: "center" }, | |
273 | 280 | ], |
274 | 281 | token: "", |
275 | 282 | selectStudents: { |
276 | 283 | select: "", |
277 | - selectSection: "" | |
284 | + selectSection: "", | |
278 | 285 | }, |
279 | 286 | |
280 | 287 | role: "", |
... | ... | @@ -293,7 +300,8 @@ export default { |
293 | 300 | editiImageFile: "", |
294 | 301 | editImageName: "", |
295 | 302 | editImageUrl: "", |
296 | - editLoading: false | |
303 | + editLoading: false, | |
304 | + showData: false, | |
297 | 305 | }), |
298 | 306 | methods: { |
299 | 307 | // save(date) { |
... | ... | @@ -326,12 +334,12 @@ export default { |
326 | 334 | getAllClass() { |
327 | 335 | http() |
328 | 336 | .get("/getClassesList", { |
329 | - headers: { Authorization: "Bearer " + this.token } | |
337 | + headers: { Authorization: "Bearer " + this.token }, | |
330 | 338 | }) |
331 | - .then(response => { | |
339 | + .then((response) => { | |
332 | 340 | this.addclass = response.data.data; |
333 | 341 | }) |
334 | - .catch(error => { | |
342 | + .catch((error) => { | |
335 | 343 | // console.log("err====>", err); |
336 | 344 | // this.$router.replace({ path: "/" }); |
337 | 345 | }); |
... | ... | @@ -341,14 +349,14 @@ export default { |
341 | 349 | http() |
342 | 350 | .get("/getCourseesList", { |
343 | 351 | params: { |
344 | - classId: classId | |
345 | - } | |
352 | + classId: classId, | |
353 | + }, | |
346 | 354 | }) |
347 | - .then(response => { | |
355 | + .then((response) => { | |
348 | 356 | this.courseData = response.data.data; |
349 | 357 | this.showLoader = false; |
350 | 358 | }) |
351 | - .catch(err => { | |
359 | + .catch((err) => { | |
352 | 360 | console.log("err====>", err); |
353 | 361 | this.showLoader = false; |
354 | 362 | }); |
... | ... | @@ -358,14 +366,14 @@ export default { |
358 | 366 | http() |
359 | 367 | .get("/getCourseesList", { |
360 | 368 | params: { |
361 | - classId: classId | |
362 | - } | |
369 | + classId: classId, | |
370 | + }, | |
363 | 371 | }) |
364 | - .then(response => { | |
372 | + .then((response) => { | |
365 | 373 | this.editCourseData = response.data.data; |
366 | 374 | this.showLoader = false; |
367 | 375 | }) |
368 | - .catch(err => { | |
376 | + .catch((err) => { | |
369 | 377 | console.log("err====>", err); |
370 | 378 | this.showLoader = false; |
371 | 379 | }); |
... | ... | @@ -377,15 +385,23 @@ export default { |
377 | 385 | .get("/getCourseDiscussionesList", { |
378 | 386 | params: { |
379 | 387 | classId: this.getSelectedData.classId, |
380 | - courseId: id | |
381 | - } | |
388 | + courseId: id, | |
389 | + }, | |
382 | 390 | }) |
383 | - .then(response => { | |
391 | + .then((response) => { | |
384 | 392 | // console.log("response", response.data.data); |
385 | 393 | this.courseDiscussionData = response.data.data; |
394 | + if (this.courseDiscussionData.length === 0) { | |
395 | + this.showLoader = false; | |
396 | + this.snackbar = true; | |
397 | + this.text = "Data not found!"; | |
398 | + this.color = "error"; | |
399 | + return; | |
400 | + } | |
401 | + this.showData = true; | |
386 | 402 | this.showLoader = false; |
387 | 403 | }) |
388 | - .catch(error => { | |
404 | + .catch((error) => { | |
389 | 405 | console.log("err====>", error); |
390 | 406 | this.showLoader = false; |
391 | 407 | }); |
... | ... | @@ -393,7 +409,7 @@ export default { |
393 | 409 | rowCourseDiscussion(id) { |
394 | 410 | this.$router.push({ |
395 | 411 | name: "Course Discussiones Fourm", |
396 | - params: { discussionId: id } | |
412 | + params: { discussionId: id }, | |
397 | 413 | }); |
398 | 414 | }, |
399 | 415 | editItem(item) { |
... | ... | @@ -408,7 +424,7 @@ export default { |
408 | 424 | courseId: this.editedItem.courseId, |
409 | 425 | studentId: this.editedItem.studentId._id, |
410 | 426 | subject: this.editedItem.subject, |
411 | - description: this.editedItem.description | |
427 | + description: this.editedItem.description, | |
412 | 428 | }; |
413 | 429 | if (this.editedItem.classId._id) { |
414 | 430 | editCourseDiscuss.classId = this.editedItem.classId._id; |
... | ... | @@ -424,7 +440,7 @@ export default { |
424 | 440 | this.editLoading = true; |
425 | 441 | http() |
426 | 442 | .put("/updateCourseDiscussion", editCourseDiscuss) |
427 | - .then(response => { | |
443 | + .then((response) => { | |
428 | 444 | this.snackbar = true; |
429 | 445 | this.text = response.data.message; |
430 | 446 | this.color = "green"; |
... | ... | @@ -433,7 +449,7 @@ export default { |
433 | 449 | this.editDialog = false; |
434 | 450 | this.editLoading = false; |
435 | 451 | }) |
436 | - .catch(error => { | |
452 | + .catch((error) => { | |
437 | 453 | this.editLoading = false; |
438 | 454 | this.snackbar = true; |
439 | 455 | this.text = error.response.data.statusText; |
... | ... | @@ -442,22 +458,22 @@ export default { |
442 | 458 | }, |
443 | 459 | deleteItem(item) { |
444 | 460 | let deleteCourseDiscussion = { |
445 | - courseDiscussionId: item._id | |
461 | + courseDiscussionId: item._id, | |
446 | 462 | }; |
447 | 463 | http() |
448 | 464 | .delete( |
449 | 465 | "/deleteCourseDiscussion", |
450 | 466 | confirm("Are you sure you want to delete this?") && { |
451 | - params: deleteCourseDiscussion | |
467 | + params: deleteCourseDiscussion, | |
452 | 468 | } |
453 | 469 | ) |
454 | - .then(response => { | |
470 | + .then((response) => { | |
455 | 471 | this.snackbar = true; |
456 | 472 | this.text = response.data.message; |
457 | 473 | this.color = "green"; |
458 | 474 | this.getCourseDiscussionTable(); |
459 | 475 | }) |
460 | - .catch(error => { | |
476 | + .catch((error) => { | |
461 | 477 | this.snackbar = true; |
462 | 478 | this.text = error.response.data.message; |
463 | 479 | this.color = "error"; |
... | ... | @@ -471,14 +487,14 @@ export default { |
471 | 487 | this.showSearch = false; |
472 | 488 | this.show = true; |
473 | 489 | this.search = ""; |
474 | - } | |
490 | + }, | |
475 | 491 | }, |
476 | 492 | mounted() { |
477 | 493 | // this.getStudentList(); |
478 | 494 | this.token = this.$store.state.token; |
479 | 495 | this.role = this.$store.state.role; |
480 | 496 | this.getAllClass(); |
481 | - } | |
497 | + }, | |
482 | 498 | }; |
483 | 499 | </script> |
484 | 500 | ... | ... |
src/pages/Payroll/hourlyTemplate.vue
src/pages/Payroll/salaryTemplate.vue