(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1db91b90"],{"9d03":function(t,e,n){"use strict";var a,i;n.d(e,"a",(function(){return a})),function(t){t[t.LEADER=0]="LEADER",t[t.SUPER_ADMIN=1]="SUPER_ADMIN",t[t.CUSTOMER_ADMIN=2]="CUSTOMER_ADMIN",t[t.COMMON_MEMBER=3]="COMMON_MEMBER",t[t.CHILD_ADMIN=4]="CHILD_ADMIN"}(a||(a={})),function(t){t[t.PENDING=0]="PENDING",t[t.REJECT=1]="REJECT",t[t.PASS=2]="PASS"}(i||(i={}))},f085:function(t,e,n){"use strict";n.r(e);var a=(n("4de4"),n("d3b7"),n("159b"),n("2b0e")),i=n("9d03"),s=a.a.extend({name:"AuthManagement",components:{"main-page":function(){return n.e("chunk-6119f298").then(n.bind(null,"4c9e"))},"app-icon":function(){return Promise.all([n.e("chunk-0a381f90"),n.e("chunk-7c0e491e")]).then(n.bind(null,"73f7"))},"c-button":function(){return n.e("chunk-2d0df078").then(n.bind(null,"87be"))},"member-selector":function(){return n.e("chunk-1d2d0f28").then(n.bind(null,"ba3a"))}},data:function(){return{showMemberSelector:!1,selectedLeaderId:[],loading:!1,entInfo:{},leaderList:[],adminList:[],multiple:!1,selectorTitle:""}},mounted:function(){this.entInfo=JSON.parse(localStorage.getItem("ENT_INFO")),this.getSub()},methods:{confirm:function(t){0!==t.length&&this.changeRole(t[0],1,"add")},changeRole:function(t,e,n){var a=this;return this.loading=!0,this.$service.staff.changeRole({entId:this.entInfo.id,role:e,id:t}).then((function(t){var e=t.data;a.loading=!1,e.code===a.$global.success?(a.$toast("remove"===n?"删除成功":"添加成功"),a.$router.push("/team/team-management")):a.$toast(e.msg)})).catch((function(){return a.loading=!1}))},getSub:function(){var t=this;this.loading=!0;var e=this.entInfo,n=e.id,a=e.rootDepId;this.$service.department.getSub({entId:n,parentId:a,hasStaff:!0,isDirect:!1}).then((function(e){var n=e.data;t.loading=!1,n.code===t.$global.success?(t.leaderList=n.data.staffList.filter((function(t){return t.role===i.a.LEADER})),t.adminList=n.data.staffList.filter((function(t){return t.role===i.a.SUPER_ADMIN}))):t.$toast(n.msg)})).catch((function(){return t.loading=!1}))},removeManager:function(t){this.loading=!0,this.changeRole(t,3,"remove")},addManager:function(){var t=this;this.selectedLeaderId=[],this.adminList.length&&this.adminList.forEach((function(e){t.selectedLeaderId.push(e.id)})),this.showMemberSelector=!0,this.selectorTitle="添加管理员",this.multiple=!1}}}),c=n("2877"),r=Object(c.a)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"auth-management"},[n("main-page",{attrs:{"left-arrow":""},on:{"click-left":function(e){return t.$router.push("/team/team-management")}}},[n("member-selector",{attrs:{show:t.showMemberSelector,"show-team":!0,multiple:t.multiple,title:t.selectorTitle,"checked-member-id":t.selectedLeaderId},on:{"update:show":function(e){t.showMemberSelector=e},"update:checkedMemberId":function(e){t.selectedLeaderId=e},"update:checked-member-id":function(e){t.selectedLeaderId=e},confirm:t.confirm}}),n("div",{staticClass:"px-4 pt-14"},[n("div",{staticClass:"bg-white rounded px-4"},[n("div",{staticClass:"title py-1.5 text-sm text-text-secondary"},[t._v("权限范围")]),n("div",{staticClass:"content py-3 text-text-primary"},[n("div",{},[t._v("1.可以添加、管理部门")]),n("div",{},[t._v("2.可以添加、删除部门成员")])])]),n("div",{staticClass:"text-xs text-text-secondary mt-4"},[t._v("负责人")]),t.leaderList.length>0?n("div",t._l(t.leaderList,(function(e){return n("div",{key:e.id,staticClass:"flex items-center py-2"},[n("app-icon",{attrs:{"icon-name":"avator","class-name":"h-9 w-9 flex-shrink-0"}}),n("div",{staticClass:"name truncate ml-3"},[t._v(t._s(e.name))])],1)})),0):n("div",[t._v("\n        暂无负责人\n      ")]),n("div",{staticClass:"text-xs text-text-secondary mt-2"},[t._v("管理员")]),0===t.adminList.length?n("div",{staticClass:"text-text-secondary text-center text-sm pt-2"},[t._v("\n        暂无管理员\n      ")]):n("div",t._l(t.adminList,(function(e){return n("div",{key:e.id,staticClass:"flex items-center py-2"},[n("app-icon",{attrs:{"icon-name":"avator","class-name":"h-9 w-9 flex-shrink-0"}}),n("div",{staticClass:"name truncate mx-3"},[t._v(t._s(e.name))]),n("app-icon",{attrs:{"icon-name":"minus-round","class-name":"h-6 w-6 flex-shrink-0 ml-auto"},on:{click:function(n){return t.removeManager(e.id)}}})],1)})),0),n("c-button",{staticClass:"mt-4",attrs:{type:"text"},on:{click:t.addManager}},[n("template",{slot:"icon"},[n("app-icon",{attrs:{type:"png","icon-name":"plus","class-name":"w-6 h-6"}})],1),t._v("\n        添加管理员\n      ")],2)],1)],1)],1)}),[],!1,null,null,null);e.default=r.exports}}]);
//# sourceMappingURL=chunk-1db91b90.8b7ab9ee.js.map