text: (function(e){function a(a){for(var r,i,n=a[0],l=a[1],d=a[2],u=0,v=[];u<n.length;u++)i=n[u],s[i]&&v.push(s[i][0]),s[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);c&&c(a);while(v.length)v.shift()();return o.push.apply(o,d||[]),t()}function t(){for(var e,a=0;a<o.length;a++){for(var t=o[a],r=!0,n=1;n<t.length;n++){var l=t[n];0!==s[l]&&(r=!1)}r&&(o.splice(a--,1),e=i(i.s=t[0]))}return e}var r={},s={add_coach:0},o=[];function i(a){if(r[a])return r[a].exports;var t=r[a]={i:a,l:!1,exports:{}};return e[a].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=r,i.d=function(e,a,t){i.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:t})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,a){if(1&a&&(e=i(e)),8&a)return e;if(4&a&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var r in e)i.d(t,r,function(a){return e[a]}.bind(null,r));return t},i.n=function(e){var a=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(a,"a",a),a},i.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},i.p="/";var n=window["webpackJsonp"]=window["webpackJsonp"]||[],l=n.push.bind(n);n.push=a,n=n.slice();for(var d=0;d<n.length;d++)a(n[d]);var c=l;o.push([1,"chunk-vendors"]),t()})({"076e":function(e,a,t){"use strict";var r=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("v-footer",{attrs:{height:"auto",color:"primary lighten-1"}},[t("v-layout",{attrs:{"justify-center":"",row:"",wrap:""}},[e._l(e.links,function(a){return t("v-btn",{key:a[0],attrs:{color:"white",flat:"",round:"",href:a[1]}},[e._v("\n      "+e._s(a[0])+"\n    ")])}),t("v-flex",{attrs:{primary:"","lighten-2":"","py-3":"","text-xs-center":"","white--text":"",xs12:""}},[e._v("\n      ©2018 — "),t("strong",[e._v("DCMMC")])])],2)],1)},s=[],o={data(){return{links:[["首页","/"],["关于我们","/404/404.html"],["查看学员信息","/view-student.html"],["查看教练信息","/view-coach.html"],["添加学员信息","/add-student.html"],["添加教练信息","/add-coach.html"]]}}},i=o,n=t("2877"),l=t("6544"),d=t.n(l),c=t("8336"),u=t("0e8f"),v=t("553a"),p=t("a722"),m=Object(n["a"])(i,r,s,!1,null,null,null);m.options.__file="footer.vue";a["a"]=m.exports;d()(m,{VBtn:c["a"],VFlex:u["a"],VFooter:v["a"],VLayout:p["a"]})},"0ee6":function(e,a,t){"use strict";t.r(a);var r=t("2b0e"),s=(t("402c"),function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("v-app",[t("BooomHeader"),t("v-dialog",{attrs:{persistent:"","max-width":"200",transition:"dialog-transition"},model:{value:e.loading,callback:function(a){e.loading=a},expression:"loading"}},[t("v-card",[t("v-container",{attrs:{"justify-center":""}},[t("v-card-title",{staticClass:"headline"},[e._v("正在加载")]),t("v-card-text",[t("v-progress-circular",{attrs:{indeterminate:"",color:"purple"}})],1)],1)],1)],1),t("v-dialog",{attrs:{scrollable:"",persistent:"","max-width":"400"},model:{value:e.dialog_msg,callback:function(a){e.dialog_msg=a},expression:"dialog_msg"}},[t("v-card",[t("v-card-title",{staticClass:"headline"},[e._v(e._s(e.status))]),t("v-card-text",[e._v(e._s(e.msg))]),t("v-card-actions",[t("v-spacer"),t("v-btn",{attrs:{color:"green darken-1",flat:""},nativeOn:{click:function(a){e.dialog_msg=!1}}},[e._v("了解")])],1)],1)],1),t("v-content",[t("v-container",{attrs:{"justify-center":""}},[t("v-layout",{attrs:{row:""}},[t("v-flex",[t("div",{staticClass:"headline"},[e._v("添加教练信息")]),t("v-form",[t("v-text-field",{directives:[{name:"validate",rawName:"v-validate",value:"required|max:10",expression:"'required|max:10'"}],attrs:{"error-messages":e.errors.collect("name"),"data-vv-name":"name",label:"姓名",required:""},model:{value:e.name,callback:function(a){e.name=a},expression:"name"}}),t("v-text-field",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{"error-messages":e.errors.collect("card"),"data-vv-name":"card",label:"NFC卡号",required:""},model:{value:e.cardId,callback:function(a){e.cardId=a},expression:"cardId"}}),t("v-text-field",{directives:[{name:"validate",rawName:"v-validate",value:"required|digits:11",expression:"'required|digits:11'"}],attrs:{"error-messages":e.errors.collect("mobile"),"data-vv-name":"mobile",label:"手机号",required:""},model:{value:e.mobile,callback:function(a){e.mobile=a},expression:"mobile"}}),t("v-text-field",{directives:[{name:"validate",rawName:"v-validate",value:{required:!0,regex:/^[0-9a-zA-Z]{6,16}$/},expression:"{required: true, regex: /^[0-9a-zA-Z]{6,16}$/}"}],attrs:{"error-messages":e.errors.collect("password"),label:"密码","data-vv-name":"password",required:""},model:{value:e.password,callback:function(a){e.password=a},expression:"password"}}),t("v-text-field",{directives:[{name:"validate",rawName:"v-validate",value:{required:!0,confirmed:e.password,regex:/^[0-9a-zA-Z]{6,16}$/},expression:"{required: true, confirmed:password, regex: /^[0-9a-zA-Z]{6,16}$/}"}],attrs:{"error-messages":e.errors.collect("password_confirmation"),"data-vv-as":"password","data-vv-name":"password_confirmation",label:"确认密码",required:""},model:{value:e.password_confirm,callback:function(a){e.password_confirm=a},expression:"password_confirm"}}),t("v-select",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{items:["男","女"],"error-messages":e.errors.collect("select"),label:"性别","data-vv-name":"select",required:""},model:{value:e.sex,callback:function(a){e.sex=a},expression:"sex"}}),t("file-pond",{ref:"pond",attrs:{name:"headphoto","label-idle":"点击选择文件或者把头像文件拖到这里","allow-multiple":"false","accepted-file-types":"image/jpeg, image/png",allowImageResize:"true",imageResizeUpscale:"false",imageResizeTargetWidth:"600","max-files":"1"}}),t("v-btn",{on:{click:e.submit}},[e._v("确认")]),t("v-btn",{on:{click:e.clear}},[e._v("清除")])],1)],1)],1)],1)],1),t("BooomFooter")],1)}),o=[],i=t("bc3a"),n=t.n(i),l=t("7bb1"),d=t("076e"),c=t("71c2"),u=t("1501"),v=t.n(u),p=(t("4ed3"),t("57c8"),t("1942")),m=t.n(p),f=t("2cfc"),h=t.n(f),g=t("3505"),b=t.n(g);const x=v()(m.a,h.a,b.a);r["default"].use(l["a"]);var _={name:"AddCoach",$_veeValidate:{validator:"new"},components:{BooomFooter:d["a"],FilePond:x,BooomHeader:c["a"]},data:()=>({name:"",mobile:"",sex:"",cardId:"",password:"",password_confirm:"",headphoto_file:[],dialog_msg:!1,loading:!1,msg:"",status:"",dictionary:{attributes:{},custom:{name:{required:()=>"名字不能为空",max:"名字不能多于 10 个字符"},mobile:{required:()=>"请输入手机号",digits:()=>"请输入 11 位手机号"},select:{required:()=>"请选择性别"},card:{required:()=>"请输出NFC卡号"},password:{required:()=>"请输入密码",regex:()=>"请输入 6~16 位数字和大/小写英文字母组成的密码"},password_confirmation:{required:()=>"不能为空",confirmed:()=>"请重复输入密码",regex:()=>"请输入 6~16 位数字和大/小写英文字母组成的密码"}}}}),mounted(){this.$validator.localize("zh_cn",this.dictionary)},methods:{submit(){this.$validator.validateAll().then(e=>{if(e){this.loading=!0,"男"===this.sex?this.sex="male":"女"===this.sex&&(this.sex="female");const e=new FormData;if(this.headphoto_file=this.$refs.pond.getFiles(),this.headphoto_file.length>0){const a=this.$refs.pond.getFile();e.append("headphoto",a.file,this.mobile+"."+a.fileExtension)}else console.log("no headphoto");e.append("target","coach"),e.append("name",this.name),e.append("sex",this.sex),e.append("cardId",this.cardId),e.append("mobile",this.mobile),e.append("update",!1),e.append("password",this.password),n.a.post("/addData",e,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{this.loading=!1,this.msg=e.data["msg"],parseInt(e.data["code"])>0?this.status="失败":this.status="成功",this.dialog_msg=!0}).catch(e=>{this.loading=!1,this.msg=e,this.status="错误",console.log("errors"),this.dialog_msg=!0})}})},clear(){this.name="",this.mobile="",this.sex="",this.cardId="",this.password="",this.password_confirm="",this.$validator.reset()}}},w=_,y=t("2877"),V=t("6544"),q=t.n(V),C=t("7496"),k=t("8336"),j=t("b0af"),$=t("99d9"),F=t("12b2"),O=t("a523"),T=t("549c"),z=t("169a"),A=t("0e8f"),I=t("4bd4"),N=t("a722"),P=t("490a"),S=t("b56d"),B=t("9910"),M=t("2677"),D=Object(y["a"])(w,s,o,!1,null,null,null);D.options.__file="AddCoach.vue";var E=D.exports;q()(D,{VApp:C["a"],VBtn:k["a"],VCard:j["a"],VCardActions:$["a"],VCardText:$["b"],VCardTitle:F["a"],VContainer:O["a"],VContent:T["a"],VDialog:z["a"],VFlex:A["a"],VForm:I["a"],VLayout:N["a"],VProgressCircular:P["a"],VSelect:S["a"],VSpacer:B["a"],VTextField:M["a"]});t("35c4");r["default"].config.productionTip=!1,new r["default"]({render:e=>e(E)}).$mount("#add-coach")},1:function(e,a,t){e.exports=t("0ee6")},"35c4":function(e,a,t){},"402c":function(e,a,t){"use strict";var r=t("2b0e"),s=t("bb71");t("da64");r["default"].use(s["a"],{iconfont:"md"})},"71c2":function(e,a,t){"use strict";var r=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("v-toolbar",{attrs:{app:"",color:"teal"}},[t("v-toolbar-title",{staticClass:"title"},[t("span",[e._v("Demo")]),t("span",[e._v(" 数据库管理")])]),t("v-spacer"),t("v-btn",{attrs:{flat:"",href:"/logout_handler"}},[t("span",{staticClass:"title"},[e._v("退出登录")])])],1)},s=[],o={data(){return{}}},i=o,n=t("2877"),l=t("6544"),d=t.n(l),c=t("8336"),u=t("9910"),v=t("71d9"),p=t("2a7f"),m=Object(n["a"])(i,r,s,!1,null,null,null);m.options.__file="header.vue";a["a"]=m.exports;d()(m,{VBtn:c["a"],VSpacer:u["a"],VToolbar:v["a"],VToolbarTitle:p["a"]})}});
  //# sourceMappingURL=add_coach.dc8dc27f.js.map