mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
var K=Object.defineProperty,Q=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var B=(t,e,o)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,C=(t,e)=>{for(var o in e||(e={}))X.call(e,o)&&B(t,o,e[o]);if(H)for(var o of H(e))Y.call(e,o)&&B(t,o,e[o]);return t},b=(t,e)=>Q(t,W(e));import{a1 as w,k as f,e as m,g as n,d as ee,a as x,Z as te,p as le,n as ne,h as s,A as oe,z as I,f as a,w as u,$ as re,u as p,v as O,j as ae,t as N,s as ie,_ as se}from"./index-DMqaFtX4.js";import{u as ce}from"./hooks-lfGvy6m_.js";const de={viewBox:"0 0 24 24",width:"1em",height:"1em"};function ue(t,e){return m(),f("svg",de,e[0]||(e[0]=[n("path",{fill:"currentColor",d:"M7.105 15.21A3.001 3.001 0 1 1 5 15.17V8.83a3.001 3.001 0 1 1 2 0V12c.836-.628 1.874-1 3-1h4a3 3 0 0 0 2.895-2.21a3.001 3.001 0 1 1 2.032.064A5 5 0 0 1 14 13h-4a3 3 0 0 0-2.895 2.21M6 17a1 1 0 1 0 0 2a1 1 0 0 0 0-2M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m12 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)]))}const he=w({name:"ri-git-branch-line",render:ue}),pe={viewBox:"0 0 24 24",width:"18",height:"18"};function fe(t,e){return m(),f("svg",pe,e[0]||(e[0]=[n("path",{fill:"currentColor",d:"M12 3c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0 14c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0-7c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2"},null,-1)]))}const me=w({name:"ri-more-2-fill",render:fe}),ve={viewBox:"0 0 1024 1024",width:"1em",height:"1em"};function _e(t,e){return m(),f("svg",ve,e[0]||(e[0]=[n("path",{fill:"currentColor",d:"M192 128v704h384V128zm-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-32"},null,-1),n("path",{fill:"currentColor",d:"M256 256h256v64H256zm0 192h256v64H256zm0 192h256v64H256zm384-128h128v64H640zm0 128h128v64H640zM64 832h896v64H64z"},null,-1),n("path",{fill:"currentColor",d:"M640 384v448h192V384zm-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-32"},null,-1)]))}const ge=w({name:"ep-office-building",render:_e}),xe={viewBox:"0 0 1024 1024",width:"1em",height:"1em"};function we(t,e){return m(),f("svg",xe,e[0]||(e[0]=[n("path",{fill:"currentColor",d:"M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32"},null,-1),n("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 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"},null,-1),n("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 0z"},null,-1)]))}const Ce=w({name:"ep-add-location",render:we}),be={width:"32",height:"32",viewBox:"0 0 24 24"};function ye(t,e){return m(),f("svg",be,e[0]||(e[0]=[n("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 ke={render:ye},ze={width:"32",height:"32",viewBox:"0 0 24 24"};function Me(t,e){return m(),f("svg",ze,e[0]||(e[0]=[n("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 Ve={render:Me},$e={class:"h-full bg-bg_color overflow-hidden relative",style:{minHeight:"calc(100vh - 141px)"}},He={class:"flex items-center h-[34px]"},Be=["title"],Ie=ee({__name:"tree",props:{treeLoading:Boolean,treeData:Array},emits:["tree-select"],setup(t,{expose:e,emit:o}){const R=o,y=x(),v=x(!0),h=x(""),i=x({}),{proxy:j}=te(),A={children:"children",label:"name"},D=le(()=>["h-[20px]!","text-sm!","reset-margin","text-(--el-text-color-regular)!","dark:text-white!","dark:hover:text-primary!"]),E=(r,l)=>r?l.name.includes(r):!0;function L(r){var c,_;const l=r.$treeNodeId;i.value[l]=(c=i.value[l])!=null&&c.highlight?Object.assign({id:l},i.value[l],{highlight:!1}):Object.assign({id:l},i.value[l],{highlight:!0}),Object.values(i.value).forEach(g=>{g.id!==l&&(g.highlight=!1)}),R("tree-select",(_=i.value[l])!=null&&_.highlight?Object.assign(b(C({},r),{selected:!0})):Object.assign(b(C({},r),{selected:!1})))}function k(r){v.value=r;const l=j.$refs.treeRef.store._getAllNodes();for(let c=0;c<l.length;c++)l[c].expanded=r}function S(){i.value={},h.value="",k(!0)}return ne(h,r=>{y.value.filter(r)}),e({onTreeReset:S}),(r,l)=>{const c=s("IconifyIconOffline"),_=s("el-icon"),g=s("el-input"),q=s("el-button"),T=s("el-dropdown-item"),U=s("el-dropdown-menu"),F=s("el-dropdown"),P=s("el-divider"),Z=s("el-tree"),G=s("el-scrollbar"),J=oe("loading");return I((m(),f("div",$e,[n("div",He,[a(g,{modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=d=>h.value=d),class:"ml-2",size:"small",placeholder:"请输入部门名称",clearable:""},{suffix:u(()=>[a(_,{class:"el-input__icon"},{default:u(()=>[I(a(c,{icon:"ri/search-line"},null,512),[[re,h.value.length===0]])]),_:1})]),_:1},8,["modelValue"]),a(F,{"hide-on-click":!1},{dropdown:u(()=>[a(U,null,{default:u(()=>[a(T,null,{default:u(()=>[a(q,{class:O(D.value),link:"",type:"primary",icon:p(ce)(v.value?p(ke):p(Ve)),onClick:l[1]||(l[1]=d=>k(!v.value))},{default:u(()=>[ae(N(v.value?"折叠全部":"展开全部"),1)]),_:1},8,["class","icon"])]),_:1})]),_:1})]),default:u(()=>[a(p(me),{class:"w-[28px] cursor-pointer outline-hidden"})]),_:1})]),a(P),a(G,{height:"calc(90vh - 88px)"},{default:u(()=>[a(Z,{ref_key:"treeRef",ref:y,data:t.treeData,"node-key":"id",size:"small",props:A,"default-expand-all":"","expand-on-click-node":!1,"filter-node-method":E,onNodeClick:L},{default:u(({node:d,data:z})=>{var M,V,$;return[n("div",{class:O(["rounded-sm","flex","items-center","select-none","hover:text-primary",h.value.trim().length>0&&d.label.includes(h.value)&&"text-red-500",(M=i.value[d.id])!=null&&M.highlight?"dark:text-primary":""]),style:ie({color:(V=i.value[d.id])!=null&&V.highlight?"var(--el-color-primary)":"",background:($=i.value[d.id])!=null&&$.highlight?"var(--el-color-primary-light-7)":"transparent"})},[a(c,{icon:z.type===1?p(ge):z.type===2?p(Ce):p(he)},null,8,["icon"]),n("span",{class:"w-[120px]! truncate!",title:d.label},N(d.label),9,Be)],6)]}),_:1},8,["data"])]),_:1})])),[[J,t.treeLoading]])}}}),je=se(Ie,[["__scopeId","data-v-bdf16f00"]]);export{je as default};
|