/home/techb158/ileadtechnology.com/SSM/public/js/configuration/exam/grade
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/configuration/exam/grade/edit.js (9230B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{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)}))}}},s=a("KHd+"),i=Object(s.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=i.exports},dmNt:function(e,t,a){"use strict";a.r(t);var r={components:{examGradeForm:a("Hxk3").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},s=a("KHd+"),i=Object(s.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.edit_grade")))])]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){return e.$router.push("/configuration/exam/grade")}}},[a("i",{staticClass:"fas fa-list"}),e._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("exam.grade")))])])])])])]),e._v(" "),a("div",{staticClass:"container-fluid"},[a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body p-t-20"},[a("exam-grade-form",{attrs:{id:e.id}})],1)])])])}),[],!1,null,null,null);t.default=i.exports}}]);
//# sourceMappingURL=edit.js.map?id=4a79620b5a292d91afa9