File: /var/www/html/public/static/js/tree-768e68db.js
import{v as A}from"./message-2472a54a.js";import{X as q}from"./index-2632a64c.js";import{getDeptList as T}from"./system-158110c7.js";import{u as H}from"./hooks-925dc7bd.js";import{d as U}from"./git-branch-line-94a7fefb.js";import{d as Z}from"./search-cc37b371.js";import{e as g,f as x,g as p,d as F,r as h,c as P,w as Q,o as X,Q as r,y as t,m as a,p as G,u as n,n as m,v,x as I,j as J,b5 as K,b4 as W,L as Y}from"./runtime-core.esm-bundler-6128546f.js";import{_ as ee}from"./_plugin-vue_export-helper-c27b6911.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./vue-router-a383d220.js";import"./utils-2ab4f76a.js";import"./index-9676aad5.js";const te={width:24,height:24,body:'<path fill="currentColor" d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/>'},oe=te,ne={width:24,height:24,body:'<path fill="currentColor" d="M12 3c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 14c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z"/>'},le=ne,ae={width:1024,height:1024,body:'<path fill="currentColor" d="M192 128v704h384V128H192zm-32-64h448a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z"/><path fill="currentColor" d="M256 256h256v64H256v-64zm0 192h256v64H256v-64zm0 192h256v64H256v-64zm384-128h128v64H640v-64zm0 128h128v64H640v-64zM64 832h896v64H64v-64z"/><path fill="currentColor" d="M640 384v448h192V384H640zm-32-64h256a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H608a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32z"/>'},re=ae,se={width:1024,height:1024,body:'<path fill="currentColor" d="M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32z"/><path fill="currentColor" d="M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416zM512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544z"/><path fill="currentColor" d="M544 384h96a32 32 0 1 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0v96z"/>'},ie=se,ce={width:"32",height:"32",viewBox:"0 0 24 24"},de=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),he=[de];function pe(d,u){return g(),x("svg",ce,he)}const ue={render:pe},_e={width:"32",height:"32",viewBox:"0 0 24 24"},fe=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),me=[fe];function ve(d,u){return g(),x("svg",_e,me)}const ge={render:ve},xe=d=>(K("data-v-48934549"),d=d(),W(),d),ye={class:"h-full min-h-[780px] bg-bg_color overflow-auto"},we={class:"flex items-center h-[34px]"},Ce=xe(()=>p("p",{class:"flex-1 ml-2 font-bold text-base truncate",title:"部门列表"}," 部门列表 ",-1)),ze=F({__name:"tree",setup(d){const u=h(),y=h([]),_=h(!0),i=h(""),s=h({}),{proxy:V}=Y(),N={children:"children",label:"name"},w=P(()=>["!h-[20px]","reset-margin","!text-gray-500","dark:!text-white","dark:hover:!text-primary"]),R=(o,e)=>o?e.name.includes(o):!0;function S(o){var l;const e=o.$treeNodeId;s.value[e]=(l=s.value[e])!=null&&l.highlight?Object.assign({id:e},s.value[e],{highlight:!1}):Object.assign({id:e},s.value[e],{highlight:!0}),Object.values(s.value).forEach(f=>{f.id!==e&&(f.highlight=!1)})}function C(o){_.value=o;const e=V.$refs.treeRef.store._getAllNodes();for(let l=0;l<e.length;l++)e[l].expanded=o}function B(){s.value={},i.value="",C(!0)}return Q(i,o=>{u.value.filter(o)}),X(async()=>{const{data:o}=await T();y.value=q(o)}),(o,e)=>{const l=r("IconifyIconOffline"),f=r("el-icon"),E=r("el-input"),z=r("el-button"),b=r("el-dropdown-item"),L=r("el-dropdown-menu"),O=r("el-dropdown"),j=r("el-divider"),D=r("el-tree");return g(),x("div",ye,[p("div",we,[Ce,t(E,{style:{flex:"2"},size:"small",modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=c=>i.value=c),placeholder:"请输入部门名称",clearable:""},{suffix:a(()=>[t(f,{class:"el-input__icon"},{default:a(()=>[G(t(l,{icon:n(Z)},null,8,["icon"]),[[A,i.value.length===0]])]),_:1})]),_:1},8,["modelValue"]),t(O,{"hide-on-click":!1},{dropdown:a(()=>[t(L,null,{default:a(()=>[t(b,null,{default:a(()=>[t(z,{class:m(n(w)),link:"",type:"primary",icon:n(H)(_.value?n(ue):n(ge)),onClick:e[1]||(e[1]=c=>C(!_.value))},{default:a(()=>[v(I(_.value?"折叠全部":"展开全部"),1)]),_:1},8,["class","icon"])]),_:1}),t(b,null,{default:a(()=>[t(z,{class:m(n(w)),link:"",type:"primary",icon:n(H)(n(oe)),onClick:B},{default:a(()=>[v(" 重置状态 ")]),_:1},8,["class","icon"])]),_:1})]),_:1})]),default:a(()=>[t(l,{class:"w-[28px] cursor-pointer",width:"18px",icon:n(le)},null,8,["icon"])]),_:1})]),t(j),t(D,{ref_key:"treeRef",ref:u,data:y.value,"node-key":"id",size:"small",props:N,"default-expand-all":"","expand-on-click-node":!1,"filter-node-method":R,onNodeClick:S},{default:a(({node:c,data:k})=>{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",(M=s.value[c.id])!=null&&M.highlight?"dark:text-primary":""]),style:J({background:($=s.value[c.id])!=null&&$.highlight?"var(--el-color-primary-light-7)":"transparent"})},[t(l,{icon:k.type===1?n(re):k.type===2?n(ie):n(U)},null,8,["icon"]),v(" "+I(c.label),1)],6)]}),_:1},8,["data"])])}}});const De=ee(ze,[["__scopeId","data-v-48934549"]]);export{De as default};