import{_ as e,r as a,p as t,u as l,y as s,v as n,z as u,a3 as r,a4 as i,a5 as o,a as d,c,w as p,d as v,L as h,e as y,H as m,C as f,D as g,F as x,a6 as _,a7 as w,f as k,i as b,o as C,a8 as z,V as E,a9 as T,aa as A,B as N,a0 as F,ab as I,ac as V,S as B,ad as D,E as P,k as U,ae as $,b as j,af as H}from"./index-BlslIQWi.js";const L=e({__name:"UserCard",props:["userId"],setup(e,{expose:C}){const z=a({}),E=a(),T=t((()=>0===(z.value.depts||[]).length?"未设置部门":z.value.depts.join("、")));function A(){E.value.close()}return C({show:function(e){_(e).then((e=>{z.value=e.data,E.value.open("center")}))},hide:A}),(e,a)=>{const t=k,_=l(n("uni-tag"),s),C=b,N=l(n("uni-icons"),u),F=l(n("uni-list-item"),r),I=l(n("uni-list"),i),V=l(n("uni-popup"),o);return d(),c(V,{ref_key:"userCardPopup",ref:E,type:"center"},{default:p((()=>[v(C,{class:"w-user-card"},{default:p((()=>[v(h,{class:"w-avatar",src:z.value.avatar,name:z.value.username,size:55,showName:!1},null,8,["src","name"]),v(C,null,{default:p((()=>[v(t,{style:{"margin-right":"10px"}},{default:p((()=>[y(m(z.value.username),1)])),_:1}),(d(!0),f(x,null,g(z.value.roles||[],((e,a)=>(d(),c(_,{type:"warning",size:"mini",text:e,inverted:"",key:`r${a}`},null,8,["text"])))),128))])),_:1}),v(N,{class:"w-xicon",type:"closeempty",color:"#A2A2A2",size:20,onClick:A}),v(I,{class:"w-user-info"},{default:p((()=>[v(F,{title:"所属部门",rightText:T.value,"show-extra-icon":"","extra-icon":{type:"home"}},null,8,["rightText"]),v(F,{title:"入职时间",rightText:z.value.entryDate,"show-extra-icon":"","extra-icon":{type:"calendar"}},null,8,["rightText"]),v(F,{title:"性别",rightText:z.value.sex?"男":"女","show-extra-icon":"","extra-icon":{type:"staff"}},null,8,["rightText"]),v(F,{title:"电话",onClick:a[0]||(a[0]=e=>{w({phoneNumber:"18866668888"})}),"show-extra-icon":"",rightText:"18866668888",clickable:"","show-arrow":"","extra-icon":{type:"phone"}})])),_:1})])),_:1})])),_:1},512)}}},[["__scopeId","data-v-5975a4bb"]]),O=e({__name:"contacts",setup(e){const u=a(),o=a(0),_=a(""),w=a([]),O=a([]),S=a([{name:"组织",id:0}]),J=t((()=>P().windowHeight-105));a(!1);const q=t((()=>""!==_.value.trim()?w.value:O.value));function G(){const e=JSON.parse(E("loginUser"));T({deptId:o.value+"P"+e.sn,type:"user"}).then((e=>{O.value=e.data,loadOrgPath()})).catch((e=>{}))}return C((()=>G())),z((()=>(u.value.hide(),S.value.length>1&&(S.value.length--,o.value=S.value[S.value.length-1].id,G(),!0)))),A(_,(()=>{""!==_.value.trim()&&(w.value.length=0,H({userName:_.value.trim()}).then((e=>{w.value=e.data})).catch((e=>{})))})),(e,a)=>{const t=l(n("uni-search-bar"),F),w=b,C=l(n("uni-breadcrumb-item"),I),z=l(n("uni-breadcrumb"),V),E=B,T=U,A=k,P=l(n("uni-tag"),s),H=l(n("uni-list-item"),r),K=l(n("uni-list"),i);return d(),f(x,null,[v(w,{style:{padding:"0 0 16rpx 0","background-color":"white"}},{default:p((()=>[v(w,{class:"search"},{default:p((()=>[v(t,{modelValue:_.value,"onUpdate:modelValue":a[0]||(a[0]=e=>_.value=e),bgColor:"#EEEEEE",radius:"5",placeholder:"搜索人员",clearButton:"auto",cancelButton:"none"},null,8,["modelValue"])])),_:1}),v(w,{style:{padding:"6rpx 16rpx"}},{default:p((()=>[v(E,{"scroll-x":""},{default:p((()=>[v(z,{separator:">"},{default:p((()=>[(d(!0),f(x,null,g(S.value,((e,a)=>(d(),c(C,{key:a,onClick:t=>{return l=e.id,s=a,o.value=l,S.value.length=s+1,void G();var l,s}},{default:p((()=>[v(w,{style:N({color:a+1===S.value.length?"#989996":"#1E90FD","font-size":"32rpx"})},{default:p((()=>[y(m(e.name),1)])),_:2},1032,["style"])])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})])),_:1}),O.value.length>0?(d(),c(E,{key:0,class:"w-org-list","scroll-y":"",style:N({height:J.value+"px"})},{default:p((()=>[v(K,null,{default:p((()=>[(d(!0),f(x,null,g(q.value,((e,a)=>(d(),c(H,{clickable:"",showArrow:"dept"===e.type,key:`${e.type}_${e.id}`,class:"w-org-item",onClick:a=>function(e){"dept"===e.type?(o.value=e.id,S.value.push({name:e.name,id:e.id}),G()):"user"===e.type&&u.value.show(e.id)}(e)},{header:p((()=>[v(w,{class:"w-org-avatar"},{default:p((()=>["user"===e.type?(d(),c(h,{key:0,name:e.name,src:e.avatar,showName:!1},null,8,["name","src"])):(d(),c(T,{key:1,"lazy-load":"",mode:"aspectFit",src:$}))])),_:2},1024)])),body:p((()=>[v(w,{style:{display:"flex","align-items":"center"}},{default:p((()=>[v(A,{style:{"font-size":"32rpx"}},{default:p((()=>[y(m(e.name),1)])),_:2},1024),e.isLeader?(d(),c(w,{key:0,style:{display:"flex","align-items":"center","margin-left":"16rpx"}},{default:p((()=>[v(P,{type:"warning",size:"mini",text:"部门负责人",inverted:""})])),_:1})):j("",!0)])),_:2},1024)])),_:2},1032,["showArrow","onClick"])))),128))])),_:1})])),_:1},8,["style"])):(d(),c(w,{key:1,style:{width:"100%"}},{default:p((()=>[v(T,{mode:"aspectFit",style:{width:"100%"},src:D})])),_:1})),v(L,{ref_key:"userCard",ref:u},null,512)],64)}}},[["__scopeId","data-v-5512bd08"]]);export{O as default};
