import{d as C,b3 as a,b as S,o as i,c as x,O as T,e as B,m as o,p as n,a0 as f,A as R,aJ as $,$ as d,q as p,dG as q,r as N,T as V,G}from"./index-XuO881sr.js";import{E as M}from"./el-row-eghH2z0a.js";import{E as O}from"./el-tree-CVxcisGT.js";import"./el-checkbox-Cxc7yQYm.js";const z={class:"show-btn"},A=C({__name:"index",props:{showSearch:a.bool.def(!0),columns:a.fieldOption,search:a.bool.def(!0),gutter:a.number.def(10)},emits:["update:showSearch","queryTable"],setup(c,{emit:h}){const s=c,u=N(),m=h,_=V(()=>{const t={};return s.gutter&&(t.marginRight=`${s.gutter/2}px`),t});function k(){m("update:showSearch",!s.showSearch)}function b(){m("queryTable")}function y(...t){s.columns?.forEach(e=>{e.visible=t[1].checkedKeys.includes(e.key)})}return S(()=>{s.columns?.forEach(t=>{t.visible&&u.value?.setChecked(t.key,!0,!1)})}),(t,e)=>{const r=R,l=$,g=O,v=q,w=M;return i(),x("div",{class:"top-right-btn",style:T(B(_))},[o(w,null,{default:n(()=>[c.search?(i(),f(l,{key:0,class:"item",effect:"dark",content:c.showSearch?"隐藏搜索":"显示搜索",placement:"top"},{default:n(()=>[o(r,{circle:"",icon:"Search",onClick:e[0]||(e[0]=E=>k())})]),_:1},8,["content"])):d("",!0),o(l,{class:"item",effect:"dark",content:"刷新",placement:"top"},{default:n(()=>[o(r,{circle:"",icon:"Refresh",onClick:e[1]||(e[1]=E=>b())})]),_:1}),c.columns?(i(),f(l,{key:1,class:"item",effect:"dark",content:"显示/隐藏列",placement:"top"},{default:n(()=>[p("div",z,[o(v,{placement:"bottom",trigger:"click"},{reference:n(()=>[o(r,{circle:"",icon:"Menu"})]),default:n(()=>[e[2]||(e[2]=p("div",{class:"tree-header"},"显示/隐藏列",-1)),o(g,{ref_key:"columnRef",ref:u,data:c.columns,"show-checkbox":"","node-key":"key",props:{label:"label",children:"children"},onCheck:y},null,8,["data"])]),_:1})])]),_:1})):d("",!0)]),_:1})],4)}}}),j=G(A,[["__scopeId","data-v-0f5b8a89"]]);export{j as _};
