vue-pure-admin/dist/static/js/tree-196a1bba.js
2022-12-16 14:54:53 +08:00

2 lines
5.3 KiB
JavaScript

import{aj as $,_ as z}from"./index-1d030a9b.js";import{g as M}from"./system-90157bd5.js";import{u as v}from"./hooks-8128b668.js";import{d as B}from"./git-branch-line-7773f756.js";import{S}from"./search-931ae65f.js";import{M as D}from"./more-2-fill-1db5715e.js";import{d as R}from"./office-building-342e02a9.js";const F={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"/>'},L=F,O={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"/>'},j=O,H={width:"32",height:"32",viewBox:"0 0 24 24"},T=Vue.createElementVNode("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),A=[T];function q(r,a){return Vue.openBlock(),Vue.createElementBlock("svg",H,A)}const U={render:q},Z={width:"32",height:"32",viewBox:"0 0 24 24"},P=Vue.createElementVNode("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),G=[P];function J(r,a){return Vue.openBlock(),Vue.createElementBlock("svg",Z,G)}const K={render:J},Q=r=>(Vue.pushScopeId("data-v-628f3521"),r=r(),Vue.popScopeId(),r),W={class:"h-full min-h-[780px] bg-bg_color overflow-auto"},X={class:"flex items-center h-[34px]"},Y=Q(()=>Vue.createElementVNode("p",{class:"flex-1 ml-2 font-bold text-base truncate",title:"\u90E8\u95E8\u5217\u8868"}," \u90E8\u95E8\u5217\u8868 ",-1)),ee=Vue.defineComponent({__name:"tree",setup(r){const a=Vue.ref(),s=Vue.ref([]),c=Vue.ref(!0),l=Vue.ref(""),n=Vue.ref({}),{proxy:x}=Vue.getCurrentInstance(),C={children:"children",label:"name"},d=Vue.computed(()=>["!h-[20px]","reset-margin","!text-gray-500","dark:!text-white","dark:hover:!text-primary"]),g=(t,e)=>t?e.name.includes(t):!0;function w(t){var o;const e=t.$treeNodeId;n.value[e]=(o=n.value[e])!=null&&o.highlight?Object.assign({id:e},n.value[e],{highlight:!1}):Object.assign({id:e},n.value[e],{highlight:!0}),Object.values(n.value).forEach(i=>{i.id!==e&&(i.highlight=!1)})}function V(t){c.value=t;const e=x.$refs.treeRef.store._getAllNodes();for(let o=0;o<e.length;o++)e[o].expanded=t}function y(){n.value={},l.value="",V(!0)}return Vue.watch(l,t=>{a.value.filter(t)}),Vue.onMounted(async()=>{const{data:t}=await M();s.value=$(t)}),(t,e)=>{const o=Vue.resolveComponent("IconifyIconOffline"),i=Vue.resolveComponent("el-icon"),N=Vue.resolveComponent("el-input"),p=Vue.resolveComponent("el-button"),h=Vue.resolveComponent("el-dropdown-item"),E=Vue.resolveComponent("el-dropdown-menu"),k=Vue.resolveComponent("el-dropdown"),b=Vue.resolveComponent("el-divider"),I=Vue.resolveComponent("el-tree");return Vue.openBlock(),Vue.createElementBlock("div",W,[Vue.createElementVNode("div",X,[Y,Vue.createVNode(N,{style:{flex:"2"},size:"small",modelValue:l.value,"onUpdate:modelValue":e[0]||(e[0]=u=>l.value=u),placeholder:"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0",clearable:""},{suffix:Vue.withCtx(()=>[Vue.createVNode(i,{class:"el-input__icon"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(o,{icon:Vue.unref(S)},null,8,["icon"]),[[Vue.vShow,l.value.length===0]])]),_:1})]),_:1},8,["modelValue"]),Vue.createVNode(k,{"hide-on-click":!1},{dropdown:Vue.withCtx(()=>[Vue.createVNode(E,null,{default:Vue.withCtx(()=>[Vue.createVNode(h,null,{default:Vue.withCtx(()=>[Vue.createVNode(p,{class:Vue.normalizeClass(Vue.unref(d)),link:"",type:"primary",icon:Vue.unref(v)(c.value?Vue.unref(U):Vue.unref(K)),onClick:e[1]||(e[1]=u=>V(!c.value))},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(c.value?"\u6298\u53E0\u5168\u90E8":"\u5C55\u5F00\u5168\u90E8"),1)]),_:1},8,["class","icon"])]),_:1}),Vue.createVNode(h,null,{default:Vue.withCtx(()=>[Vue.createVNode(p,{class:Vue.normalizeClass(Vue.unref(d)),link:"",type:"primary",icon:Vue.unref(v)(Vue.unref(L)),onClick:y},{default:Vue.withCtx(()=>[Vue.createTextVNode(" \u91CD\u7F6E\u72B6\u6001 ")]),_:1},8,["class","icon"])]),_:1})]),_:1})]),default:Vue.withCtx(()=>[Vue.createVNode(o,{class:"w-[28px] cursor-pointer",width:"18px",icon:Vue.unref(D)},null,8,["icon"])]),_:1})]),Vue.createVNode(b),Vue.createVNode(I,{ref_key:"treeRef",ref:a,data:s.value,"node-key":"id",size:"small",props:C,"default-expand-all":"","expand-on-click-node":!1,"filter-node-method":g,onNodeClick:w},{default:Vue.withCtx(({node:u,data:f})=>{var _,m;return[Vue.createElementVNode("span",{class:Vue.normalizeClass(["pl-1","pr-1","rounded","flex","items-center","select-none",l.value.trim().length>0&&u.label.includes(l.value)&&"text-red-500",(_=n.value[u.id])!=null&&_.highlight?"dark:text-primary":""]),style:Vue.normalizeStyle({background:(m=n.value[u.id])!=null&&m.highlight?"var(--el-color-primary-light-7)":"transparent"})},[Vue.createVNode(o,{icon:f.type===1?Vue.unref(R):f.type===2?Vue.unref(j):Vue.unref(B)},null,8,["icon"]),Vue.createTextVNode(" "+Vue.toDisplayString(u.label),1)],6)]}),_:1},8,["data"])])}}});const ce=z(ee,[["__scopeId","data-v-628f3521"]]);export{ce as default};