webpackJsonp([20],{VqB7:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a("3Xzz"),l=(a("Mk6G"),a("3E4D"),a("Ch4/")),i=(a("PI0u"),a("P9l9")),n={name:"setChildAdmin",data:function(){return{navpath:[{name:"首页",path:"/index",relocation:!0},{name:"设置",path:"/companyAddress"},{name:"设置子管理员",path:""}],boxHeight:window.screen.availHeight+"px",activeId:1,adminRole:[],roleListData:[{roleParentName:"集团",children:[{roleId:"1",roleName:"超级管理员"},{roleId:"2",roleName:"企业管理员"}]},{roleParentName:"集团",children:[{roleId:"3",roleName:"超级管理员"},{roleId:"4",roleName:"企业管理员"}]}],roleRightObj:{name:"超级管理员",tip:"企业的创建者，拥有企业的所有权限，只会有一个",auth:1},tableData:[{id:1,name:"张三",phone:"13333333333",depart:"技术部"}],currentPage:1,pageSize:20,total:0}},computed:{},methods:{changeRoute:function(e){this.$router.push(e)},toRoleDetail:function(){this.changeRoute("/addAdminrole?roleId="+this.activeId)},selectRole:function(e){this.activeId=e,this.getRoleUsers()},toAddRole:function(){this.changeRoute("/addAdmin?roleId="+this.activeId)},handleSizeChange:function(e){this.pageSize=e,this.getRoleUsers()},handleCurrentChange:function(e){this.currentPage=e,this.getRoleUsers()},getRoleUsers:function(){var e=this,t={roleId:e.activeId,pageSize:e.pageSize,pageNum:e.currentPage};Object(i.b)("/haoban-manage-web/role-user-list",t).then(function(t){var a=t.data;if(1==a.errorCode)return a.result&&a.result.result?(e.tableData=a.result.result,void(e.total=a.result.totalCount)):(e.$message.error({duration:1e3,message:"暂无数据"}),!1);l.a.errorMsg(a)}).catch(function(t){console.log(t),e.$message.error({duration:1e3,message:t.message})})},getRoles:function(){var e=this;Object(i.b)("/haoban-manage-web/role-list",{}).then(function(t){var a=t.data;if(1==a.errorCode)return e.adminRole=a.result,void(a.result&&a.result.length&&(e.activeId=e.adminRole[0].roleId,e.getRoleUsers()));l.a.errorMsg(a)}).catch(function(t){console.log(t),e.$message.error({duration:1e3,message:t.message})})}},mounted:function(){this.boxHeight=window.screen.availHeight-430+"px",this.getRoles()},components:{navCrumb:o.a}},r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"setChildAdmin-wrap common-set-wrap"},[a("nav-crumb",{attrs:{navpath:e.navpath}}),e._v(" "),a("div",{staticClass:"right-content"},[a("div",{staticClass:"right-box"},[a("div",{staticClass:"setChildAdmin-wrap-body flex"},[a("div",{staticClass:"setChildAdmin-wrap-left w-260",style:{height:e.boxHeight}},[a("div",{staticClass:"text-center"},[a("el-button",{on:{click:function(t){e.changeRoute("/addAdminrole")}}},[e._v("新增管理员角色")])],1),e._v(" "),e._l(e.roleListData,function(t,o){return a("div",{key:o,staticClass:"m-t-20"},[a("div",{staticClass:"role-cell-head"},[e._v(e._s(t.roleParentName))]),e._v(" "),a("ul",e._l(t.children,function(t,o){return a("li",{key:o,class:["role-cell",t.roleId==e.activeId?"role-active":""],on:{click:function(a){a.stopPropagation(),e.selectRole(t.roleId)}}},[a("i",{staticClass:"iconfont icon-lizhi p-r-6"}),e._v(e._s(t.roleName))])}))])})],2),e._v(" "),a("div",{staticClass:"setChildAdmin-wrap-right box-sizing"},[a("div",{staticClass:"role-title flex flex-between"},[a("span",{staticClass:"font-20 color-303133"},[e._v(e._s(e.roleRightObj.name))]),0==e.roleRightObj.auth?a("span",{staticClass:"font-14 color-1890ff pinter",on:{click:e.toRoleDetail}},[e._v("查看权限")]):e._e(),1==e.roleRightObj.auth?a("span",{staticClass:"font-14 color-1890ff pinter",on:{click:e.toRoleDetail}},[e._v("编辑权限")]):e._e()]),e._v(" "),a("div",{staticClass:"role-tip m-t-27 m-b-25"},[a("el-alert",{attrs:{title:e.roleRightObj.tip,type:"info",closable:!1,"show-icon":""}})],1),e._v(" "),a("div",{staticClass:"role-add"},[a("el-button",{attrs:{type:"primary"},on:{click:e.toAddRole}},[e._v("添加成员")])],1),e._v(" "),a("div",{staticClass:"role-table "},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData}},[a("el-table-column",{attrs:{prop:"name",label:"姓名"}}),e._v(" "),a("el-table-column",{attrs:{prop:"phone",label:"手机号"}}),e._v(" "),a("el-table-column",{attrs:{prop:"depart",label:"部门"}})],1),e._v(" "),0!=e.tableData.length?a("div",{staticClass:"block common-wrap__page text-right"},[a("el-pagination",{attrs:{background:"","current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1):e._e()],1)])])])]),e._v(" "),a("vue-gic-footer")],1)},staticRenderFns:[]};var s=a("VU/8")(n,r,!1,function(e){a("tBJT")},"data-v-e5fc6bf0",null);t.default=s.exports},tBJT:function(e,t){}});
//# sourceMappingURL=20.150b78b26829fcbd5305.js.map