import{u as y,k as I,l as O,o as N,n as D,I as M}from"./element-plus-DckSU5ni.js";import{x as R,c as b,y as v,E as f,I as k,O as n,F as o,C as U,u as w,j as F,K as T,M as $,a4 as z,z as r}from"./vue-vendor-vBC20LeU.js";import{_ as A}from"./index-D7dBOFlH.js";const K={class:"flex-1 flex justify-end items-center"},L=R({__name:"index",props:{showSearch:{type:Boolean,default:!0},columns:{default:()=>({})},search:{type:Boolean,default:!0}},emits:["update:showSearch","update:columns","refresh"],setup(c,{emit:C}){const l=c,d=C,u=b({get:()=>l.columns?Object.values(l.columns).every(s=>s.visible!==!1):!1,set:()=>{}}),V=b(()=>l.columns?Object.values(l.columns).some(e=>e.visible!==!1)&&!u.value:!1),g=()=>{d("update:showSearch",!l.showSearch)},x=()=>{d("refresh")},E=(s,e)=>{const t={...l.columns};t[e]&&(t[e].visible=s,d("update:columns",t))},B=()=>{if(!l.columns)return;const s={...l.columns},e=!u.value;Object.values(s).forEach(t=>{t.visible=e}),d("update:columns",s)};return(s,e)=>{const t=I,i=y,p=M,_=D,S=N,j=O;return r(),v("div",K,[c.search?(r(),f(i,{key:0,effect:"dark",content:c.showSearch?"隐藏搜索":"显示搜索",placement:"top"},{default:o(()=>[n(t,{circle:"",icon:"Search",onClick:e[0]||(e[0]=a=>g())})]),_:1},8,["content"])):k("",!0),n(i,{effect:"dark",content:"刷新",placement:"top"},{default:o(()=>[n(t,{circle:"",icon:"Refresh",onClick:e[1]||(e[1]=a=>x())})]),_:1}),Object.keys(c.columns).length>0?(r(),f(i,{key:1,effect:"dark",content:"列设置",placement:"top"},{default:o(()=>[n(j,{class:"ml-3",trigger:"click",placement:"bottom-end","hide-on-click":!1},{dropdown:o(()=>[n(S,null,{default:o(()=>[n(_,null,{default:o(()=>[n(p,{indeterminate:w(V),modelValue:w(u),"onUpdate:modelValue":e[2]||(e[2]=a=>F(u)?u.value=a:null),onChange:B},{default:o(()=>[...e[3]||(e[3]=[T(" 全部 ",-1)])]),_:1},8,["indeterminate","modelValue"])]),_:1}),e[4]||(e[4]=U("div",{class:"dropdown-menu-line"},null,-1)),(r(!0),v($,null,z(c.columns,(a,h)=>(r(),f(_,{key:h},{default:o(()=>[n(p,{modelValue:a.visible,"onUpdate:modelValue":m=>a.visible=m,onChange:m=>E(m,h),label:a.label},null,8,["modelValue","onUpdate:modelValue","onChange","label"])]),_:2},1024))),128))]),_:1})]),default:o(()=>[n(t,{circle:"",icon:"Menu"})]),_:1})]),_:1})):k("",!0)])}}}),J=A(L,[["__scopeId","data-v-d9e9d61f"]]);export{J as _};
