diff --git a/src/Services/http.js b/src/Services/http.js index 18cd03d..bcd38b0 100644 --- a/src/Services/http.js +++ b/src/Services/http.js @@ -3,7 +3,7 @@ import store from '@/store/store' export default () => { return axios.create({ - // baseURL: 'http://192.168.0.101:3002/v1', + // baseURL: 'http://192.168.2.221:3002/v1', baseURL: 'http://13.234.251.173:8001/v1', headers: { Authorization: `Bearer ${store.state.token}` diff --git a/src/api/menu.js b/src/api/menu.js index c0fd962..b6b640c 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -1,4 +1,4 @@ -const Menu = [ +const adminMenu = [ // { header: 'Apps' }, { title: 'Dashboard', @@ -181,16 +181,25 @@ const Menu = [ } ]; +const schoolMenu = [ + // { header: 'Apps' }, + { + title: 'School', + // group: 'apps', + path: '/school', + icon: '/static/schoolIcons/Dashboard.png', + }, +]; // reorder menu -Menu.forEach((item) => { - // if (item.items) { - // item.items.sort((x, y) => { - // let textA = x.title.toUpperCase(); - // let textB = y.title.toUpperCase(); - // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; - // }); - // } -}); +// Menu.forEach((item) => { +// if (item.items) { +// item.items.sort((x, y) => { +// let textA = x.title.toUpperCase(); +// let textB = y.title.toUpperCase(); +// return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; +// }); +// } +// }); -export default Menu; \ No newline at end of file +export default { adminMenu, schoolMenu }; \ No newline at end of file diff --git a/src/components/pageHeader/AppDrawer.vue b/src/components/pageHeader/AppDrawer.vue index 0ed1cb4..1803bb3 100644 --- a/src/components/pageHeader/AppDrawer.vue +++ b/src/components/pageHeader/AppDrawer.vue @@ -129,7 +129,7 @@ export default { data: () => ({ mini: false, drawer: true, - menus: menu, + menus: [], scrollSettings: { maxScrollbarLength: 160 } @@ -147,6 +147,11 @@ export default { } }, created() { + if (this.$store.state.role === "ADMIN") { + this.menus = menu.adminMenu; + } else if (this.$store.state.role === "SUPERADMIN") { + this.menus = menu.schoolMenu; + } window.getApp.$on("APP_DRAWER_TOGGLED", () => { this.drawer = !this.drawer; }); @@ -177,9 +182,11 @@ export default { overflow: auto; } } + .v-list__group__items--no-action .v-list__tile { - padding-left: 72px !important; + padding-left: 72px !important; } + .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { height: 60px; font-size: 17px; diff --git a/src/event.js b/src/event.js index 868dc41..f604c76 100644 --- a/src/event.js +++ b/src/event.js @@ -1,76 +1,75 @@ -export default [ - { - name: 'APP_LOGIN_SUCCESS', - callback: function (e) { - this.$router.push({ path: 'dashboard' }); - } - }, - { - name: 'APP_LOGOUT', - callback: function (e) { - this.snackbar = { - show: true, - color: 'green', - text: 'Logout successfully.' - }; - this.$store.dispatch('setToken', null) - this.$store.dispatch('Id', null) - this.$router.replace({ path: '/' }); - } - }, - { - name: 'APP_CHANGE', - callback: function (e) { - this.snackbar = { - show: true, - color: 'green', - text: 'Logout successfully.' - }; - this.$router.replace({ - path: '/' - }); - } - }, - { - name: 'APP_PAGE_LOADED', - callback: function (e) { - } - }, - { - name: 'APP_AUTH_FAILED', - callback: function (e) { - this.$router.push('/login'); - this.$message.error('Token has expired'); - } - }, - { - name: 'APP_BAD_REQUEST', - // @error api response data - callback: function (msg) { - this.$message.error(msg); - } - }, - { - name: 'APP_ACCESS_DENIED', - // @error api response data - callback: function (msg) { - this.$message.error(msg); - this.$router.push('/forbidden'); - } - }, - { - name: 'APP_RESOURCE_DELETED', - // @error api response data - callback: function (msg) { - this.$message.success(msg); - } - }, - { - name: 'APP_RESOURCE_UPDATED', - // @error api response data - callback: function (msg) { - this.$message.success(msg); - } - }, +export default [{ + name: 'APP_LOGIN_SUCCESS', + callback: function(e) { + this.$router.push({ path: 'dashboard' }); + } + }, + { + name: 'APP_LOGOUT', + callback: function(e) { + this.snackbar = { + show: true, + color: 'green', + text: 'Logout successfully.' + }; + this.$store.dispatch('setToken', null) + this.$store.dispatch('Id', null) + this.$store.dispatch('Role', null) + this.$router.replace({ path: '/' }); + } + }, + { + name: 'APP_CHANGE', + callback: function(e) { + this.snackbar = { + show: true, + color: 'green', + text: 'Logout successfully.' + }; + this.$router.replace({ + path: '/' + }); + } + }, + { + name: 'APP_PAGE_LOADED', + callback: function(e) {} + }, + { + name: 'APP_AUTH_FAILED', + callback: function(e) { + this.$router.push('/login'); + this.$message.error('Token has expired'); + } + }, + { + name: 'APP_BAD_REQUEST', + // @error api response data + callback: function(msg) { + this.$message.error(msg); + } + }, + { + name: 'APP_ACCESS_DENIED', + // @error api response data + callback: function(msg) { + this.$message.error(msg); + this.$router.push('/forbidden'); + } + }, + { + name: 'APP_RESOURCE_DELETED', + // @error api response data + callback: function(msg) { + this.$message.success(msg); + } + }, + { + name: 'APP_RESOURCE_UPDATED', + // @error api response data + callback: function(msg) { + this.$message.success(msg); + } + }, -]; +]; \ No newline at end of file diff --git a/src/pages/Attendence/viewStudentsAttendence.vue b/src/pages/Attendence/viewStudentsAttendence.vue index 0bf63df..a29b9e0 100644 --- a/src/pages/Attendence/viewStudentsAttendence.vue +++ b/src/pages/Attendence/viewStudentsAttendence.vue @@ -410,7 +410,7 @@ export default { } let doc = new jsPDF(); doc.addImage(this.output, 'JPEG', 5, 10, 200, 280); - doc.save("export.pdf"); + doc.save("Attendance.pdf"); } } }; diff --git a/src/pages/Authentication/Login.vue b/src/pages/Authentication/Login.vue index 1b9be62..6e1cec2 100644 --- a/src/pages/Authentication/Login.vue +++ b/src/pages/Authentication/Login.vue @@ -122,8 +122,14 @@ export default { .then(response => { 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.loading = false; - this.$router.push("/dashboard"); + // console.log("{this.$store.state.state.role}",this.$store.state.role) + if (this.$store.state.role === "ADMIN") { + this.$router.push("/dashboard"); + } else if (this.$store.state.role === "SUPERADMIN") { + this.$router.push("/school"); + } }) .catch(error => { if (error) { diff --git a/src/pages/Mark/viewMark.vue b/src/pages/Mark/viewMark.vue index 90063fd..f758758 100644 --- a/src/pages/Mark/viewMark.vue +++ b/src/pages/Mark/viewMark.vue @@ -91,6 +91,11 @@ + + +
No Data Found
+
+
@@ -177,6 +182,13 @@ + + + +
No Data Found
+
+
+
@@ -221,21 +233,14 @@ export default { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); - console.log("check filtered data", this.filterData); for (let data in this.filterData) { - // console.log("this.filterData[data].length", this.filterData[data]); for (let item in this.filterData[data]) { - // console.log("check", this.filterData[data][item].studentsMarks); var totalMarks = 0; for ( let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ ) { - // console.log( - // "check data", - // this.filterData[data][item].studentsMarks[i] - // ); totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; } @@ -247,7 +252,6 @@ export default { // for (let i = 0; i < this.markData.length; i++) { // console.log(this.markData[i].examId.examName); // let index = -1; - // aray.forEach((dat_, k) => { // if (dat_.category == this.markData[i].examId.examName) { // index = k; @@ -261,40 +265,8 @@ export default { // obj.extraData.push(this.markData[i]); // aray.push(obj); // } else { - // console.log("=o", this.markData[i]); - // // aray[index].extraData = - // aray[index].extraData.push(this.markData[i]); // } - // console.log("aray-", aray); - - // for (let j = 0; j < this.markData[i].studentsMarks.length; j++) { - // // console.log("this.studentsMarksSSSSSSSSSSSSS",this.markData[i].studentsMarks[j].marksObtained) - - // this.markDistributions = this.markData[i].studentsMarks[ - // j - // ].marksObtained; - // for ( - // let k = 0; - // k < this.markData[i].studentsMarks[j].marksObtained.length; - // k++ - // ) { - // this.markParticularDistributionData.push( - // this.markData[i].studentsMarks[j].marksObtained[k].marksScored - // ); - // this.markParticularDistributionData.push( - // this.markData[i].studentsMarks[j].marksObtained[k] - // .markDistributionId.markValue - // ); - // // console.log( - // // "this.markParticularDistributionData", - // // this.markParticularDistributionData - // // ); - // } - // } - // } - // this.markData = aray; - // console.log("aray-2", aray); this.showLoader = false; }) .catch(error => { @@ -322,10 +294,6 @@ table { border-collapse: collapse; border: 1px solid #e2e7eb; } -tbody > tr > td, -.table-bordered { - border: 1px solid #ddd; -} th, td { border: 1px solid #e2e7eb; diff --git a/src/pages/Report/progressCardReport.vue b/src/pages/Report/progressCardReport.vue index 60bd1dc..499c127 100644 --- a/src/pages/Report/progressCardReport.vue +++ b/src/pages/Report/progressCardReport.vue @@ -96,7 +96,6 @@ - @@ -265,7 +264,6 @@ -
diff --git a/src/pages/School/school.vue b/src/pages/School/school.vue new file mode 100644 index 0000000..3888833 --- /dev/null +++ b/src/pages/School/school.vue @@ -0,0 +1,1290 @@ + + + + \ No newline at end of file diff --git a/src/pages/Section/section.vue b/src/pages/Section/section.vue index 552b5cc..8f86c11 100644 --- a/src/pages/Section/section.vue +++ b/src/pages/Section/section.vue @@ -46,14 +46,13 @@ - + > @@ -425,10 +424,9 @@ export default { this.showLoader = false; // console.log("getAllSections=====>",response.data.data) }) - .catch(err => { - // console.log("err====>", err); + .catch(error => { this.showLoader = false; - if (error.response.status === 401) { + if (error.response.status === 401 && error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); diff --git a/src/router/paths.js b/src/router/paths.js index 9797067..09cd152 100644 --- a/src/router/paths.js +++ b/src/router/paths.js @@ -620,5 +620,18 @@ export default [{ /* webpackMode: "lazy-once" */ `@/pages/generalSetting/generalSetting.vue` ) + }, + + { + path: '/school', + meta: {}, + name: 'School', + props: (route) => ({ type: route.query.type }), + component: () => + import ( + /* webpackChunkName: "routes" */ + /* webpackMode: "lazy-once" */ + `@/pages/School/school.vue` + ) } ]; \ No newline at end of file diff --git a/src/store/store.js b/src/store/store.js index ad21ae9..63ae331 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -5,46 +5,53 @@ import createPersistedState from 'vuex-persistedstate' Vue.use(Vuex) export default new Vuex.Store({ - strict:true, - plugins:[ - createPersistedState() + strict: true, + plugins: [ + createPersistedState() ], state: { token: null, data: null, isUserLoggedIn: false, id: null, + role: null }, // serve as the one and only way to change the state of the data in the state object mutations: { - setToken (state, token) { + setToken(state, token) { state.token = token - //state.isUserLoggedIn = !!(token) - if (token != null) { - state.isUserLoggedIn = true - } else { - state.isUserLoggedIn = false - } + //state.isUserLoggedIn = !!(token) + if (token != null) { + state.isUserLoggedIn = true + } else { + state.isUserLoggedIn = false + } }, - setUser (state, data) { + setUser(state, data) { state.data = data }, - Id (state, id) { - state.id = id + Id(state, id) { + state.id = id }, - }, + Role(state, role) { + state.role = role + } + }, //Action methods are referred to as being "dispatched" actions: { - setToken ({commit}, token) { + setToken({ commit }, token) { commit('setToken', token) }, - setUser ({commit}, data) { + setUser({ commit }, data) { commit('setUser', data) }, - Id ({commit}, id) { + Id({ commit }, id) { commit('Id', id) + }, + Role({ commit }, role) { + commit('Role', role) } } - + }) \ No newline at end of file