/
home
/
maktab
/
admin
/
js
/
File Upload :
llllll
Current File: /home/maktab/admin/js/chunk-0f995ee9.be2e8561.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0f995ee9"],{"1cef":function(e,t,r){"use strict";r("7f7f");var a=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:"".concat(e.id?" ویرایش ".concat(e.title):" افزودن ".concat(e.title)," ")}},[t("a-form",{attrs:{form:e.form}},[t("div",[t("div",{staticClass:"grid md:grid-cols-3 gap-2"},[e._t("default"),t("a-form-item",{attrs:{label:"نام"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:e.inputFa("fname"),expression:"inputFa('fname')"}]})],1),t("a-form-item",{attrs:{label:"نام خانوادگی"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:e.inputFa("lname"),expression:"inputFa('lname')"}]})],1),t("a-form-item",{attrs:{label:"تلفن همراه"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["mobile"],expression:"['mobile']"}],attrs:{type:"number"}})],1),t("a-form-item",{attrs:{label:"پسورد"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:e.input("password"),expression:"input('password')"}]})],1),e._t("beforeImg"),t("a-form-item",{attrs:{label:"تصویر"}},[t("SingleImageCropperUploadTest",{ref:"photo",on:{ok:e.picUploaded,remove:e.picRemove}})],1)],2),t("a-button",{attrs:{type:"primary","html-type":"submit"}},[e._v("\n "+e._s(e.id?"ویرایش ":"ثبت ")+"\n ")])],1),e.id?t("div",[t("div",{staticClass:"flex mt-8 mr-2 font-bold"},[t("div",{staticClass:"mr-2"},[e._v("متد افزودن اکانت:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.picked,expression:"picked"}],staticClass:"mr-2",attrs:{type:"radio",id:"دستی"},domProps:{value:1,checked:e._q(e.picked,1)},on:{change:function(t){e.picked=1}}}),t("label",{staticClass:"mr-2",attrs:{for:"دستی"}},[e._v("دستی")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.picked,expression:"picked"}],staticClass:"mr-2",attrs:{type:"radio",id:"اتوماتیک"},domProps:{value:2,checked:e._q(e.picked,2)},on:{change:function(t){e.picked=2}}}),t("label",{attrs:{for:"اتوماتیک"}},[e._v("اتوماتیک")])]),2===e.picked?t("a-form-item",{attrs:{label:"از کاربر"}},[t("a-select",{staticClass:"mt-2 grid md:grid-cols-3 gap-2",staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"show-search":""},model:{value:e.from_user_id,callback:function(t){e.from_user_id=t},expression:"from_user_id"}},e._l(e.users,(function(r,a){return t("a-select-option",{key:r.id},[e._v("\n "+e._s(r.name)+"\n ")])})),1),t("a-button",{staticClass:"mt-6",attrs:{type:"primary","html-type":"submit"},on:{click:function(t){return e.autoMethod()}}},[e._v("ثبت ")])],1):e._e(),1===e.picked?t("div",[t("a-button",{staticClass:"mr-2 mt-6",on:{click:e.addMaktab}},[e._v(" افزودن اکانت ")]),e._l(e.users_to_maktab,(function(r,a){return t("div",{key:a},[t("div",{key:a,staticClass:"grid md:grid-cols-3 gap-2"},[t("a-form-item",{attrs:{label:"مکتب"}},[t("a-select",{staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"show-search":""},model:{value:e.users_to_maktab[a].maktab_id,callback:function(t){e.$set(e.users_to_maktab[a],"maktab_id",t)},expression:"users_to_maktab[index].maktab_id"}},e._l(e.maktabs,(function(r,a){return t("a-select-option",{key:r.id},[e._v("\n "+e._s(r.title)+"\n ")])})),1)],1),e.users_to_maktab[a].maktab_id?t("a-form-item",{attrs:{label:"نوع"}},[t("a-select",{staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"show-search":""},model:{value:e.users_to_maktab[a].type,callback:function(t){e.$set(e.users_to_maktab[a],"type",t)},expression:"users_to_maktab[index].type"}},e._l(e.types,(function(r,a){return t("a-select-option",{key:r.id},[e._v("\n "+e._s(r.title)+"\n ")])})),1)],1):t("div"),"4"===e.users_to_maktab[a].type?t("a-form-item",{attrs:{label:"نقش"}},[t("a-select",{staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"show-search":""},model:{value:e.users_to_maktab[a].type_employee,callback:function(t){e.$set(e.users_to_maktab[a],"type_employee",t)},expression:"users_to_maktab[index].type_employee"}},e._l(e.roles,(function(r,a){return t("a-select-option",{key:r.id},[e._v("\n "+e._s(r.title)+"\n ")])})),1)],1):t("div")],1),t("div",{staticClass:"flex"},[t("a-button",{attrs:{type:"primary","html-type":"submit"},on:{click:function(t){return e.manualMethod(a)}}},[e._v(" ثبت ")]),t("a-button",{staticClass:"flex justify-center items-center ml-2",attrs:{type:"danger"},on:{click:function(t){return e.removeMaktab(a)}}},[e._v(" حذف ")])],1)])}))],2):e._e()],1):e._e()])],1),t("a-modal",{on:{cancel:e.handleCancel,ok:e.handleOk},model:{value:e.openModal,callback:function(t){e.openModal=t},expression:"openModal"}},[t("div",{staticClass:"p-6"},[e._v("تمامی اطلاعات از کاربر انتخابی به کاربر جاری منتقل و کاربر انتخابی حذف خواهد شد، آیا مطمئن هستید؟")])])],1)},n=[],i=(r("8e6e"),r("ac6a"),r("456d"),r("ade3")),s=(r("96cf"),r("1da1")),o=r("bb36"),c=r("8855"),u=r("402d");function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){Object(i["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p={name:"UserDefault",components:{SingleImageCropUpload:u["a"],SingleImageCropperUploadTest:u["a"]},data:function(){return{picked:null,setAuto:null,openModal:!1,from_user_id:void 0,users_to_maktab:[{maktab_id:void 0,type_employee:void 0,type:void 0}],maktabs:[],users:[],roles:[],types:[{id:"1",title:"مدیران"},{id:"2",title:"مدیر کلونی"},{id:"3",title:"مدیر"},{id:"4",title:"کارمند"},{id:"5",title:"مدیر کل"},{id:"6",title:"مشتری"}],form:this.$form.createForm(this,{name:"coordinated"}),file_id:void 0,input:c["a"],inputFa:c["b"]}},computed:{id:function(){return this.$route.params.id}},props:{loading:{type:Boolean,default:!1},title:{type:String,default:!1},isStudent:{type:Boolean,default:!1},listRoute:{},models:{},userUrl:{}},methods:{getMaktabs:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o["b"].post("admin/maktab/table");case 3:t=e.sent,r=t.data.rows,this.maktabs=r,e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0),this.$message.error("خطا در دریافت مکتب");case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}(),addMaktab:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.users_to_maktab.unshift({maktab_id:void 0,type_employee:void 0,type:void 0});case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),removeMaktab:function(e){this.users_to_maktab.splice(e,1)},getRoles:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o["b"].get("admin/const/key/type_employee");case 3:t=e.sent,this.roles=t.data.map((function(e){return{id:e.id,title:e.value}})),e.next=11;break;case 7:e.prev=7,e.t0=e["catch"](0),console.log(e.t0),this.$message.error("خطا در دریافت مکتب");case 11:return e.prev=11,e.finish(11);case 13:case"end":return e.stop()}}),e,this,[[0,7,11,13]])})));function t(){return e.apply(this,arguments)}return t}(),autoMethod:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:try{this.openModal=!0}catch(t){console.log(t),this.$message.error("خطا در انجام عملیات")}case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),manualMethod:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,r=this.users_to_maktab[t],e.next=4,o["b"].post("admin/users-to-maktab",{maktab_id:r.maktab_id,type:r.type,type_employee:r.type_employee,user_id:this.id});case 4:e.next=10;break;case 6:e.prev=6,e.t0=e["catch"](0),console.log(e.t0),this.$message.error("خطا در انجام عملیات");case 10:return e.prev=10,e.finish(10);case 12:case"end":return e.stop()}}),e,this,[[0,6,10,12]])})));function t(t){return e.apply(this,arguments)}return t}(),handleCancel:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.openModal=!1;case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),handleOk:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o["b"].post("admin/users-to-maktab-by-user",{from_user_id:this.from_user_id,user_id:this.id});case 2:this.openModal=!1;case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),getUsers:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o["b"].post("admin/users/table");case 3:t=e.sent,r=t.data.rows,this.users=r,e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0),this.$message.error("خطا در دریافت کاربر");case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}(),handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(r,a){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isStudent){e.next=13;break}if(!t.models.birth_day){e.next=5;break}t.$emit("birth_day",!0),e.next=7;break;case 5:return t.$emit("birth_day",!1),e.abrupt("return");case 7:if(!t.models.father_birthday){e.next=11;break}t.$emit("father_birthday",!0),e.next=13;break;case 11:return t.$emit("father_birthday",!1),e.abrupt("return");case 13:if(r){e.next=55;break}if(t.models&&(a=d(d({},a),t.models)),t.file_id&&(a.file_id=t.file_id),a.users_to_maktab=t.users_to_maktab,!t.id){e.next=38;break}return e.prev=18,t.loading=!0,e.next=22,o["b"].put("".concat(t.userUrl,"/").concat(t.id),a);case 22:if(t.$message.success("اطلاعات با موفقیت به روز رسانی شد"),!t.listRoute){e.next=26;break}return e.next=26,t.$router.push({name:"".concat(t.listRoute)});case 26:t.$emit("ok"),e.next=33;break;case 29:e.prev=29,e.t0=e["catch"](18),console.log(e.t0),422===e.t0.response.status?t.$message.error("شماره همراه توسط شخص دیگری در حال استفاده است"):t.$message.error("خطا در ثبت اطلاعات");case 33:return e.prev=33,t.loading=!1,e.finish(33);case 36:e.next=55;break;case 38:return e.prev=38,t.loading=!0,e.next=42,o["b"].post(t.userUrl,a);case 42:if(t.$message.success("اطلاعات با موفقیت ثبت شد"),!t.listRoute){e.next=46;break}return e.next=46,t.$router.push({name:"".concat(t.listRoute)});case 46:e.next=52;break;case 48:e.prev=48,e.t1=e["catch"](38),console.log(e.t1),422===e.t1.status?t.$message.error("شماره همراه توسط شخص دیگری در حال استفاده است"):t.$message.error("خطا در ثبت اطلاعات");case 52:return e.prev=52,t.loading=!1,e.finish(52);case 55:case"end":return e.stop()}}),e,null,[[18,29,33,36],[38,48,52,55]])})));return function(t,r){return e.apply(this,arguments)}}())},picUploaded:function(e){this.file_id=e.id},picRemove:function(e){this.file_id=void 0},fetchEdit:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o["b"].get("".concat(this.userUrl,"/").concat(t));case 2:r=e.sent,a=r.data,this.form.setFieldsValue(a),a.file&&a.file.full_src&&(this.file_id=a.file.id,this.$refs.photo.fileList.push({uid:a.file.id,status:"done",name:a.file.title,response:{id:a.file.id,image:a.file.full_src},url:a.file.full_src})),a.users_to_maktab&&(this.users_to_maktab=a.users_to_maktab.map((function(e){return{maktab_id:e.maktab_id,type_employee:e.type_employee,type:e.type}})));case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},mounted:function(){var e=Object(s["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.getMaktabs();case 3:return e.next=5,this.getUsers();case 5:return e.next=7,this.getRoles();case 7:if(!this.id){e.next=10;break}return e.next=10,this.fetchEdit(this.id);case 10:this.loading=!1;case 11:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},m=p,f=r("2877"),h=Object(f["a"])(m,a,n,!1,null,"7fe312df",null);t["a"]=h.exports},"8e6e":function(e,t,r){var a=r("5ca1"),n=r("990b"),i=r("6821"),s=r("11e9"),o=r("f1ae");a(a.S,"Object",{getOwnPropertyDescriptors:function(e){var t,r,a=i(e),c=s.f,u=n(a),l={},d=0;while(u.length>d)r=c(a,t=u[d++]),void 0!==r&&o(l,t,r);return l}})},"990b":function(e,t,r){var a=r("9093"),n=r("2621"),i=r("cb7c"),s=r("7726").Reflect;e.exports=s&&s.ownKeys||function(e){var t=a.f(i(e)),r=n.f;return r?t.concat(r(e)):t}},adc9:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("UserDefault",{attrs:{"user-url":"/admin/clony/master",loading:e.loading,title:"مدیر کلونی","list-route":"clony-managers-list"}})],1)},n=[],i=(r("96cf"),r("1da1")),s=r("bb36"),o=r("1cef"),c=r("8855"),u={name:"Add",components:{UserDefault:o["a"]},data:function(){return{loading:!1,maktabs:[],maktab_id:void 0,input:c["a"]}},methods:{getMaktabs:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,r;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/maktab");case 3:t=e.sent,r=t.data,this.maktabs=r,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}()},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.getMaktabs();case 3:this.loading=!1;case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},l=u,d=r("2877"),p=Object(d["a"])(l,a,n,!1,null,"0807ef19",null);t["default"]=p.exports},f1ae:function(e,t,r){"use strict";var a=r("86cc"),n=r("4630");e.exports=function(e,t,r){t in e?a.f(e,t,n(0,r)):e[t]=r}}}]); //# sourceMappingURL=chunk-0f995ee9.be2e8561.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure