import{o as g,i as x,e as p,d as A,r as u,D as Z,E as T,k as U,bM as G,a as s,h as t,w as l,g as P,u as a,ar as F,aq as m,f as v,t as V,G as z,s as J,v as K,aa as Q,_ as W}from"./index-1bf93bc4.js";import{g as X}from"./system-1c72a0cc.js";import{u as E}from"./hooks-7d7381e1.js";import{d as Y}from"./git-branch-line-aa4cb38f.js";import{d as ee}from"./search-cc37b371.js";import{d as te}from"./more-2-fill-a666858a.js";import{d as oe}from"./office-building-cc7a1721.js";const ne={width:24,height:24,body:''},le=ne,ae={width:1024,height:1024,body:''},se=ae,re={width:"32",height:"32",viewBox:"0 0 24 24"},ie=p("path",{fill:"currentColor",d:"M22 4V2H2v2h9v14.17l-5.5-5.5-1.42 1.41L12 22l7.92-7.92-1.42-1.41-5.5 5.5V4h9Z"},null,-1),ce=[ie];function de(d,h){return g(),x("svg",re,ce)}const ue={render:de},pe={width:"32",height:"32",viewBox:"0 0 24 24"},he=p("path",{fill:"currentColor",d:"M4 2H2v20h2v-9h14.17l-5.5 5.5 1.41 1.42L22 12l-7.92-7.92-1.41 1.42 5.5 5.5H4V2Z"},null,-1),_e=[he];function fe(d,h){return g(),x("svg",pe,_e)}const me={render:fe},ve=d=>(J("data-v-591f8f47"),d=d(),K(),d),ge={class:"flex items-center h-[34px]"},xe=ve(()=>p("p",{class:"flex-1 ml-2 font-bold text-base truncate",title:"部门列表"}," 部门列表 ",-1)),ye=A({__name:"tree",setup(d){const h=u(),y=u([]),_=u(!0),i=u(""),r=u({}),{proxy:N}=Q(),R={children:"children",label:"name"},w=Z(()=>["!h-[20px]","reset-margin","!text-gray-500","dark:!text-white","dark:hover:!text-primary"]),S=(o,e)=>o?e.name.includes(o):!0;function B(o){var n;const e=o.$treeNodeId;r.value[e]=(n=r.value[e])!=null&&n.highlight?Object.assign({id:e},r.value[e],{highlight:!1}):Object.assign({id:e},r.value[e],{highlight:!0}),Object.values(r.value).forEach(f=>{f.id!==e&&(f.highlight=!1)})}function C(o){_.value=o;const e=N.$refs.treeRef.store._getAllNodes();for(let n=0;n{h.value.filter(o)}),U(async()=>{const{data:o}=await X();y.value=G(o)}),(o,e)=>{const n=s("IconifyIconOffline"),f=s("el-icon"),H=s("el-input"),b=s("el-button"),k=s("el-dropdown-item"),L=s("el-dropdown-menu"),O=s("el-dropdown"),j=s("el-divider"),q=s("el-tree");return g(),x("div",{class:"h-full bg-bg_color overflow-auto",style:z({minHeight:"calc(100vh - 133px)"})},[p("div",ge,[xe,t(H,{style:{flex:"2"},size:"small",modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=c=>i.value=c),placeholder:"请输入部门名称",clearable:""},{suffix:l(()=>[t(f,{class:"el-input__icon"},{default:l(()=>[P(t(n,{icon:a(ee)},null,8,["icon"]),[[F,i.value.length===0]])]),_:1})]),_:1},8,["modelValue"]),t(O,{"hide-on-click":!1},{dropdown:l(()=>[t(L,null,{default:l(()=>[t(k,null,{default:l(()=>[t(b,{class:m(w.value),link:"",type:"primary",icon:a(E)(_.value?a(ue):a(me)),onClick:e[1]||(e[1]=c=>C(!_.value))},{default:l(()=>[v(V(_.value?"折叠全部":"展开全部"),1)]),_:1},8,["class","icon"])]),_:1}),t(k,null,{default:l(()=>[t(b,{class:m(w.value),link:"",type:"primary",icon:a(E)(a(le)),onClick:D},{default:l(()=>[v(" 重置状态 ")]),_:1},8,["class","icon"])]),_:1})]),_:1})]),default:l(()=>[t(n,{class:"w-[28px] cursor-pointer",width:"18px",icon:a(te)},null,8,["icon"])]),_:1})]),t(j),t(q,{ref_key:"treeRef",ref:h,data:y.value,"node-key":"id",size:"small",props:R,"default-expand-all":"","expand-on-click-node":!1,"filter-node-method":S,onNodeClick:B},{default:l(({node:c,data:I})=>{var $,M;return[p("span",{class:m(["pl-1","pr-1","rounded","flex","items-center","select-none",i.value.trim().length>0&&c.label.includes(i.value)&&"text-red-500",($=r.value[c.id])!=null&&$.highlight?"dark:text-primary":""]),style:z({background:(M=r.value[c.id])!=null&&M.highlight?"var(--el-color-primary-light-7)":"transparent"})},[t(n,{icon:I.type===1?a(oe):I.type===2?a(se):a(Y)},null,8,["icon"]),v(" "+V(c.label),1)],6)]}),_:1},8,["data"])],4)}}});const Ve=W(ye,[["__scopeId","data-v-591f8f47"]]);export{Ve as default};