mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 08:57:19 +08:00
2 lines
5.1 KiB
JavaScript
2 lines
5.1 KiB
JavaScript
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-DqH6biyS.js";import{u as se}from"./hooks-BoDRUKFd.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:'<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"/>'},ue={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"/>'},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<t.length;i++)t[i].expanded=n}function L(){r.value={},h.value="",z(!0)}return te(h,n=>{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};
|