var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var M=(l,e,o)=>e in l?J(l,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[e]=o,g=(l,e)=>{for(var o in e||(e={}))W.call(e,o)&&M(l,o,e[o]);if(I)for(var o of I(e))X.call(e,o)&&M(l,o,e[o]);return l},x=(l,e)=>K(l,Q(e));import{f as w,k as y,g as p,d as Y,a as m,p as ee,n as te,e as s,A as le,B as $,i as a,w as d,a0 as oe,v as B,u,h as ne,t as N,s as ae,Z as re,_ as ie}from"./index-DVTACvpB.js";import{u as se}from"./hooks-t2HA245d.js";import{d as ce}from"./git-branch-line-BhusJOme.js";import{d as de}from"./more-2-fill-iTOisMwj.js";const he={width:1024,height:1024,body:''},ue={width:1024,height:1024,body:''},pe={width:"32",height:"32",viewBox:"0 0 24 24"};function ve(l,e){return w(),y("svg",pe,e[0]||(e[0]=[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.5V4z"},null,-1)]))}const fe={render:ve},_e={width:"32",height:"32",viewBox:"0 0 24 24"};function me(l,e){return w(),y("svg",_e,e[0]||(e[0]=[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.5H4z"},null,-1)]))}const ge={render:me},xe={class:"h-full bg-bg_color overflow-hidden relative",style:{minHeight:"calc(100vh - 141px)"}},we={class:"flex items-center h-[34px]"},ye=["title"],be=Y({__name:"tree",props:{treeLoading:Boolean,treeData:Array},emits:["tree-select"],setup(l,{expose:e,emit:o}){const O=o,b=m(),v=m(!0),h=m(""),r=m({}),{proxy:E}=re(),R={children:"children",label:"name"},j=ee(()=>["!h-[20px]","!text-sm","reset-margin","!text-[var(--el-text-color-regular)]","dark:!text-white","dark:hover:!text-primary"]),D=(n,t)=>n?t.name.includes(n):!0;function A(n){var i,f;const t=n.$treeNodeId;r.value[t]=(i=r.value[t])!=null&&i.highlight?Object.assign({id:t},r.value[t],{highlight:!1}):Object.assign({id:t},r.value[t],{highlight:!0}),Object.values(r.value).forEach(_=>{_.id!==t&&(_.highlight=!1)}),O("tree-select",(f=r.value[t])!=null&&f.highlight?Object.assign(x(g({},n),{selected:!0})):Object.assign(x(g({},n),{selected:!1})))}function z(n){v.value=n;const t=E.$refs.treeRef.store._getAllNodes();for(let i=0;i{b.value.filter(n)}),e({onTreeReset:L}),(n,t)=>{const i=s("IconifyIconOffline"),f=s("el-icon"),_=s("el-input"),S=s("el-button"),q=s("el-dropdown-item"),T=s("el-dropdown-menu"),U=s("el-dropdown"),P=s("el-divider"),Z=s("el-tree"),F=s("el-scrollbar"),G=le("loading");return $((w(),y("div",xe,[p("div",we,[a(_,{modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=c=>h.value=c),class:"ml-2",size:"small",placeholder:"请输入部门名称",clearable:""},{suffix:d(()=>[a(f,{class:"el-input__icon"},{default:d(()=>[$(a(i,{icon:"ri:search-line"},null,512),[[oe,h.value.length===0]])]),_:1})]),_:1},8,["modelValue"]),a(U,{"hide-on-click":!1},{dropdown:d(()=>[a(T,null,{default:d(()=>[a(q,null,{default:d(()=>[a(S,{class:B(j.value),link:"",type:"primary",icon:u(se)(v.value?u(fe):u(ge)),onClick:t[1]||(t[1]=c=>z(!v.value))},{default:d(()=>[ne(N(v.value?"折叠全部":"展开全部"),1)]),_:1},8,["class","icon"])]),_:1})]),_:1})]),default:d(()=>[a(i,{class:"w-[28px] cursor-pointer",width:"18px",icon:u(de)},null,8,["icon"])]),_:1})]),a(P),a(F,{height:"calc(90vh - 88px)"},{default:d(()=>[a(Z,{ref_key:"treeRef",ref:b,data:l.treeData,"node-key":"id",size:"small",props:R,"default-expand-all":"","expand-on-click-node":!1,"filter-node-method":D,onNodeClick:A},{default:d(({node:c,data:C})=>{var k,H,V;return[p("div",{class:B(["rounded","flex","items-center","select-none","hover:text-primary",h.value.trim().length>0&&c.label.includes(h.value)&&"text-red-500",(k=r.value[c.id])!=null&&k.highlight?"dark:text-primary":""]),style:ae({color:(H=r.value[c.id])!=null&&H.highlight?"var(--el-color-primary)":"",background:(V=r.value[c.id])!=null&&V.highlight?"var(--el-color-primary-light-7)":"transparent"})},[a(i,{icon:C.type===1?u(he):C.type===2?u(ue):u(ce)},null,8,["icon"]),p("span",{class:"!w-[120px] !truncate",title:c.label},N(c.label),9,ye)],6)]}),_:1},8,["data"])]),_:1})])),[[G,l.treeLoading]])}}}),Ie=ie(be,[["__scopeId","data-v-992558e7"]]);export{Ie as default};