(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0bce7e"],{"2a70":function(e,l,o){"use strict";o.r(l);var a=function(){var e=this,l=e.$createElement,o=e._self._c||l;return o("a-modal",{staticStyle:{top:"5%",height:"85%","overflow-y":"hidden"},attrs:{title:e.title,width:800,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭",wrapClassName:"ant-modal-cust-warp"},on:{ok:e.handleOk,cancel:e.handleCancel}},[o("a-spin",{attrs:{spinning:e.confirmLoading}},[o("a-form-model",e._b({ref:"form",attrs:{model:e.model,rules:e.validatorRules}},"a-form-model",e.layout,!1),[o("a-form-model-item",{attrs:{label:"角色编码",required:"",prop:"roleCode"}},[o("a-input",{attrs:{disabled:e.roleDisabled,placeholder:"请输入角色编码"},model:{value:e.model.roleCode,callback:function(l){e.$set(e.model,"roleCode",l)},expression:"model.roleCode"}})],1),o("a-form-model-item",{attrs:{label:"角色名称",required:"",prop:"roleName"}},[o("a-input",{attrs:{placeholder:"请输入角色名称"},model:{value:e.model.roleName,callback:function(l){e.$set(e.model,"roleName",l)},expression:"model.roleName"}})],1),o("a-form-model-item",{attrs:{label:"描述",prop:"description"}},[o("a-textarea",{attrs:{rows:5,placeholder:"请输入角色描述"},model:{value:e.model.description,callback:function(l){e.$set(e.model,"description",l)},expression:"model.description"}})],1)],1)],1)],1)},i=[],t=o("4ec3"),s={name:"RoleModal",data:function(){return{title:"操作",visible:!1,roleDisabled:!1,model:{},layout:{labelCol:{span:3},wrapperCol:{span:14}},confirmLoading:!1,validatorRules:{roleName:[{required:!0,message:"请输入角色名称!"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],roleCode:[{required:!0,message:"请输入角色名称!"},{min:0,max:64,message:"长度不超过 64 个字符",trigger:"blur"},{validator:this.validateRoleCode}],description:[{min:0,max:126,message:"长度不超过 126 个字符",trigger:"blur"}]}}},created:function(){this.modelDefault=JSON.parse(JSON.stringify(this.model))},methods:{add:function(){this.edit(this.modelDefault)},edit:function(e){this.model=Object.assign({},e),this.visible=!0,this.model.id?this.roleDisabled=!0:this.roleDisabled=!1},close:function(){this.$refs.form.clearValidate(),this.$emit("close"),this.visible=!1},handleOk:function(){var e=this,l=this;this.$refs.form.validate((function(o){if(!o)return!1;var a;l.confirmLoading=!0,a=e.model.id?Object(t["q"])(e.model):Object(t["d"])(e.model),a.then((function(e){e.success?(l.$message.success(e.message),l.$emit("ok")):l.$message.warning(e.message)})).finally((function(){l.confirmLoading=!1,l.close()}))}))},handleCancel:function(){this.close()},validateRoleCode:function(e,l,o){if(/[\u4E00-\u9FA5]/g.test(l))o("角色编码不可输入汉字!");else{var a={tableName:"sys_role",fieldName:"role_code",fieldVal:l,dataId:this.model.id};Object(t["m"])(a).then((function(e){e.success?o():o(e.message)}))}}}},r=s,d=o("2877"),n=Object(d["a"])(r,a,i,!1,null,"4cfa5d06",null);l["default"]=n.exports}}]);