var w=(D,o,e)=>new Promise((c,l)=>{var r=a=>{try{d(e.next(a))}catch(m){l(m)}},t=a=>{try{d(e.throw(a))}catch(m){l(m)}},d=a=>a.done?c(a.value):Promise.resolve(a.value).then(r,t);d((e=e.apply(D,o)).next())});import{d as F,f as p,u as g,U as n,a2 as v,ad as k,af as s,k as _,a3 as x,F as b,ae as S,G as $,a5 as z,a4 as h}from"./vue-vendor-CxLCUzY4.js";import{u as A,B as E}from"./index-CJ4Xt1FM.js";import{i as G,j as P,k as T}from"./depart.user.api-BbJ42Ps1.js";import"./index-Cy4uayzW.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useTimeout-gJpgadD6.js";import"./useIntersectionObserver-FVRzwlSd.js";const H={style:{width:"100%","margin-top":"15px"}},ne=F({__name:"DepartRoleUserAuthDrawer",emits:["register"],setup(D){const o=p(!1),e=p(""),c=p(""),l=p(""),r=p([]),t=p([]),[d,{closeDrawer:a}]=A(u=>{e.value=g(u.userId),c.value=g(u.departId),m()});function m(){return w(this,null,function*(){try{o.value=!0;const u={departId:c.value,userId:e.value},[i,y]=yield Promise.all([G(u),P(u)]);r.value=i,t.value=y.map(I=>I.droleId),l.value=t.value.join(",")}finally{o.value=!1}})}function B(){return w(this,null,function*(){try{o.value=!0,yield T({userId:e.value,newRoleId:t.value.join(","),oldRoleId:l.value}),U()}finally{o.value=!1}})}function C(){R()}function U(){R(),a()}function R(){e.value="",c.value="",l.value="",r.value=[],t.value=[]}return(u,i)=>{const y=n("a-checkbox"),I=n("a-col"),L=n("a-row"),N=n("a-checkbox-group"),V=n("a-button"),j=n("a-empty"),q=n("a-spin");return v(),k(g(E),{title:"部门角色分配",width:365,onClose:C,onRegister:g(d)},{default:s(()=>[_(q,{spinning:o.value},{default:s(()=>[r.value.length>0?(v(),x(b,{key:0},[_(N,{value:t.value,"onUpdate:value":i[0]||(i[0]=f=>t.value=f)},{default:s(()=>[_(L,null,{default:s(()=>[(v(!0),x(b,null,S(r.value,f=>(v(),k(I,{span:24},{default:s(()=>[_(y,{value:f.id},{default:s(()=>[$(z(f.roleName),1)]),_:2},1032,["value"])]),_:2},1024))),256))]),_:1})]),_:1},8,["value"]),h("div",H,[_(V,{type:"primary",loading:o.value,size:"small",preIcon:"ant-design:save-filled",onClick:B},{default:s(()=>i[1]||(i[1]=[h("span",null,"点击保存",-1)])),_:1},8,["loading"])])],64)):(v(),k(j,{key:1,description:"无配置信息"}))]),_:1},8,["spinning"])]),_:1},8,["onRegister"])}}});export{ne as default};
