import{aa as e,l as a,aD as t,am as l,a4 as s,$ as o,ac as n,A as i,a7 as r,z as c,x as u,af as p,q as d,a2 as m}from"./utils-lib.js?v=20260328163632";import{B as _}from"./index91.js?v=20260328163632";import{u as h}from"./store.js?v=20260328163632";import{u as b}from"./index92.js?v=20260328163632";import{h as k,i as v,j as f}from"./database.js?v=20260328163632";import{r as w,O as y,k as g,w as j,o as x,J as R,V,_ as E,a3 as A,Y as C,N as D}from"./base-lib.js?v=20260328163632";import{au as L}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const{pluginInfo:O,rowData:B}=h();w("all");const I=w(""),q=w([]),z=e=>e.db_path,P=w(!1),T=w({columns:[e(),{title:a("数据库名"),key:"db_name"},{title:a("备份"),key:"backup_count",width:130,render:e=>{var t,l;const s=(null==(t=null==e?void 0:e.backup_list)?void 0:t.length)>0;return y("span",{onClick:()=>(e=>{B.value=e,i({title:a("数据库备份详情【{0}】",[e.db_name]),area:700,component:()=>r((()=>import("./index112.js?v=20260328163632")),[],import.meta.url)})})(e),class:"".concat(s?"text-primary":"text-warning"," cursor-pointer")},[s?a("有备份({0})",[null==(l=null==e?void 0:e.backup_list)?void 0:l.length]):a("点击备份")])}},t({key:"db_path"}),{title:a("大小"),key:"size",render:e=>l(e.size)},s([{onClick:e=>{B.value=e,i({title:a("管理"),area:[1140,650],component:()=>r((()=>import("./index113.js?v=20260328163632")),[],import.meta.url)})},title:a("管理")},{onClick:async e=>{await c({title:a("删除数据库文件【{0}】",[null==e?void 0:e.db_name]),content:a("删除选中的数据库文件后，该数据库文件将不在列表中显示，是否继续操作？")}),await u({loading:a("正在删除数据库，请稍后..."),request:k({path:e.db_path}),message:!0,success:e=>{e.status&&M()}})},title:a("删除")}])],data:[]}),[K,S]=o(T),U=async(e,t,l,s,o)=>{const{label:n,value:i}=s,r=async e=>{const a=new Map([["backup",f],["delete",k]]),{db_path:t}=e,l=a.get(i);switch(i){case"backup":case"delete":if(l)return await l({path:t})}};await e({title:a("批量{0}",[n]),content:a("批量{0}已选数据库，是否继续操作？",[n]),column:[{title:a("数据库名"),key:"db_name"},p()],onConfirm:async()=>(await t(r),M(),o&&o(),!1)})},{BtBatch:H}=n({tableRef:S,checkedRowKeys:q,options:[{label:a("备份数据库"),value:"backup",event:U},{label:a("删除数据库"),value:"delete",event:U}]}),{BtOperation:J}=b({options:[{active:!0,label:a("添加数据库文件"),onClick:()=>{i({title:a("添加SQLite数据库"),area:480,btn:!0,component:()=>r((()=>import("./index111.js?v=20260328163632")),[],import.meta.url)})}}]}),M=()=>{u({loading:P,request:v({search:I.value}),data:Array,success:e=>{T.value.data=e||[]}})},N=()=>{Q(),M()},Q=()=>{B.value=null,I.value=""},Y=g({__name:"index",setup(e){const{isRefreshList:t}=h();return j((()=>t.value),(e=>{e&&(M(),t.value=!1)})),x(N),R(Q),(e,t)=>{const l=L;return V(),E(C(m),null,{"header-left":A((()=>[y(C(J),{class:"gap-10px"})])),"header-right":A((()=>[y(l,{class:"!gap-10px"},{default:A((()=>[y(C(d),{modelValue:C(I),"onUpdate:modelValue":t[0]||(t[0]=e=>D(I)?I.value=e:null),placeholder:C(a)("请输入数据库名称/备注"),class:"!w-[220px]",onSearch:t[1]||(t[1]=()=>C(M)())},null,8,["modelValue","placeholder"]),y(C(_),{onRefresh:C(M)},null,8,["onRefresh"])])),_:1})])),content:A((()=>[y(C(K),{"checked-row-keys":C(q),"onUpdate:checkedRowKeys":t[2]||(t[2]=e=>D(q)?q.value=e:null),"row-key":C(z),loading:C(P),"scroll-x":1e3},null,8,["checked-row-keys","row-key","loading"])])),"footer-left":A((()=>[y(C(H))])),"footer-right":A((()=>t[3]||(t[3]=[]))),_:1})}}});export{Y as default};
