From 11d037abedea4eef2309320b7dcfaaa4486c8d7d Mon Sep 17 00:00:00 2001 From: Neeraj Sharma Date: Tue, 7 Jul 2020 11:15:55 +0530 Subject: [PATCH] commit code --- src/Services/http.js | 2 +- src/api/menu.js | 9 +- src/components/pageHeader/AppDrawer.vue | 97 ++++ src/components/pageHeader/AppToolbar.vue | 16 +- src/event.js | 7 + src/pages/Authentication/Login.vue | 5 + src/pages/Course/course.vue | 4 +- src/pages/Course/courseDetail.vue | 835 ++++++++++++++++++++++++++++ src/pages/Course/enrollStudents.vue | 23 +- src/pages/Dashboard/dashboard.vue | 222 +++++++- src/pages/Report/idCard.vue | 125 +++-- src/pages/Report/progressCardReport.vue | 18 +- src/pages/Students/students.vue | 40 +- src/pages/changeStudents/changeStudents.vue | 113 ++++ src/router/paths.js | 24 + 15 files changed, 1442 insertions(+), 98 deletions(-) create mode 100644 src/pages/Course/courseDetail.vue create mode 100644 src/pages/changeStudents/changeStudents.vue diff --git a/src/Services/http.js b/src/Services/http.js index c02569a..730dcdb 100644 --- a/src/Services/http.js +++ b/src/Services/http.js @@ -1,7 +1,7 @@ import axios from 'axios' import store from '@/store/store' -const baseDomain = "http://15.206.52.174:8001/v1"; +const baseDomain = "https://api-dashboard.intrack.in/v1"; const baseURL = `${baseDomain}`; // var token = "" diff --git a/src/api/menu.js b/src/api/menu.js index a042fe8..f3e3cea 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -311,7 +311,7 @@ const teacherMenu = [{ items: [ { name: 'Course', title: 'Course', component: 'Course', action: '', }, { name: 'Enroll Students', title: 'Enroll Students', component: 'Enroll Students', action: '', }, - // { name: 'Assignment', title: 'Assignment', component: 'Assignment', action: '', }, + { name: 'Course Detail', title: 'Course Detail', component: 'Course Detail', action: '', }, // { name: 'Routine', title: 'Routine', component: 'Routine', action: '', }, ] }, @@ -381,6 +381,11 @@ const teacherMenu = [{ } ]; +const parentMenu = [{ + title: 'Dashboard', + name: 'Dashboard', + icon: '/static/icon/dashboard.png', +}]; // reorder menu // Menu.forEach((item) => { // if (item.items) { @@ -392,4 +397,4 @@ const teacherMenu = [{ // } // }); -export default { adminMenu, schoolMenu, teacherMenu, libraryMenu, accountMenu }; \ No newline at end of file +export default { adminMenu, schoolMenu, teacherMenu, libraryMenu, accountMenu, parentMenu }; \ No newline at end of file diff --git a/src/components/pageHeader/AppDrawer.vue b/src/components/pageHeader/AppDrawer.vue index 4a04e4f..7536bd3 100644 --- a/src/components/pageHeader/AppDrawer.vue +++ b/src/components/pageHeader/AppDrawer.vue @@ -486,6 +486,98 @@ + @@ -512,6 +604,7 @@ export default { menuTeacher: [], menuAccount: [], menuLibrarian: [], + menuParent: [], schoolRole: "", role: "", scrollSettings: { @@ -538,6 +631,7 @@ export default { this.menuTeacher = menu.teacherMenu; this.menuAccount = menu.accountMenu; this.menuLibrarian = menu.libraryMenu; + this.menuParent = menu.parentMenu; // console.log("this.$route.name", this.$route.name); // if (this.$route.name === "School") { // localStorage.setItem("SchoolName", this.$route.name); @@ -599,6 +693,9 @@ export default { if (this.$store.state.role === "LIBRARIAN") { this.token = this.$store.state.token; } + if (this.$store.state.role === "PARENT") { + this.token = this.$store.state.token; + } } }; diff --git a/src/components/pageHeader/AppToolbar.vue b/src/components/pageHeader/AppToolbar.vue index 029f5bd..0668079 100644 --- a/src/components/pageHeader/AppToolbar.vue +++ b/src/components/pageHeader/AppToolbar.vue @@ -19,9 +19,9 @@ Towards School! - + @@ -97,6 +97,18 @@ export default { mounted() { // this.getUserData(); this.adminRole = this.$store.state.role; + if (this.adminRole == "PARENT") { + var obj = {}; + obj = { + icon: "face", + href: "/changeStudents", + title: "Change Student", + click: e => { + console.log(e); + } + }; + this.items.push(obj); + } // console.log("this.adminRole", this.adminRole); this.SchoolRole = this.$store.state.schoolRole; }, diff --git a/src/event.js b/src/event.js index 9634f6f..5f8c5f0 100644 --- a/src/event.js +++ b/src/event.js @@ -45,6 +45,13 @@ export default [{ this.$store.dispatch('setSchoolToken', null) this.$store.dispatch('setSchoolRole', null) this.$router.replace({ path: '/' }); + } else if (this.$store.state.role === "PARENT") { + this.$store.dispatch('setToken', null) + this.$store.dispatch('Id', null) + this.$store.dispatch('Role', null) + this.$store.dispatch('setSchoolToken', null) + this.$store.dispatch('setSchoolRole', null) + this.$router.replace({ path: '/' }); } } }, diff --git a/src/pages/Authentication/Login.vue b/src/pages/Authentication/Login.vue index f630912..230fe54 100644 --- a/src/pages/Authentication/Login.vue +++ b/src/pages/Authentication/Login.vue @@ -143,6 +143,11 @@ export default { this.$store.dispatch("Id", response.data.data.id); this.$store.dispatch("Role", response.data.data.role); this.$router.push("/dashboard"); + } else if (response.data.data.role === "PARENT") { + this.$store.dispatch("setToken", response.data.data.token); + this.$store.dispatch("Id", response.data.data.id); + this.$store.dispatch("Role", response.data.data.role); + this.$router.push("/dashboard"); } }) .catch(error => { diff --git a/src/pages/Course/course.vue b/src/pages/Course/course.vue index 6b31354..ffb37f6 100644 --- a/src/pages/Course/course.vue +++ b/src/pages/Course/course.vue @@ -299,8 +299,8 @@ xs12 class="text-xs-center text-sm-center text-md-center text-lg-center" > - - + + + + + + + + + + cancel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cancel + + + + + + + + + Save + + + + Save + + + + + + + + + + + + + + + + cancel + + + + + + + + +
+ Chapter Name: +
+
+ +
{{ editedItem.chapterName }}
+
+
+ + +
+ Description: +
+
+ +
{{ editedItem.description }}
+
+
+ + +
+ You Tube Link Url: +
+
+ +
+
    +
  • {{ chapterPoint}}
  • +
