diff --git a/package-lock.json b/package-lock.json index 92057c1..3877a78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15232,6 +15232,11 @@ } } }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", @@ -15652,9 +15657,9 @@ "dev": true }, "vee-validate": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-2.0.9.tgz", - "integrity": "sha512-0qA3hrpF2jIBoEReWF8YkvG1ukJVS56+oyPTxOtb2OfB5d7iUuQiyboOOpXOvOViREHNXTsIcQ5XIQOMBff/wg==" + "version": "2.2.15", + "resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-2.2.15.tgz", + "integrity": "sha512-4TOsI8XwVkKVLkg8Nhmy+jyoJrR6XcTRDyxBarzcCvYzU61zamipS1WsB6FlDze8eJQpgglS4NXAS6o4NDPs1g==" }, "vendors": { "version": "1.0.1", diff --git a/package.json b/package.json index 2bf6ada..ec00219 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "nprogress": "^0.2.0", "quill": "^1.3.6", "save": "^2.4.0", - "vee-validate": "^2.0.9", + "underscore": "^1.9.1", + "vee-validate": "^2.2.15", "vue": "^2.5.16", "vue-full-calendar": "^2.7.0", "vue-html2canvas": "0.0.4", diff --git a/src/Services/http.js b/src/Services/http.js index 9c3448e..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.4.220: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 0b6daf4..c0fd962 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -157,11 +157,6 @@ const Menu = [ icon: '/static/schoolIcons/Events.png', }, { - title: 'Holiday', - path: '/Holiday', - icon: '/static/schoolIcons/Holidays.png', - }, - { title: 'Account', group: 'Account', component: 'Account', @@ -173,6 +168,16 @@ const Menu = [ { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, { name: 'Income', title: 'Income', component: 'Income', action: '', }, ] + }, + { + title: 'Holiday', + path: '/Holiday', + icon: '/static/schoolIcons/Holidays.png', + }, + { + title: 'General Setting', + path: '/generalSetting', + icon: '/static/schoolIcons/settings.png', } ]; diff --git a/src/components/pageHeader/AppToolbar.vue b/src/components/pageHeader/AppToolbar.vue index ae93ac4..9fbb956 100644 --- a/src/components/pageHeader/AppToolbar.vue +++ b/src/components/pageHeader/AppToolbar.vue @@ -9,7 +9,7 @@ xs7 sm3 class="userSearch" - v-if="$route.name != 'Dashboard' && $route.name != 'changepassword'" + v-if="$route.name != 'Dashboard' && $route.name != 'changepassword' && $route.name != 'generalSetting' && $route.name != 'resetPassword'" > - + - account_circle + account_circle @@ -63,7 +63,7 @@ export default { items: [ { icon: "account_circle", - href: "/changepassword", + href: "/resetPassword", title: "Change Password", click: e => { console.log(e); @@ -111,7 +111,7 @@ export default { font-size: 30px; } .fixcolors { - background: #444B54 !important; + background: #444b54 !important; } @media screen and (min-width: 1270px) { .hide { diff --git a/src/main.js b/src/main.js index 08d53ca..2eb30de 100644 --- a/src/main.js +++ b/src/main.js @@ -27,6 +27,15 @@ Vue.use(FullCalendar); // Vue.use(VueAxios, axios); Vue.filter('truncate', Truncate); Vue.use(VeeValidate, { fieldsBagName: 'formFields' }); +VeeValidate.Validator.localize({ + en: { + custom: { + password2: { + is: 'The passwords do not match' + } + } + } +}) Vue.use(Vuetify, { // theme: { // primary: "f1f1f1", // #E53935 diff --git a/src/pages/Administrator/academicYear.vue b/src/pages/Administrator/academicYear.vue index 862f4d6..3453828 100644 --- a/src/pages/Administrator/academicYear.vue +++ b/src/pages/Administrator/academicYear.vue @@ -44,7 +44,7 @@ - + - + - + - + - + - - + +

Academic Year

@@ -176,21 +176,31 @@
- Date: + Year Title:
-
{{ dates(editedItem.dateOfEvent) }}
+
{{ editedItem.yearTitle }}
- Description: + Starting Date:
-
{{ editedItem.yearTitle }}
+
{{dates(editedItem.startingDate)}}
+
+
+ + +
+ Ending Date: +
+
+ +
{{dates(editedItem.endingDate)}}
diff --git a/src/pages/Administrator/resetPassword.vue b/src/pages/Administrator/resetPassword.vue index 166fb50..d000313 100644 --- a/src/pages/Administrator/resetPassword.vue +++ b/src/pages/Administrator/resetPassword.vue @@ -11,17 +11,39 @@ - - - + + + @@ -66,52 +88,99 @@ export default { mode: "", timeout: 4000, text: "", - user: {}, - users: [], - usersName: [], - e1: true, - e2: true, - e3: true, + color: "", + password2: "", + resetPassword: {}, + getUsersName: [], + getRoles: [], + valid: true, loading: false, - valid: false, text: "Password Changed", - currentPassword: "", newPassword: "", - confirmPassword: "", - rules: { - required: value => !!value || "This password field is Required." - // min: v => (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters upper case lower case symbol required' - } + userRule: [v => !!v || "User is required"], + userNameRule: [v => !!v || "User Name is required"], + newPasswordRule: [v => !!v || "New Password is required"], + rePasswordRule: [v => !!v || "Re-Password is required"] }; }, + mounted() { + this.token = this.$store.state.token; + this.getRole(); + }, methods: { reset() { - var token = this.$store.state.token; + if (this.$refs.form.validate()) { + this.loading = true; + this.resetPassword.roleName = this.resetPassword.name; + http() + .put("/resetPasswordOfUsers", this.resetPassword, { + headers: { Authorization: "Bearer " + this.token } + }) + .then(response => { + this.loading = false; + this.snackbar = true; + this.text = "Successfully Restet password !!"; + this.color = "green"; + this.clear(); + }) + .catch(error => { + // console.log("err====>",err); + this.snackbar = true; + this.text = "User Not Found or Incorrect currentPassword"; + this.color = "error"; + this.loading = false; + }); + } + }, + getRole() { + this.showLoader = true; http() - .put("/schoolChangePassword", { - headers: { Authorization: "Bearer " + token } + .get("/getRolesList", { + headers: { Authorization: "Bearer " + this.token } }) .then(response => { - this.loading = true; - if ((this.snackbar = true)) { - this.text = "Successfully changed password !!"; - console.log("snackbar", response.data.message); + for (let i = 0; i < response.data.data.length; i++) { + if ( + response.data.data[i].name != "SUPERADMIN" && + response.data.data[i].name != "ADMIN" + ) { + this.getRoles.push(response.data.data[i]); + this.showLoader = false; + } } - setTimeout(() => { - this.$router.push("/dashboard"); - }, 2000); }) - .catch(err => { - // console.log("err====>",err); - this.text = "User Not Found or Incorrect currentPassword"; - this.snackbar = true; - this.loading = false; + .catch(error => { + this.showLoader = false; + if (error.response.status === 401) { + this.$router.replace({ path: "/" }); + this.$store.dispatch("setToken", null); + this.$store.dispatch("Id", null); + } + }); + }, + clear() { + this.$refs.form.reset(); + }, + getUsers(roles) { + this.showLoader = true; + http() + .get("/getUserWithRole", { + params: { + name: roles + }, + headers: { Authorization: "Bearer " + this.token } + }) + .then(response => { + this.getUsersName = response.data.data; + }) + .catch(error => { + this.showLoader = false; + if (error.response.status === 401) { + this.$router.replace({ path: "/" }); + this.$store.dispatch("setToken", null); + this.$store.dispatch("Id", null); + } }); - } - }, - computed: { - color() { - return this.loading ? "success" : "error"; } } }; diff --git a/src/pages/Administrator/role.vue b/src/pages/Administrator/role.vue index 70985df..70ee1b0 100644 --- a/src/pages/Administrator/role.vue +++ b/src/pages/Administrator/role.vue @@ -69,7 +69,7 @@ @@ -198,7 +198,7 @@ export default { { text: "Role", value: "role", sortable: false, align: "center" }, { text: "Action", value: "", sortable: false, align: "center" } ], - getRole: [], + getRoles: [], editedIndex: -1, token: "", addrole: {}, @@ -212,7 +212,7 @@ export default { headers: { Authorization: "Bearer " + this.token } }) .then(response => { - this.getRole = response.data.data; + this.getRoles = response.data.data; this.showLoader = false; }) .catch(error => { @@ -225,7 +225,7 @@ export default { }); }, editItem(item) { - this.editedIndex = this.getRole.indexOf(item); + this.editedIndex = this.getRoles.indexOf(item); this.editedItem = Object.assign({}, item); this.dialog = true; }, @@ -284,7 +284,7 @@ export default { .then(response => { this.snackbar = true; this.text = response.data.message; - // this.getRole(); + this.getRole(); this.clear(); this.loading = false; }) diff --git a/src/pages/Mark/mark.vue b/src/pages/Mark/mark.vue index d6b31ae..0bd0530 100644 --- a/src/pages/Mark/mark.vue +++ b/src/pages/Mark/mark.vue @@ -20,220 +20,6 @@ - - - - - - {{ props.item.email }} - Edit - + - @@ -504,12 +278,6 @@ export default { data: () => ({ snackbar: false, date: null, - // editDate: false, - // menu1: false, - // menuB: false, - // menu2: false, - // menuEdit: false, - // timeToEdit: false, color: "", y: "top", x: "right", @@ -517,7 +285,6 @@ export default { timeout: 10000, text: "", loading: false, - // date: null, search: "", showLoader: false, dialog: false, @@ -535,12 +302,6 @@ export default { examRules: [v => !!v || "Exam is required"], headerOfMark: [ - // { - // align: "justify-center", - // text: "#", - // sortable: false, - // value: "index" - // }, { align: "justify-center", text: "No", @@ -565,26 +326,6 @@ export default { sortable: false, align: "center" } - // { - // text: "Distribution Type", - // value: "distributionType", - // sortable: false, - // align: "center" - // }, - // { text: "markValue", value: "markValue", sortable: false, align: "center" }, - // { - // text: "Roll No.", - // align: "center", - // sortable: false, - // value: "rollNo" - // }, - // { text: "Exam", value: "exam", sortable: false, align: "center" }, - // { - // text: "ASSIGNMENT", - // value: "assignment", - // sortable: false, - // align: "center" - // } ], headers: [ { @@ -624,7 +365,6 @@ export default { subjects: [], addMark: {}, getMark: {}, - // editedItem: {}, getScheduleData: {}, markData: [], getStudentData: [], @@ -632,75 +372,6 @@ export default { token: "" }), methods: { - // dates: function(date) { - // return moment(date).format("MMMM DD, YYYY"); - // }, - // pickFile() { - // this.$refs.image.click(); - // }, - // getStudentsList() { - // this.showLoader = true; - // http() - // .get("/getStudentsList", { - // params: { classId: this.getScheduleData.classId }, - // headers: { Authorization: "Bearer " + this.token } - // }) - // .then(response => { - // this.getStudentsList = response.data.data; - // this.showLoader = false; - // }) - // .catch(error => { - // // console.log("err====>", err); - // this.showLoader = false; - // this.loadingSearch = false; - // this.snackbar = true; - // this.text = error.response.data.message; - // if (error.response.status === 401) { - // this.$router.replace({ path: "/" }); - // this.$store.dispatch("setToken", null); - // this.$store.dispatch("Id", null); - // } - // }); - // }, - // editItem(item) { - // console.log("item", item); - // this.editedIndex = this.ScheduleData.indexOf(item); - // this.editedItem = Object.assign({}, item); - // this.editedItem.classId = this.editedItem.classId._id; - // this.editedItem.sectionId = this.editedItem.sectionId._id; - // this.editedItem.date = - // this.editedItem.date != undefined - // ? (this.editedItem.date = this.editedItem.date.substring(0, 10)) - // : (this.editedItem.date = ""); - // this.dialog = true; - // }, - // profile(item) { - // this.editedIndex = this.ScheduleData.indexOf(item); - // this.editedItem = Object.assign({}, item); - // this.editedItem.classId = this.editedItem.classId.classNum; - // this.editedItem.sectionId = this.editedItem.sectionId.name; - // this.dialog1 = true; - // }, - // deleteSchedule(item) { - // let deleteSchedule = { - // scheduleId: item._id - // }; - // http() - // .delete( - // "/deleteSchedule", - // confirm("Are you sure you want to Delete this?") && { - // params: deleteSchedule - // } - // ) - // .then(response => { - // this.snackbar = true; - // this.text = "Successfully Delete Schedule "; - // this.getStudentsList(); - // }) - // .catch(error => { - // // console.log(error); - // }); - // }, activeTab(type) { switch (type) { case "existing": @@ -714,34 +385,6 @@ export default { break; } }, - // close() { - // this.dialog = false; - // }, - // close1() { - // this.dialog1 = false; - // }, - // clear() { - // this.$refs.form.reset(); - // this.disable = false; - // this.loading = false; - // }, - // save() { - // this.editedItem.scheduleId = this.editedItem._id; - // http() - // .put("/updateSchedule", this.editedItem) - // .then(response => { - // this.snackbar = true; - // this.text = "Successfully Edit Exam Schedule"; - // this.color = "green"; - // this.getSchedulesList(); - // this.close(); - // }) - // .catch(error => { - // this.snackbar = true; - // this.text = error.response.data.message; - // this.color = "red"; - // }); - // }, getClass() { this.showLoader = true; http() @@ -751,7 +394,6 @@ export default { .then(response => { this.classList = response.data.data; this.showLoader = false; - // console.log("getClassesList=====>",this.addclass) }) .catch(err => { // console.log("err====>", err); @@ -762,7 +404,6 @@ export default { this.showLoader = true; for (let i = 0; i < this.classList.length; i++) { if (_id == this.classList[i]._id) { - // console.log(this.classList[i].subjects); this.subjects = this.classList[i].subjects; } } @@ -820,7 +461,6 @@ export default { .then(response => { this.getStudentData = response.data.data; this.showLoader = false; - // console.log("getSectionsList=====>", response.data.data); this.showLoader = true; http() .get("/getMarkDistributionsList", { @@ -849,7 +489,6 @@ export default { }); } } - console.log("this.getStudentData", this.getStudentData); }) .catch(error => { console.log("err====>", error); @@ -865,23 +504,16 @@ export default { submit() { let studentsMarks = []; for (var j = 0; j < this.getStudentData.length; j++) { - studentsMarks.push({ + let data = { + examId: this.addMark.examId, + classId: this.addMark.classId, + sectionId: this.addMark.sectionId, + subjectId: this.addMark.subjectId, studentId: this.getStudentData[j]._id, - marksObtained: this.getStudentData[j].marksObtained - }); - } - // console.log("marksObtaine----marksObtained", studentsMarks); - let markData = { - examId: this.addMark.examId, - classId: this.addMark.classId, - sectionId: this.addMark.sectionId, - subjectId: this.addMark.subjectId, - studentsMarks: studentsMarks - }; - console.log("markData", markData); - if (this.$refs.form.validate()) { + studentsMarks: this.getStudentData[j].marksObtained + }; http() - .post("/createMark", markData) + .post("/createMark", data) .then(response => { this.snackbar = true; this.text = response.data.message; @@ -890,10 +522,9 @@ export default { this.clear(); }) .catch(error => { - if ((this.snackbar = true)) { - this.text = error.response.data.message; - this.color = "red"; - } + this.snackbar = true; + this.text = error.response.data.message; + this.color = "red"; }); } }, @@ -919,7 +550,6 @@ export default { }, mounted() { this.token = this.$store.state.token; - // this.getSchedulesList(); this.getClass(); this.getExamList(); }, diff --git a/src/pages/Mark/promotion.vue b/src/pages/Mark/promotion.vue index aca4b53..7d12868 100644 --- a/src/pages/Mark/promotion.vue +++ b/src/pages/Mark/promotion.vue @@ -17,7 +17,13 @@ - +
@@ -26,10 +32,9 @@ Promotion Academic Year : - +
@@ -56,7 +66,7 @@ - + @@ -157,17 +166,9 @@ >
- - + --> Promotion Mark Setting @@ -186,7 +187,9 @@ export default { radios: "radio-1", acedemicYear: [], classList: [], - promtion: {}, + promotion: { + // academicYear: "" + }, passmark: { hindi: "40", english: "40", @@ -197,6 +200,10 @@ export default { }; }, mounted() { + var year = new Date().getFullYear() + 1; + // this.promotion.acedemicYear = new Date().getFullYear() + "-" + year; + this.acedemicYear.push({ year: new Date().getFullYear() + "-" + year }); + console.log(" this.promotion.acedemicYear ", this.acedemicYear); this.token = this.$store.state.token; this.getClass(); }, diff --git a/src/pages/Mark/viewMark.vue b/src/pages/Mark/viewMark.vue index e2a7e21..bf17166 100644 --- a/src/pages/Mark/viewMark.vue +++ b/src/pages/Mark/viewMark.vue @@ -17,7 +17,7 @@ - + @@ -39,39 +39,39 @@

- {{ mark.studentsMarks[0].studentId.name }} + {{ value[0].studentId.name }}

Student

- -

- Roll No : + +

+ Roll No:

- -

{{ mark.studentsMarks[0].studentId.rollNo }}

+ +

{{ value[0].studentId.rollNo }}

- -

- Class : + +

+ Class:

- -

{{ mark.classId.classNum }}

+ +

{{value[0].classId.classNum }}

- -

- Section : + +

+ Section:

- -

{{ mark.sectionId.name}}

+ +

{{ value[0].sectionId.name}}

@@ -84,76 +84,43 @@ - - - - -

Mark

-
- -
- {{ markList.examId.examName }} - - - - - - - - - - - - - - - - - - - - - +
Subject{{ markDistribution.markDistributionId.distributionType}}Total
{{i === 0 ? 'Mark' : 'Highest Mark'}}{{i === 0 ? 'Mark' : 'Highest Mark'}}MarkPointGrade
{{ mark.classId.subjects[0].subjectName }}{{ markDistribution }}
@@ -170,6 +137,7 @@ + s \ No newline at end of file + s \ No newline at end of file diff --git a/src/pages/Report/studentReport.vue b/src/pages/Report/studentReport.vue index da85029..b3afa4c 100644 --- a/src/pages/Report/studentReport.vue +++ b/src/pages/Report/studentReport.vue @@ -18,7 +18,7 @@ - + @@ -136,7 +136,7 @@ --> - + @@ -179,26 +179,30 @@ Get Report - Get Report + Get Report - - - + {{ props.item.name}} {{ props.item.rollNo }} {{ props.item.email }} + {{ props.item.classId.classNum }} + {{ props.item.sectionId.name }} { this.addSection = response.data.data; - console.log("getSectionsList=====>", this.addSection); + this.showLoader = false; + // console.log("getSectionsList=====>", this.addSection); }) .catch(err => { + this.showLoader = false; // console.log("err====>", err); // this.$router.replace({ path: '/' }); }); }, getSection(_id) { var token = this.$store.state.token; + this.showLoader = true; http() .get( "/getSectionsList", @@ -1907,9 +1911,11 @@ export default { ) .then(response => { this.addSection = response.data.data; - console.log("getSectionsList=====>", this.addSection); + this.showLoader = false; + // console.log("getSectionsList=====>", this.addSection); }) .catch(err => { + this.showLoader = false; // console.log("err====>", err); // this.$router.replace({ path: '/' }); }); diff --git a/src/pages/Subjects/subjects.vue b/src/pages/Subjects/subjects.vue index 6d9a435..b9943f3 100644 --- a/src/pages/Subjects/subjects.vue +++ b/src/pages/Subjects/subjects.vue @@ -128,10 +128,10 @@ - + - + + + + + + + + General Setting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + submit + + + {{ text }} + + + + + + + + diff --git a/src/router/paths.js b/src/router/paths.js index 9275d00..9797067 100644 --- a/src/router/paths.js +++ b/src/router/paths.js @@ -608,5 +608,17 @@ export default [{ /* webpackMode: "lazy-once" */ `@/pages/Report/progressCardReport.vue` ) + }, + { + path: '/generalSetting', + meta: {}, + name: 'generalSetting', + props: (route) => ({ type: route.query.type }), + component: () => + import ( + /* webpackChunkName: "routes" */ + /* webpackMode: "lazy-once" */ + `@/pages/generalSetting/generalSetting.vue` + ) } ]; \ No newline at end of file