import{K as S,a0 as z,z as F,B as J,C as L}from"./index.17037962789732.js";import"./index.170379627897332.js";import"./index.170379627897315.js";import"./index.170379627897336.js";import{_ as M}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import{d as N,k,r as O,o as c,x as h,u as a,c as _,a as n,b as s,y as x,t as u,A as g,F as V,h as E}from"./vue.1703796278973.js";const H=N({__name:"index",props:{actions:{type:Array,default:()=>[]},isCheck:{type:Boolean,default:!1}},emits:["update:isCheck","change"],setup(f,{emit:p}){const v=f,i=k(!1),t=k({}),P=l=>{const e=v.actions.find(r=>r.key===l.key);e!=null&&e.popConfirm||e!=null&&e.onClick?i.value=!1:(p("update:isCheck",!0),p("change",!0),i.value=!0),t.value=e||{}},B=()=>{t.value={},p("update:isCheck",!1),p("change",!1)},j=(l,e)=>{e&&(e(l),m())},m=()=>{i.value=!1};return(l,e)=>{const r=O("AIcon"),d=M,y=S,w=z,A=F,b=J,D=L;return c(),h("div",null,[a(t).key&&a(i)?(c(),_(w,{key:0},{default:n(()=>[s(d,x({type:"primary",ghost:!0,hasPermission:a(t).permission?a(t).permission:!0},{...a(t),...a(t).selected}),{icon:n(()=>[s(r,{type:a(t).icon},null,8,["type"])]),default:n(()=>[u(" "+g(a(t).text),1)]),_:1},16,["hasPermission"]),s(y,{type:"link",onClick:B},{default:n(()=>[s(r,{type:"RedoOutlined"}),u("重选")]),_:1})]),_:1})):(c(),_(D,{key:1,overlayStyle:{zIndex:1e3}},{overlay:n(()=>[s(b,{onClick:P},{default:n(()=>[(c(!0),h(V,null,E(f.actions,o=>(c(),_(A,{key:o.key},{default:n(()=>[s(d,x({hasPermission:o.permission?o.permission:!0},o,{popConfirm:o.popConfirm?{...o.popConfirm,onCancel:m,onConfirm:I=>{var C;return j(I,(C=o==null?void 0:o.popConfirm)==null?void 0:C.onConfirm)}}:void 0}),{icon:n(()=>[s(r,{type:o.icon},null,8,["type"])]),default:n(()=>[u(" "+g(o.text),1)]),_:2},1040,["hasPermission","popConfirm"])]),_:2},1024))),128))]),_:1})]),default:n(()=>[s(y,null,{default:n(()=>[u("批量操作 "),s(r,{type:"DownOutlined"})]),_:1})]),_:1}))])}}});export{H as _};
