1 line
4.6 KiB
JavaScript
1 line
4.6 KiB
JavaScript
webpackJsonp([45],{Lep5:function(n,e,r){(n.exports=r("uszS")(!1)).push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},"bd+d":function(n,e,r){var t=r("Lep5");"string"==typeof t&&(t=[[n.i,t,""]]),t.locals&&(n.exports=t.locals);r("Xatw")("46b92b9d",t,!0)},s6D0:function(n,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=r("vvmr"),l=r.n(t),a=r("s/F+"),s=r.n(a),o=r("yrbl"),i=r.n(o),u=r("EwHo"),m={mixins:[r("Z4qH").a],data:function(){return{dialogTitle:"新建员工",roleSelect:[],statusFlag:"",rules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}],fullname:[{required:!0,message:"请输入姓名",trigger:"blur"}],mobile:[{required:!0,message:"请输入手机号",trigger:"blur"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"}],role_strings_array:[{required:!0,message:"请选择角色",trigger:"blur"}]},ruleForm:{username:[],email:[],password:[],fullname:[],mobile:[],role_strings_array:[]}}},watch:{dialogType:function(n){1===n?(this.statusFlag=0,this.dialogTitle="新建员工"):this.dialogTitle="编辑员工"}},mounted:function(){var n=this;return i()(s.a.mark(function e(){var r,t;return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.a.getRoleList({},1,100);case 2:r=e.sent,t=r.records,n.roleSelect=t;case 5:case"end":return e.stop()}},e,n)}))()},methods:{editCallback:function(n){this.statusFlag=1===n.status},getResponseData:function(){var n=l()({},this.ruleForm),e=this.roleSelect,r=n.role_strings_array,t=void 0===r?[]:r;n.role_strings=t.map(function(n){return e.find(function(e){return e.id===n}).id}).join(",");var a={};return["username","password","fullname","mobile","email","role_strings","status","id"].map(function(e){return a[e]=n[e]}),a},createCallback:function(){return u.a.createEmployee(this.getResponseData())},updateCallback:function(){return u.a.updateEmployee(this.getResponseData())}}},c={render:function(){var n=this,e=n.$createElement,r=n._self._c||e;return r("el-dialog",{attrs:{title:n.dialogTitle,visible:n.dialogVisible,width:"50%"},on:{"update:visible":function(e){n.dialogVisible=e},close:n.closeDialog}},[r("el-form",{ref:"ruleForm",attrs:{model:n.ruleForm,rules:n.rules,"label-width":"180px"}},[r("el-form-item",{attrs:{label:"用户名",prop:"username"}},[r("el-input",{staticClass:"form-input",model:{value:n.ruleForm.username,callback:function(e){n.$set(n.ruleForm,"username",e)},expression:"ruleForm.username"}})],1),n._v(" "),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{staticClass:"form-input",model:{value:n.ruleForm.password,callback:function(e){n.$set(n.ruleForm,"password",e)},expression:"ruleForm.password"}})],1),n._v(" "),r("el-form-item",{attrs:{label:"姓名",prop:"fullname"}},[r("el-input",{staticClass:"form-input",model:{value:n.ruleForm.fullname,callback:function(e){n.$set(n.ruleForm,"fullname",e)},expression:"ruleForm.fullname"}})],1),n._v(" "),r("el-form-item",{attrs:{label:"手机号",prop:"mobile"}},[r("el-input",{staticClass:"form-input",model:{value:n.ruleForm.mobile,callback:function(e){n.$set(n.ruleForm,"mobile",e)},expression:"ruleForm.mobile"}})],1),n._v(" "),r("el-form-item",{attrs:{label:"邮箱",prop:"email"}},[r("el-input",{staticClass:"form-input",model:{value:n.ruleForm.email,callback:function(e){n.$set(n.ruleForm,"email",e)},expression:"ruleForm.email"}})],1),n._v(" "),r("el-form-item",{attrs:{label:"角色",prop:"role_strings_array"}},[r("el-checkbox-group",{model:{value:n.ruleForm.role_strings_array,callback:function(e){n.$set(n.ruleForm,"role_strings_array",e)},expression:"ruleForm.role_strings_array"}},n._l(n.roleSelect,function(e){return r("el-checkbox",{key:e.id,attrs:{label:e.id}},[n._v("\n "+n._s(e.name)+"\n ")])}))],1),n._v(" "),r("el-form-item",{attrs:{label:"状态"}},[r("el-switch",{attrs:{"active-text":"开启","inactive-text":"关闭"},model:{value:n.statusFlag,callback:function(e){n.statusFlag=e},expression:"statusFlag"}})],1)],1),n._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){n.dialogVisible=!1}}},[n._v("取 消")]),n._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:function(e){n.submitForm("ruleForm")}}},[n._v("确 定")])],1)],1)},staticRenderFns:[]};var p=r("rCDr")(m,c,!1,function(n){r("bd+d")},"data-v-8406d224",null);e.default=p.exports}}); |