(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d9522eb6"],{"1b9f":function(e,t,n){},"24fd":function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return o}));var r=n("b775");function a(){return Object(r["a"])({url:"/system/organization/",method:"get"})}function i(e){return Object(r["a"])({url:"/system/organization/",method:"post",data:e})}function s(e,t){return Object(r["a"])({url:"/system/organization/".concat(e,"/"),method:"put",data:t})}function o(e){return Object(r["a"])({url:"/system/organization/".concat(e,"/"),method:"delete"})}},"333d":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[n("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},a=[];n("c5f6");Math.easeInOutQuad=function(e,t,n,r){return e/=r/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function s(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,n){var r=o(),a=e-r,l=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=l;var o=Math.easeInOutQuad(u,r,a,t);s(o),u0,expression:"userList.count>0"}],attrs:{total:e.userList.count,page:e.listQuery.page,limit:e.listQuery.page_size},on:{"update:page":function(t){return e.$set(e.listQuery,"page",t)},"update:limit":function(t){return e.$set(e.listQuery,"page_size",t)},pagination:e.getList}})],1)],1)],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogVisible,title:"edit"===e.dialogType?"编辑用户":"新增用户"},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-form",{ref:"Form",attrs:{model:e.user,"label-width":"80px","label-position":"right",rules:e.rule1}},[n("el-form-item",{attrs:{label:"姓名",prop:"name"}},[n("el-input",{attrs:{placeholder:"姓名"},model:{value:e.user.name,callback:function(t){e.$set(e.user,"name",t)},expression:"user.name"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"账户",prop:"username"}},[n("el-input",{attrs:{placeholder:"账户"},model:{value:e.user.username,callback:function(t){e.$set(e.user,"username",t)},expression:"user.username"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"所属部门",prop:"dept"}},[n("treeselect",{attrs:{multiple:!1,options:e.orgData,placeholder:"所属部门"},model:{value:e.user.dept,callback:function(t){e.$set(e.user,"dept",t)},expression:"user.dept"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"角色",prop:"roles"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{multiple:"",placeholder:"请选择"},model:{value:e.user.roles,callback:function(t){e.$set(e.user,"roles",t)},expression:"user.roles"}},e._l(e.roles,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"头像",prop:"dept"}},[n("el-upload",{staticClass:"avatar-uploader",attrs:{action:e.upUrl,accept:"image/jpeg, image/gif, image/png, image/bmp","show-file-list":!1,"on-success":e.handleAvatarSuccess,"before-upload":e.beforeAvatarUpload,headers:e.upHeaders}},[e.user.avatar?n("img",{staticClass:"avatar",attrs:{src:e.user.avatar}}):n("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],1),e._v(" "),n("span",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.confirm("Form")}}},[e._v("确认")])],1)],1)],1)},a=[],i=(n("96cf"),n("1da1")),s=n("c24f"),o=n("24fd"),l=n("cc5e"),u=n("ed08"),c=n("e350"),d=n("3f5e"),p=n("333d"),f=n("ca17"),m=n.n(f),g=(n("542c"),{id:"",name:"",username:"",dept:null,avatar:"/media/default/avatar.png"}),h={components:{Pagination:p["a"],Treeselect:m.a},data:function(){return{user:g,upHeaders:Object(d["b"])(),upUrl:Object(d["c"])(),userList:{count:0},roles:[],listLoading:!0,listQuery:{page:1,page_size:20},enabledOptions:[{key:"true",display_name:"激活"},{key:"false",display_name:"禁用"}],dialogVisible:!1,dialogType:"new",rule1:{name:[{required:!0,message:"请输入姓名",trigger:"blur"}],username:[{required:!0,message:"请输入账号",trigger:"change"}]},filterOrgText:"",treeLoding:!1,orgData:[]}},computed:{},watch:{filterOrgText:function(e){this.$refs.tree.filter(e)}},created:function(){this.getList(),this.getOrgAll(),this.getRoleAll()},methods:{checkPermission:c["a"],handleAvatarSuccess:function(e,t){this.user.avatar=e.data.path},beforeAvatarUpload:function(e){var t=e.size/1024/1024<2;return t||this.$message.error("上传头像图片大小不能超过 2MB!"),t},filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},handleOrgClick:function(e,t,n){this.listQuery.page=1,this.listQuery.dept=e.id,this.getList()},getList:function(){var e=this;this.listLoading=!0,Object(s["e"])(this.listQuery).then((function(t){t.data&&(e.userList=t.data),e.listLoading=!1}))},getOrgAll:function(){var e=this;this.treeLoding=!0,Object(o["c"])().then((function(t){e.orgData=Object(u["b"])(t.data),e.treeLoding=!1}))},getRoleAll:function(){var e=this;Object(l["c"])().then((function(t){e.roles=Object(u["b"])(t.data)}))},resetFilter:function(){this.listQuery={page:1,page_size:20},this.getList()},handleFilter:function(){this.listQuery.page=1,this.getList()},handleAddUser:function(){var e=this;this.user=Object.assign({},g),this.dialogType="new",this.dialogVisible=!0,this.$nextTick((function(){e.$refs["Form"].clearValidate()}))},handleEdit:function(e){var t=this;this.user=Object.assign({},e.row),this.dialogType="edit",this.dialogVisible=!0,this.$nextTick((function(){t.$refs["Form"].clearValidate()}))},handleDelete:function(e){var t=this;this.$confirm("确认删除?","警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"error"}).then(Object(i["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(s["c"])(e.row.id);case 2:t.userList.splice(e.row.index,1),t.$message({type:"success",message:"成功删除!"});case 4:case"end":return n.stop()}}),n)})))).catch((function(e){console.error(e)}))},confirm:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$refs[t].validate((function(e){if(!e)return!1;var t="edit"===n.dialogType;t?Object(s["h"])(n.user.id,n.user).then((function(e){n.getList(),n.dialogVisible=!1,n.$message({message:"编辑成功",type:"success"})})):Object(s["b"])(n.user).then((function(e){n.getList(),n.dialogVisible=!1,n.$message({message:"新增成功",type:"success"})}))}));case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()}},b=h,v=(n("5cfa"),n("2877")),y=Object(v["a"])(b,r,a,!1,null,null,null);t["default"]=y.exports},baa8:function(e,t,n){"use strict";n("1b9f")},bc1c:function(e,t,n){},c5f6:function(e,t,n){"use strict";var r=n("7726"),a=n("69a8"),i=n("2d95"),s=n("5dbc"),o=n("6a99"),l=n("79e5"),u=n("9093").f,c=n("11e9").f,d=n("86cc").f,p=n("aa77").trim,f="Number",m=r[f],g=m,h=m.prototype,b=i(n("2aeb")(h))==f,v="trim"in String.prototype,y=function(e){var t=o(e,!1);if("string"==typeof t&&t.length>2){t=v?t.trim():p(t,3);var n,r,a,i=t.charCodeAt(0);if(43===i||45===i){if(n=t.charCodeAt(2),88===n||120===n)return NaN}else if(48===i){switch(t.charCodeAt(1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+t}for(var s,l=t.slice(2),u=0,c=l.length;ua)return NaN;return parseInt(l,r)}}return+t};if(!m(" 0o1")||!m("0b1")||m("+0x1")){m=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof m&&(b?l((function(){h.valueOf.call(n)})):i(n)!=f)?s(new g(y(t)),n,m):y(t)};for(var _,k=n("9e1e")?u(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;k.length>w;w++)a(g,_=k[w])&&!a(m,_)&&d(m,_,c(g,_));m.prototype=h,h.constructor=m,n("2aba")(r,f,m)}},cc5e:function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return l}));var r=n("b775");function a(){return Object(r["a"])({url:"/system/permission/",method:"get"})}function i(){return Object(r["a"])({url:"/system/role/",method:"get"})}function s(e){return Object(r["a"])({url:"/system/role/",method:"post",data:e})}function o(e,t){return Object(r["a"])({url:"/system/role/".concat(e,"/"),method:"put",data:t})}function l(e){return Object(r["a"])({url:"/system/role/".concat(e,"/"),method:"delete"})}},e350:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("6762"),n("2fdb");var r=n("4360");function a(e){if(e&&e instanceof Array&&e.length>0){var t=r["a"].getters&&r["a"].getters.perms,n=e;if(t.includes("admin"))return!0;var a=t.some((function(e){return n.includes(e)}));return!!a}return console.error("need perms! Like v-permission=\"['admin','editor']\""),!1}},fdef:function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}}]);