+
+
+
+
+
+
+
+
+
+ + + + + + add + + + addAdd Course Detail + + + + + + + + + + + + icon + + + + + + + close + + + + + + + + Your search for "{{ search }}" found no results. + + + + + + + + cancel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + cancel + add_circle + + +
+
+
+ + + + Clear + Add + + + +
+
+
+
+ {{ text }} +
+ +
+
+ + + \ No newline at end of file diff --git a/src/pages/Course/enrollStudents.vue b/src/pages/Course/enrollStudents.vue index 46bb616..7835d07 100644 --- a/src/pages/Course/enrollStudents.vue +++ b/src/pages/Course/enrollStudents.vue @@ -236,6 +236,7 @@ export default { getStudentTable(id) { console.log("id", this.getReport.courseId); this.getStudents(); + this.getParticularCourse(); }, update() { var studentsAttendence = []; @@ -270,7 +271,7 @@ export default { console.log("this.selected", this.selected); console.log("selected====", selected); let selectedStudentsArray = []; - selectedStudentsArray.push(selected.id); + selectedStudentsArray.push({ studentId: selected.id }); var payload = { courseId: this.getReport.courseId, enrollStudents: selectedStudentsArray @@ -289,7 +290,7 @@ export default { selectParticularStudent(selected) { console.log("selected====", selected); let selectedStudentsArray = []; - selectedStudentsArray.push(selected); + selectedStudentsArray.push({ studentId: selected }); var payload = { courseId: this.getReport.courseId, enrollStudents: selectedStudentsArray @@ -305,6 +306,24 @@ export default { this.text = error.response.data.message; }); }, + getParticularCourse() { + var payload = { + courseId: this.getReport.courseId + }; + http() + .get("/getParticularCourse", { + params: payload + }) + .then(response => { + conso.log("DTAAAAA", response.data.data); + this.snackbar = true; + this.text = response.data.message; + }) + .catch(error => { + this.snackbar = true; + this.text = error.response.data.message; + }); + }, changeSort(column) { if (this.pagination.sortBy === column) { this.pagination.descending = !this.pagination.descending; diff --git a/src/pages/Dashboard/dashboard.vue b/src/pages/Dashboard/dashboard.vue index 2a026f7..06fd6e7 100644 --- a/src/pages/Dashboard/dashboard.vue +++ b/src/pages/Dashboard/dashboard.vue @@ -98,7 +98,11 @@ - +

You have no student registered with scholl

+