/home/techb158/ileadtechnology.com/SSM/public/js/exam
NameSizeModeActions
edit~js/-0755rm
online-exam/-0755rm
record/-0755rm
report/-0755rm
schedule/-0755rm
edit.js58980644editdlrm
edit.js.map1370644editdlrm
index.js152330644editdlrm
index.js.map1300644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/exam/edit.js (5898B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[195],{ddiv:function(e,t,a){"use strict";var s={components:{},data:function(){return{examForm:new Form({name:"",exam_term_id:"",description:""}),exam_terms:[],selected_exam_term:null}},props:["id"],mounted:function(){helper.hasPermission("create-exam")||helper.hasPermission("edit-exam")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getPreRequisite()},methods:{proceed:function(){this.id?this.update():this.store()},getPreRequisite:function(){var e=this,t=this.$loading.show();axios.get("/api/exam/pre-requisite").then((function(a){e.exam_terms=a.exam_terms,e.id&&e.get(),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},store:function(){var e=this,t=this.$loading.show();this.examForm.post("/api/exam").then((function(a){toastr.success(a.message),e.selected_exam_term=null,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/"+this.id).then((function(a){e.examForm.name=a.name,e.examForm.exam_term_id=a.exam_term_id,e.selected_exam_term=a.exam_term_id?{id:a.exam_term_id,name:a.term.name+" ("+a.term.course_group.name+")"}:null,e.examForm.description=a.description,t.hide()})).catch((function(a){t.hide(),helper.showErrorMsg(a),e.$router.push("/exam")}))},update:function(){var e=this,t=this.$loading.show();this.examForm.patch("/api/exam/"+this.id).then((function(a){toastr.success(a.message),t.hide(),e.$router.push("/exam")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},getConfig:function(e){return helper.getConfig(e)},onExamTermSelect:function(e){this.examForm.exam_term_id=e.id}}},r=a("KHd+"),i=Object(r.a)(s,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.examForm.errors.clear(t.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.term"))+" ")]),e._v(" "),a("v-select",{attrs:{label:"name",name:"exam_term_id",id:"exam_term_id",options:e.exam_terms,placeholder:e.trans("exam.select_term")},on:{select:e.onExamTermSelect,close:function(t){return e.examForm.errors.clear("exam_term_id")},remove:function(t){e.examForm.exam_term_id=""}},model:{value:e.selected_exam_term,callback:function(t){e.selected_exam_term=t},expression:"selected_exam_term"}},[e.exam_terms.length?e._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),a("show-error",{attrs:{"form-name":e.examForm,"prop-name":"exam_term_id"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.exam_name")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.examForm.name,expression:"examForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:e.trans("exam.exam_name")},domProps:{value:e.examForm.name},on:{input:function(t){t.target.composing||e.$set(e.examForm,"name",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.examForm,"prop-name":"name"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.exam_description")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.examForm.description,expression:"examForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:e.trans("exam.exam_description")},domProps:{value:e.examForm.description},on:{input:function(t){t.target.composing||e.$set(e.examForm,"description",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.examForm,"prop-name":"description"}})],1)])]),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:"/exam"}},[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)])}),[],!1,null,null,null);t.a=i.exports},oWvJ:function(e,t,a){"use strict";a.r(t);var s={components:{examForm:a("ddiv").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("edit-exam")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},r=a("KHd+"),i=Object(r.a)(s,(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_exam")))])]),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("/exam")}}},[a("i",{staticClass:"fas fa-list"}),e._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("exam.edit_exam")))])])])])])]),e._v(" "),a("div",{staticClass:"container-fluid"},[a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body p-t-20"},[a("exam-form",{attrs:{id:e.id}})],1)])])])}),[],!1,null,null,null);t.default=i.exports}}]); //# sourceMappingURL=edit.js.map?id=d25bd236e5352850dd3b