import{c as a,bP as s,r as e,q as l,v as t,x as o,e as r,B as i,z as n,y as m,N as u,F as d,b0 as p,Q as c,ae as f,ab as b,a9 as v,U as y}from"./base-lib.js?v=1761009159";import{clearRedisDb as x}from"./database.js?v=1761009159";import{p as _,P as g}from"./utils-lib.js?v=1761009159";import{g as j}from"./useStore2.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const w={class:"p-20px"},k={class:"border border-light p-16px w-[22rem] max-h-[20rem] overflow-auto"},h={key:1,class:"text-tertiary-50 text-small"},D=a({__name:"index",props:{compData:{default:()=>({keyList:[],sid:0})}},setup(a,{expose:D}){const{refs:{isRefreshTable:N}}=j(),S=a,V=s(S.compData,"keyList"),q=s(S.compData,"sid"),J=e();return D({onConfirm:async a=>{await _({icon:"warning-filled",title:"提示",content:"此操作将清空选中的数据库, 是否继续?"});const s=JSON.stringify(V.value.filter(a=>J.value.includes(a.name)).map(a=>a.id));await g({loading:"正在清空，请稍后...",request:x({data:JSON.stringify({ids:s,sid:q.value})}),message:!0,success:a=>{a.status&&(N.value=!0)}}),a()}}),l(()=>{J.value=V.value.map(a=>a.name)}),(a,s)=>{const e=y,l=f,x=b,_=v;return t(),o("div",w,[r(_,null,{default:i(()=>[r(x,{label:"选择数据库"},{default:i(()=>[n("div",k,[m(V).length?(t(),u(l,{key:0,modelValue:m(J),"onUpdate:modelValue":s[0]||(s[0]=a=>c(J)?J.value=a:null)},{default:i(()=>[(t(!0),o(d,null,p(m(V),(a,s)=>(t(),u(e,{class:"w-full !mr-0",label:a.name,key:s},null,8,["label"]))),128))]),_:1},8,["modelValue"])):(t(),o("span",h,"暂无数据"))])]),_:1})]),_:1})])}}});export{D as default};
