Commit ef672f260c0ff24072fd8bb90755977d804fd96a
1 parent
fe0d05d297
Exists in
master
and in
3 other branches
add file name in notice board,sayllbus ,assignement.
Showing
3 changed files
with
16 additions
and
7 deletions
Show diff stats
src/pages/Academic/assignment.vue
... | ... | @@ -497,7 +497,6 @@ import moment from "moment"; |
497 | 497 | import jsPDF from "jspdf"; |
498 | 498 | import { saveAs } from "file-saver"; |
499 | 499 | |
500 | - | |
501 | 500 | export default { |
502 | 501 | data: () => ({ |
503 | 502 | snackbar: false, |
... | ... | @@ -667,7 +666,8 @@ export default { |
667 | 666 | classId: this.addAssignment.classId, |
668 | 667 | sectionId: this.addAssignment.sectionId, |
669 | 668 | subjectName: this.addAssignment.subjectName, |
670 | - file: this.addAssignment.imageName | |
669 | + file: this.addAssignment.imageName, | |
670 | + fileName: this.imageName | |
671 | 671 | }; |
672 | 672 | var signatures = { |
673 | 673 | JVBERi0: "other", |
... | ... | @@ -696,12 +696,12 @@ export default { |
696 | 696 | http() |
697 | 697 | .post("/createAssignment", addAssignment) |
698 | 698 | .then(response => { |
699 | + this.getAssignmentList(); | |
699 | 700 | this.snackbar = true; |
700 | 701 | this.text = "Syllabus added successfully"; |
701 | - this.clear(); | |
702 | 702 | this.color = "green"; |
703 | 703 | this.addAssignmentDialog = false; |
704 | - this.getAssignmentList(); | |
704 | + this.clear(); | |
705 | 705 | }) |
706 | 706 | .catch(error => { |
707 | 707 | // console.log(error); |
... | ... | @@ -712,6 +712,9 @@ export default { |
712 | 712 | } |
713 | 713 | }, |
714 | 714 | getAssignmentList() { |
715 | + if (this.addAssignment.classId) { | |
716 | + this.addAssignment.classId = this.addAssignment.classId; | |
717 | + } | |
715 | 718 | this.showLoader = true; |
716 | 719 | http() |
717 | 720 | .get( |
... | ... | @@ -754,7 +757,8 @@ export default { |
754 | 757 | classId: this.addAssignment.classId, |
755 | 758 | sectionId: this.addAssignment.sectionId, |
756 | 759 | subjectName: this.addAssignment.subjectName, |
757 | - file: this.addAssignment.imageName | |
760 | + file: this.addAssignment.imageName, | |
761 | + fileName: this.imageName | |
758 | 762 | }; |
759 | 763 | this.editLoading = true; |
760 | 764 | var signatures = { |
... | ... | @@ -864,6 +868,7 @@ export default { |
864 | 868 | this.imageFile = files[0]; // this is an image file that can be sent to server... |
865 | 869 | this.imageData.imageUrl = URL.createObjectURL(this.imageFile); |
866 | 870 | }); |
871 | + console.log("this.imageName", this.imageName); | |
867 | 872 | } else { |
868 | 873 | this.imageName = ""; |
869 | 874 | this.imageFile = ""; | ... | ... |
src/pages/Academic/syllabus.vue
... | ... | @@ -534,6 +534,7 @@ export default { |
534 | 534 | const [baseUrl, imageUrl] = str.split(/,/); |
535 | 535 | this.addSyllabus.upload = imageUrl; |
536 | 536 | this.addSyllabus.fileType = detectMimeType(imageUrl); |
537 | + this.addSyllabus.fileName = this.imageName; | |
537 | 538 | } |
538 | 539 | http() |
539 | 540 | .post("/createSyallabus", this.addSyllabus) |
... | ... | @@ -586,7 +587,8 @@ export default { |
586 | 587 | title: this.editedItem.title, |
587 | 588 | description: this.editedItem.description, |
588 | 589 | upload: this.editedItem.upload, |
589 | - fileType: this.editedItem.fileType | |
590 | + fileType: this.editedItem.fileType, | |
591 | + fileName: this.imageName | |
590 | 592 | }; |
591 | 593 | this.editLoading = true; |
592 | 594 | var signatures = { | ... | ... |
src/pages/NoticeBoard/noticeBoard.vue
... | ... | @@ -513,6 +513,7 @@ export default { |
513 | 513 | const [baseUrl, imageUrl] = str.split(/,/); |
514 | 514 | this.addNoticeBoard.upload = imageUrl; |
515 | 515 | this.addNoticeBoard.fileType = detectMimeType(imageUrl); |
516 | + this.addNoticeBoard.fileName = this.imageName | |
516 | 517 | } |
517 | 518 | http() |
518 | 519 | .post("/createEvent", this.addNoticeBoard) |
... | ... | @@ -561,7 +562,8 @@ export default { |
561 | 562 | let editNoticeBoard = { |
562 | 563 | eventId: this.editedItem._id, |
563 | 564 | title: this.editedItem.title, |
564 | - description: this.editedItem.description | |
565 | + description: this.editedItem.description, | |
566 | + fileName: this.imageName | |
565 | 567 | }; |
566 | 568 | var signatures = { |
567 | 569 | JVBERi0: "other", | ... | ... |