/home/techb158/ileadtechnology.com/SSM/public/js/configuration/exam/grade
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/configuration/exam/grade/index.js (15325B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[95],{Hxk3:function(e,t,a){"use strict";var r={components:{},data:function(){return{gradeForm:new Form({name:"",description:"",details:[]})}},props:["id"],mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.id?this.get():this.addRow()},methods:{hasPermission:function(e){return helper.hasPermission(e)},addRow:function(){this.gradeForm.details.push({name:"",min_percentage:"",max_percentage:"",description:""})},confirmDeleteDetail:function(e){var t=this;return function(a){return t.deleteDetail(e)}},deleteDetail:function(e){this.gradeForm.details.splice(e,1)},getDetailName:function(e){return e+"_detail_name"},getDetailMinPercentageName:function(e){return e+"_detail_min_percentage"},getDetailMaxPercentageName:function(e){return e+"_detail_max_percentage"},getDetailDescriptionName:function(e){return e+"_detail_description"},proceed:function(){this.id?this.update():this.store()},store:function(){var e=this,t=this.$loading.show();this.gradeForm.post("/api/exam/grade").then((function(a){toastr.success(a.message),e.gradeForm.details=[],e.addRow(),e.$emit("completed"),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},get:function(){var e=this,t=this.$loading.show();axios.get("/api/exam/grade/"+this.id).then((function(a){e.gradeForm.name=a.name,e.gradeForm.description=a.description,a.details.forEach((function(t){e.gradeForm.details.push({name:t.name,min_percentage:t.min_percentage,max_percentage:t.max_percentage,description:t.description})})),t.hide()})).catch((function(a){t.hide(),helper.showErrorMsg(a),e.$router.push("/configuration/exam/grade")}))},update:function(){var e=this,t=this.$loading.show();this.gradeForm.patch("/api/exam/grade/"+this.id).then((function(a){toastr.success(a.message),t.hide(),e.$router.push("/configuration/exam/grade")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))}}},n=a("KHd+"),s=Object(n.a)(r,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.gradeForm.errors.clear(t.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.grade_name")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.gradeForm.name,expression:"gradeForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:e.trans("exam.grade_name")},domProps:{value:e.gradeForm.name},on:{input:function(t){t.target.composing||e.$set(e.gradeForm,"name",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.gradeForm,"prop-name":"name"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.grade_description")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.gradeForm.description,expression:"gradeForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:e.trans("exam.grade_description")},domProps:{value:e.gradeForm.description},on:{input:function(t){t.target.composing||e.$set(e.gradeForm,"description",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.gradeForm,"prop-name":"description"}})],1)])]),e._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12"},[a("h6",{staticClass:"card-title"},[e._v(e._s(e.trans("exam.grade_type")))]),e._v(" "),e._l(e.gradeForm.details,(function(t,r){return[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.grade_detail_name"))+" \n "),a("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:e.confirmDeleteDetail(r)},expression:"{ok: confirmDeleteDetail(index)}"},{name:"tooltip",rawName:"v-tooltip",value:e.trans("general.delete"),expression:"trans('general.delete')"}],key:r+"_delete_detail",staticClass:"btn btn-xs btn-danger m-l-20",attrs:{type:"button"}},[a("i",{staticClass:"fas fa-times"})])]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"detail.name"}],staticClass:"form-control",attrs:{type:"text",name:e.getDetailName(r),placeholder:e.trans("exam.grade_detail_name")},domProps:{value:t.name},on:{input:function(a){a.target.composing||e.$set(t,"name",a.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.gradeForm,"prop-name":e.getDetailName(r)}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-2"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.grade_detail_min_percentage")))]),e._v(" "),a("div",{staticClass:"input-group mb-3"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.min_percentage,expression:"detail.min_percentage"}],staticClass:"form-control",attrs:{type:"number",name:e.getDetailMinPercentageName(r),placeholder:e.trans("exam.grade_detail_min_percentage")},domProps:{value:t.min_percentage},on:{input:function(a){a.target.composing||e.$set(t,"min_percentage",a.target.value)}}}),e._v(" "),e._m(0,!0)]),e._v(" "),a("show-error",{attrs:{"form-name":e.gradeForm,"prop-name":e.getDetailMinPercentageName(r)}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-2"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.grade_detail_max_percentage")))]),e._v(" "),a("div",{staticClass:"input-group mb-3"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.max_percentage,expression:"detail.max_percentage"}],staticClass:"form-control",attrs:{type:"number",name:e.getDetailMaxPercentageName(r),placeholder:e.trans("exam.grade_detail_max_percentage")},domProps:{value:t.max_percentage},on:{input:function(a){a.target.composing||e.$set(t,"max_percentage",a.target.value)}}}),e._v(" "),e._m(1,!0)]),e._v(" "),a("show-error",{attrs:{"form-name":e.gradeForm,"prop-name":e.getDetailMaxPercentageName(r)}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-5"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.grade_detail_description")))]),e._v(" "),a("autosize-textarea",{attrs:{rows:"2",name:e.getDetailDescriptionName(r),placeholder:e.trans("resource.grade_detail_description")},model:{value:t.description,callback:function(a){e.$set(t,"description",a)},expression:"detail.description"}}),e._v(" "),a("show-error",{attrs:{"form-name":e.gradeForm,"prop-name":e.getDetailDescriptionName(r)}})],1)])])]})),e._v(" "),a("div",{staticClass:"form-group"},[a("button",{staticClass:"btn btn-info btn-sm waves-effect waves-light",attrs:{type:"button"},on:{click:e.addRow}},[e._v(e._s(e.trans("exam.add_new_grade_detail")))])])],2)]),e._v(" "),a("div",{staticClass:"card-footer text-right"},[a("router-link",{directives:[{name:"show",rawName:"v-show",value:e.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/exam/grade"}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),e.id?e._e():a("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(t){return e.$emit("cancel")}}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[e.id?a("span",[e._v(e._s(e.trans("general.update")))]):a("span",[e._v(e._s(e.trans("general.save")))])])],1)])])}),[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"input-group-append"},[t("span",{staticClass:"input-group-text",attrs:{id:"basic-addon1"}},[this._v("%")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"input-group-append"},[t("span",{staticClass:"input-group-text",attrs:{id:"basic-addon1"}},[this._v("%")])])}],!1,null,null,null);t.a=s.exports},Qcma:function(e,t,a){"use strict";a.r(t);var r={components:{gradeForm:a("Hxk3").a},data:function(){return{grades:{total:0,data:[]},filter:{sort_by:"name",order:"asc",page_length:helper.getConfig("page_length")},orderByOptions:[{value:"name",translation:i18n.exam.grade_name}],showCreatePanel:!1,help_topic:""}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getGrades()},methods:{getConfig:function(e){return helper.getConfig(e)},getGrades:function(e){var t=this,a=this.$loading.show();"number"!=typeof e&&(e=1);var r=helper.getFilterURL(this.filter);axios.get("/api/exam/grade?page="+e+r).then((function(e){t.grades=e,a.hide()})).catch((function(e){a.hide(),helper.showErrorMsg(e)}))},editGrade:function(e){this.$router.push("/configuration/exam/grade/"+e.id+"/edit")},confirmDelete:function(e){var t=this;return function(a){return t.deleteGrade(e)}},deleteGrade:function(e){var t=this,a=this.$loading.show();axios.delete("/api/exam/grade/"+e.id).then((function(e){toastr.success(e.message),t.getGrades(),a.hide()})).catch((function(e){a.hide(),helper.showErrorMsg(e)}))},print:function(){var e=this.$loading.show();axios.post("/api/exam/grade/print",{filter:this.filter}).then((function(t){var a=window.open("/print");e.hide(),a.document.write(t)})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},pdf:function(){var e=this,t=this.$loading.show();axios.post("/api/exam/grade/pdf",{filter:this.filter}).then((function(a){t.hide(),window.open("/download/report/"+a+"?token="+e.authToken)})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))}},filters:{momentDateTime:function(e){return helper.formatDateTime(e)}},watch:{"filter.sort_by":function(e){this.getGrades()},"filter.order":function(e){this.getGrades()},"filter.page_length":function(e){this.getGrades()}},computed:{authToken:function(){return helper.getAuthToken()}}},n=a("KHd+"),s=Object(n.a)(r,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"page-titles"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("h3",{staticClass:"text-themecolor"},[e._v(e._s(e.trans("exam.grade"))+" \n "),e.grades.total?a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[e._v(e._s(e.trans("general.total_result_found",{count:e.grades.total,from:e.grades.from,to:e.grades.to})))]):a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[e._v(e._s(e.trans("general.no_result_found")))])])]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[e.grades.total&&!e.showCreatePanel?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("general.add_new"),expression:"trans('general.add_new')"}],staticClass:"btn btn-info btn-sm",on:{click:function(t){e.showCreatePanel=!e.showCreatePanel}}},[a("i",{staticClass:"fas fa-plus"}),e._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("exam.add_new_grade")))])]):e._e(),e._v(" "),a("sort-by",{attrs:{"order-by-options":e.orderByOptions,"sort-by":e.filter.sort_by,order:e.filter.order},on:{updateSortBy:function(t){e.filter.sort_by=t},updateOrder:function(t){e.filter.order=t}}}),e._v(" "),a("div",{staticClass:"btn-group"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("general.more_option"),expression:"trans('general.more_option')"}],staticClass:"btn btn-info btn-sm dropdown-toggle no-caret ",attrs:{type:"button",role:"menu",id:"moreOption","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[a("i",{staticClass:"fas fa-ellipsis-h"}),e._v(" "),a("span",{staticClass:"d-none d-sm-inline"})]),e._v(" "),a("div",{class:["dropdown-menu","ltr"==e.getConfig("direction")?"dropdown-menu-right":""],attrs:{"aria-labelledby":"moreOption"}},[a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:e.print}},[a("i",{staticClass:"fas fa-print"}),e._v(" "+e._s(e.trans("general.print")))]),e._v(" "),a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:e.pdf}},[a("i",{staticClass:"fas fa-file-pdf"}),e._v(" "+e._s(e.trans("general.generate_pdf")))])])]),e._v(" "),a("help-button",{on:{clicked:function(t){e.help_topic="configuration.exam.grade"}}})],1)])])]),e._v(" "),a("div",{staticClass:"container-fluid"},[a("transition",{attrs:{name:"fade"}},[e.showCreatePanel?a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body"},[a("h4",{staticClass:"card-title"},[e._v(e._s(e.trans("exam.add_new_grade")))]),e._v(" "),a("grade-form",{on:{completed:e.getGrades,cancel:function(t){e.showCreatePanel=!e.showCreatePanel}}})],1)]):e._e()]),e._v(" "),a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[e.grades.total?a("div",{staticClass:"table-responsive"},[a("table",{staticClass:"table table-sm"},[a("thead",[a("tr",[a("th",[e._v(e._s(e.trans("exam.grade_name")))]),e._v(" "),a("th",[e._v(e._s(e.trans("exam.grade_range")))]),e._v(" "),a("th",[e._v(e._s(e.trans("exam.grade_description")))]),e._v(" "),a("th",{staticClass:"table-option"},[e._v(e._s(e.trans("general.action")))])])]),e._v(" "),a("tbody",e._l(e.grades.data,(function(t){return a("tr",[a("td",{domProps:{textContent:e._s(t.name)}}),e._v(" "),a("td",[a("ul",{staticStyle:{"list-style":"none",padding:"0",margin:"0"}},e._l(t.details,(function(t){return a("li",[e._v("\n "+e._s(t.name)+" ("+e._s(e.trans("exam.grade_detail",{min_percentage:t.min_percentage,max_percentage:t.max_percentage}))+")\n ")])})),0)]),e._v(" "),a("td",{domProps:{textContent:e._s(t.description)}}),e._v(" "),a("td",{staticClass:"table-option"},[a("div",{staticClass:"btn-group"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("exam.edit_grade"),expression:"trans('exam.edit_grade')"}],staticClass:"btn btn-info btn-sm",on:{click:function(a){return a.preventDefault(),e.editGrade(t)}}},[a("i",{staticClass:"fas fa-edit"})]),e._v(" "),a("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:e.confirmDelete(t)},expression:"{ok: confirmDelete(grade)}"},{name:"tooltip",rawName:"v-tooltip",value:e.trans("exam.delete_grade"),expression:"trans('exam.delete_grade')"}],key:t.id,staticClass:"btn btn-danger btn-sm"},[a("i",{staticClass:"fas fa-trash"})])])])])})),0)])]):e._e(),e._v(" "),e.grades.total?e._e():a("module-info",{attrs:{module:"exam",title:"grade_module_title",description:"grade_module_description",icon:"list"}},[a("div",{attrs:{slot:"btn"},slot:"btn"},[e.showCreatePanel?e._e():a("button",{staticClass:"btn btn-info btn-md",on:{click:function(t){e.showCreatePanel=!e.showCreatePanel}}},[a("i",{staticClass:"fas fa-plus"}),e._v(" "+e._s(e.trans("general.add_new")))])])]),e._v(" "),a("pagination-record",{attrs:{"page-length":e.filter.page_length,records:e.grades},on:{"update:pageLength":function(t){return e.$set(e.filter,"page_length",t)},"update:page-length":function(t){return e.$set(e.filter,"page_length",t)},updateRecords:e.getGrades},nativeOn:{change:function(t){return e.getGrades(t)}}})],1)])],1),e._v(" "),a("right-panel",{attrs:{topic:e.help_topic}})],1)}),[],!1,null,null,null);t.default=s.exports}}]);
//# sourceMappingURL=index.js.map?id=3cc17452216ab64d7201