From 3f7b851676c581bd793d651334dc8abcfd071145 Mon Sep 17 00:00:00 2001 From: Amber Dev Date: Sat, 11 Jul 2020 21:45:09 +0530 Subject: [PATCH] added announcements --- src/Services/GetApis.js | 2 +- src/pages/Dashboard/Announcement.vue | 379 ++++++++++++++++ src/pages/Dashboard/CourseDetails.vue | 1 + src/pages/Dashboard/CourseDiscussionForum.vue | 8 +- src/pages/Dashboard/dashboard.vue | 619 +++++++++++++------------- 5 files changed, 706 insertions(+), 303 deletions(-) diff --git a/src/Services/GetApis.js b/src/Services/GetApis.js index 5598ae4..016c214 100644 --- a/src/Services/GetApis.js +++ b/src/Services/GetApis.js @@ -40,7 +40,7 @@ export default { async getCourseDiscussionesList(params) { try { let response = await this.getMethod("/getCourseDiscussionesList", { - courseId: params.courseId, + // courseId: params.courseId, classId: params.classId, }) this.courseDiscussionItems = response.data.data diff --git a/src/pages/Dashboard/Announcement.vue b/src/pages/Dashboard/Announcement.vue index e69de29..10d9b14 100644 --- a/src/pages/Dashboard/Announcement.vue +++ b/src/pages/Dashboard/Announcement.vue @@ -0,0 +1,379 @@ + + + \ No newline at end of file diff --git a/src/pages/Dashboard/CourseDetails.vue b/src/pages/Dashboard/CourseDetails.vue index 715ebeb..5752845 100644 --- a/src/pages/Dashboard/CourseDetails.vue +++ b/src/pages/Dashboard/CourseDetails.vue @@ -33,6 +33,7 @@
diff --git a/src/pages/Dashboard/CourseDiscussionForum.vue b/src/pages/Dashboard/CourseDiscussionForum.vue index 921ab6b..8a09734 100644 --- a/src/pages/Dashboard/CourseDiscussionForum.vue +++ b/src/pages/Dashboard/CourseDiscussionForum.vue @@ -302,7 +302,7 @@ export default { this.imageUrl = ""; } }, - submit() { + async submit() { if (this.$refs.form.validate()) { this.addForumParams.classId = localStorage.getItem("parentClassId"); this.addForumParams.courseId = this.$route.query.courseId; @@ -331,6 +331,12 @@ export default { this.color = "error"; this.loading = false; }); + /* getCourseDiscussionesList - to populate the data table */ + await this.getCourseDiscussionesList({ + courseId: this.$route.query.courseId, + classId: localStorage.getItem("parentClassId") + }); + this.addForumDialog = false; } }, clear() { diff --git a/src/pages/Dashboard/dashboard.vue b/src/pages/Dashboard/dashboard.vue index 5338d33..da6cec2 100644 --- a/src/pages/Dashboard/dashboard.vue +++ b/src/pages/Dashboard/dashboard.vue @@ -68,138 +68,215 @@ X - - - + + + - - - - - - - - Students - icons - {{ students.length }} - - - - - - - - Teachers - icons + + + + {{ teachers.length }} + + + --> + + + + +

You have no student registered with school

+ + + -

You have no student registered with scholl

- - - - - - - + >--> +

+ Notice +

+ + + + +
+ + + + + + + + +

- Notice + Latest Annoucements

{{ date(props.item.created) }}
- {{ props.item.title}} + {{ props.item.discussionType}} - {{ props.item.description}} - View @@ -238,181 +312,102 @@
- - - - - - - - - -

- Latest Annoucements -

+
+ + +

+ Online User +

- - - -
+ + + + +
+
+
+
+ + + + + +

+ Profile +

+ + + + + - - -

- Online User -

- - - - -
+ +

+ {{ userData.name }} +

+

{{ userData.email }}

+

{{ userData.mobile }}

+
{{ userData.address }}
-
-
- - + +
+
Calender
+ + + -

- Profile -

- - - - - - - -

- {{ userData.name }} -

-

{{ userData.email }}

-

{{ userData.mobile }}

-
{{ userData.address }}
-
-
-
-
-
Calender
- - - - - Latest Activity -
- -
-
{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}
-
{{activity.meetingEvent.title}}
-
-
-
-
+ Latest Activity +
+ +
+
{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}
+
{{activity.meetingEvent.title}}
+
+
-
-
+ + + @@ -777,19 +772,39 @@ export default { }, getUserData() { // this.showLoader = true; - http() - .get("/getParticularUserDetail", { - headers: { - Authorization: "Bearer " + this.token - } - }) - .then(response => { - this.userData = response.data.data; - this.showLoader = false; - }) - .catch(error => { - this.showLoader = false; - }); + if (this.$store.state.role === "PARENT") { + http() + .get("/getParticularUserDetail", { + headers: { + Authorization: "Bearer " + this.token + }, + params: { + studentId: localStorage.getItem("parentStudentId") + } + }) + .then(response => { + this.userData = response.data.data; + this.showLoader = false; + console.log("sdsdfsdfsd - ", response); + }) + .catch(error => { + this.showLoader = false; + }); + } else { + http() + .get("/getParticularUserDetail", { + headers: { + Authorization: "Bearer " + this.token + } + }) + .then(response => { + this.userData = response.data.data; + this.showLoader = false; + }) + .catch(error => { + this.showLoader = false; + }); + } }, getFeesAndCollectionsData() { @@ -904,7 +919,9 @@ export default { /* set activityEvents array to highlight event dates in calender */ for (var i = 0; i < this.activityList.length; i++) { let obj = {}; - obj.date = moment(this.activityList[i].meetingEvent.dateOfEvent).format("YYYY/MM/DD");; + obj.date = moment(this.activityList[i].meetingEvent.dateOfEvent).format( + "YYYY/MM/DD" + ); obj.title = this.activityList[i].meetingEvent.title; this.activityEvents.push(obj); } -- 2.0.0