import{_ as a}from"./index105.js?v=1761009159";import{V as t,x as e,P as s,l as r}from"./utils-lib.js?v=1761009159";import{c as o,r as i,aD as l,q as n,H as p,v as m,x as c,e as d,B as f,C as u,I as h,y,G as _}from"./base-lib.js?v=1761009159";import{backupSqlite as b,delSqliteBackup as g,getSqliteBackup as j}from"./database.js?v=1761009159";import{u as w}from"./column.js?v=1761009159";import{g as x}from"./useStore2.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const k={class:"p-[20px] h-full"},q=o({__name:"back-sqlite",props:{compData:{default:()=>({})}},setup(o){const{refreshTableList:q}=x(),C=o,D=i(!1),O=i([]),S=async()=>{try{await s({loading:"正在备份数据库，请稍后...",message:!0,request:b({data:JSON.stringify({path:C.compData.path})})}),J(),q()}catch(a){}},v=[{label:"名称",prop:"name",showOverflowTooltip:!0},{label:"时间",width:160,render:a=>l("span",t(a.mtime))},{label:"大小",render:a=>e(a.size)},w([{onClick:a=>{window.open("/download?filename="+a.filepath,"_blank","noopener,noreferrer")},title:"下载"},{onClick:async a=>{try{await s({loading:"正在删除数据库备份文件...",message:!0,request:g({data:JSON.stringify({file:a.filepath})})}),J(),q()}catch(t){}},title:"删除"}])],J=async()=>{await s({loading:D,request:j({data:JSON.stringify({path:C.compData.path})}),data:[Array,O]})};return n(()=>{J()}),(t,e)=>{const s=_,o=r,i=a,l=p("bt-loading");return m(),c("div",k,[d(i,null,{"header-left":f(()=>[d(s,{type:"primary",onClick:S},{default:f(()=>e[0]||(e[0]=[u("备份",-1)])),_:1,__:[0]})]),content:f(()=>[h(d(o,{ref:"routeBackup",data:y(O),"max-height":400,column:v},null,8,["data"]),[[l,y(D)],[l,"正在加载中，请稍后...","title"]])]),_:1})])}}});export{q as default};
