/
home
/
maktab
/
admin
/
js
/
File Upload :
llllll
Current File: /home/maktab/admin/js/chunk-e78a0952.9d54e84f.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e78a0952"],{1092:function(e,t,a){"use strict";a.r(t);a("7f7f");var r=function(){var e=this,t=e._self._c;return t("a-spin",{attrs:{spinning:e.loading},on:{submit:e.handleSubmit}},[t("vx-card",{attrs:{title:"افزودن مکتب"}},[t("a-form",{attrs:{form:e.form}},[t("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 gap-2"},[t("a-form-item",{attrs:{label:"عنوان"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:e.inputFa("title"),expression:"inputFa('title')"}]})],1),t("a-form-item",{attrs:{label:"تعداد دانش آموز"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:e.input("count_student"),expression:"input('count_student')"}],attrs:{type:"number"}})],1),t("a-form-item",{attrs:{label:"سال تاسیس"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:e.input("year_establish"),expression:"input('year_establish')"}],staticClass:"numhov",attrs:{type:"number"}})],1),t("a-form-item",{attrs:{label:"کلونی"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:e.input("cloony_id"),expression:"input('cloony_id')"}],staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"show-search":""}},e._l(e.cloony,(function(a,r){return t("a-select-option",{key:a.id},[e._v("\n "+e._s(a.title)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"روز فعالیت"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:e.input("day_active"),expression:"input('day_active')"}],staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"show-search":""}},e._l(e.week_days,(function(a,r){return t("a-select-option",{key:a.name},[e._v("\n "+e._s(a.name)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"وضعیت فعال بودن"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:e.inputSwitch("active"),expression:"inputSwitch('active')"}]},[t("a-icon",{attrs:{slot:"checkedChildren",type:"check"},slot:"checkedChildren"}),t("a-icon",{attrs:{slot:"unCheckedChildren",type:"close"},slot:"unCheckedChildren"})],1)],1),t("a-form-item",{staticClass:"md:col-span-3",attrs:{label:"آدرس"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:e.input("address"),expression:"input('address')"}]})],1)],1),t("a-button",{staticStyle:{"margin-top":"3em"},attrs:{type:"primary","html-type":"submit"}},[e._v("\n "+e._s(e.id?"ویرایش مکتب":"ثبت مکتب")+"\n ")])],1)],1)],1)},n=[],i=(a("96cf"),a("1da1")),s=a("bb36"),o=a("8855"),c=a("a632"),u=a.n(c),l={name:"Add",data:function(){return{loading:!1,form:this.$form.createForm(this,{name:"coordinated"}),masters:void 0,cloony:void 0,master_id:void 0,year_establish:void 0,year_establish_hasVal:!0,inputSwitch:o["c"],inputFa:o["b"],input:o["a"],week_days:[{name:"شنبه"},{name:"یک شنبه"},{name:"دو شنبه"},{name:"سه شنبه"},{name:"چهار شنبه"},{name:"پنج شنبه"},{name:"جمعه"}]}},components:{datepicker:u.a},computed:{id:function(){return this.$route.params.id}},methods:{handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(a,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a){e.next=38;break}if(r.master_id=t.master_id,t.year_establish&&(r.year_establish=t.year_establish),!t.id){e.next=22;break}return e.prev=4,t.loading=!0,e.next=8,s["b"].put("/admin/maktab/".concat(t.id),r);case 8:return t.$message.success("اطلاعات با موفقیت به روز رسانی شد"),e.next=11,t.$router.push({name:"maktab-list"});case 11:e.next=17;break;case 13:e.prev=13,e.t0=e["catch"](4),console.log(e.t0),t.$message.error("خطا در ثبت اطلاعات");case 17:return e.prev=17,t.loading=!1,e.finish(17);case 20:e.next=38;break;case 22:return e.prev=22,t.loading=!0,e.next=26,s["b"].post("/admin/maktab",r);case 26:return t.$message.success("اطلاعات با موفقیت ثبت شد"),e.next=29,t.$router.push({name:"maktab-list"});case 29:e.next=35;break;case 31:e.prev=31,e.t1=e["catch"](22),console.log(e.t1),t.$message.error("خطا در ثبت اطلاعات");case 35:return e.prev=35,t.loading=!1,e.finish(35);case 38:case"end":return e.stop()}}),e,null,[[4,13,17,20],[22,31,35,38]])})));return function(t,a){return e.apply(this,arguments)}}())},getMasters:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s["b"].get("/admin/list/master");case 3:t=e.sent,a=t.data,this.masters=a,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0);case 11:return e.prev=11,e.finish(11);case 13:case"end":return e.stop()}}),e,this,[[0,8,11,13]])})));function t(){return e.apply(this,arguments)}return t}(),getCloony:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s["b"].get("/admin/list/cloony");case 3:t=e.sent,a=t.data,this.cloony=a,e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0),this.$message.error("خطا در دریافت کلونی");case 12:return e.prev=12,e.finish(12);case 14:case"end":return e.stop()}}),e,this,[[0,8,12,14]])})));function t(){return e.apply(this,arguments)}return t}(),fetchEdit:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){var a,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["b"].get("/admin/maktab/".concat(t));case 2:a=e.sent,r=a.data,this.form.setFieldsValue(r);case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},created:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,this.getCloony();case 3:if(!this.id){e.next=6;break}return e.next=6,this.fetchEdit(this.id);case 6:this.loading=!1;case 7:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},d=l,m=(a("ee83"),a("2877")),p=Object(m["a"])(d,r,n,!1,null,"4357d898",null);t["default"]=p.exports},9417:function(e,t,a){},ee83:function(e,t,a){"use strict";a("9417")}}]); //# sourceMappingURL=chunk-e78a0952.9d54e84f.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure