text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-44b18044"],{2017:function(e,t,n){"use strict";var s=n("b12d"),o=n.n(s);o.a},9067:function(e,t,n){},"9c1f":function(e,t,n){"use strict";var s=n("db72e"),o=n.n(s);o.a},"9ed6":function(e,t,n){"use strict";n.r(t);var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login-container"},[n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"}},[n("div",{staticClass:"title-container"},[n("h3",{staticClass:"title"},[e._v("Maga Controle")])]),e._v(" "),n("el-form-item",{attrs:{prop:"empresa"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"star"}})],1),e._v(" "),n("el-input",{ref:"empresa",attrs:{placeholder:"Empresa",name:"empresa",type:"text",tabindex:"1"},model:{value:e.loginForm.empresa,callback:function(t){e.$set(e.loginForm,"empresa",t)},expression:"loginForm.empresa"}})],1),e._v(" "),n("el-form-item",{attrs:{prop:"username"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"user"}})],1),e._v(" "),n("el-input",{ref:"username",attrs:{placeholder:"Usuário",name:"username",type:"text",tabindex:"2",autocomplete:"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),e._v(" "),n("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:e.capsTooltip,callback:function(t){e.capsTooltip=t},expression:"capsTooltip"}},[n("el-form-item",{attrs:{prop:"password"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"password"}})],1),e._v(" "),n("el-input",{key:e.passwordType,ref:"password",attrs:{type:e.passwordType,placeholder:"Senha",name:"password",tabindex:"3",autocomplete:"on"},on:{blur:function(t){e.capsTooltip=!1}},nativeOn:{keyup:[function(t){return e.checkCapslock(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}]},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),e._v(" "),n("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[n("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1)],1),e._v(" "),n("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("Entrar")])],1),e._v(" "),n("el-dialog",{attrs:{title:"Or connect with",visible:e.showDialog},on:{"update:visible":function(t){e.showDialog=t}}},[e._v("\n    Can not be simulated on local, so please combine you own business simulation! ! !\n    "),n("br"),e._v(" "),n("br"),e._v(" "),n("br"),e._v(" "),n("social-sign")],1)],1)},o=[],a=(n("ac6a"),n("456d"),n("61f7"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"social-signup-container"},[n("div",{staticClass:"sign-btn",on:{click:function(t){return e.wechatHandleClick("wechat")}}},[n("span",{staticClass:"wx-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),e._v("\n    WeChat\n  ")]),e._v(" "),n("div",{staticClass:"sign-btn",on:{click:function(t){return e.tencentHandleClick("tencent")}}},[n("span",{staticClass:"qq-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{"icon-class":"qq"}})],1),e._v("\n    QQ\n  ")])])}),i=[],r={name:"SocialSignin",methods:{wechatHandleClick:function(e){alert("ok")},tencentHandleClick:function(e){alert("ok")}}},c=r,l=(n("d9fb"),n("2877")),u=Object(l["a"])(c,a,i,!1,null,"7309fbbb",null),p=u.exports,d={name:"Login",components:{SocialSign:p},data:function(){var e=function(e,t,n){t.length<5?n(new Error("Mínimo de 5 dígitos")):n()};return{loginForm:{empresa:"data",username:"caixa",password:"123456"},loginRules:{empresa:[{required:!0,trigger:"blur"}],password:[{required:!0,trigger:"blur",validator:e}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()},destroyed:function(){},methods:{checkCapslock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.shiftKey,n=e.key;n&&1===n.length&&(this.capsTooltip=!!(t&&n>="a"&&n<="z"||!t&&n>="A"&&n<="Z")),"CapsLock"===n&&!0===this.capsTooltip&&(this.capsTooltip=!1)},showPwd:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick(function(){e.$refs.password.focus()})},handleLogin:function(){var e=this;this.$refs.loginForm.validate(function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,console.log(e.loginForm),e.$store.dispatch("user/login",e.loginForm).then(function(t){console.log(e.redirect),e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loading=!1}).catch(function(){e.loading=!1})})},getOtherQuery:function(e){return Object.keys(e).reduce(function(t,n){return"redirect"!==n&&(t[n]=e[n]),t},{})}}},m=d,f=(n("2017"),n("9c1f"),Object(l["a"])(m,s,o,!1,null,"4bff7a7f",null));t["default"]=f.exports},b12d:function(e,t,n){},d9fb:function(e,t,n){"use strict";var s=n("9067"),o=n.n(s);o.a},db72e:function(e,t,n){}}]);