import{D as e,E as s,F as a}from"./database.js?v=20260328163632";import{l as t,am as i,Y as r,a4 as o,$ as n,a2 as l,z as c,x as m,bn as u}from"./utils-lib.js?v=20260328163632";import{u as p}from"./store4.js?v=20260328163632";import{B as d}from"./naive-ui.js?v=20260328163632";import{k as f,r as g,o as h,V as y,_,a3 as j,O as k,j as b,Z as v,Y as x}from"./base-lib.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const q=f({__name:"index",props:{compData:{default:()=>{}}},setup(f){const{isRefreshList:q}=p(),w=g(!1),z=g({columns:[{title:t("文件名称"),key:"file"},{title:t("文件大小"),key:"size",render:e=>i(e.size)},{title:t("备份时间"),key:"time",width:150,render:e=>r(e.time)},o([{title:t("恢复"),onClick:async({path:s,file:a})=>{await c({title:t("覆盖数据"),icon:"warning-filled",type:"input",input:{content:t("覆盖数据")},content:t("即将使用【{0}】对数据进行覆盖，是否继续?",[a])}),m({loading:t("正在恢复备份{0}，请稍后...",[a]),request:e({bak_file:s}),message:!0,success:()=>{q.value=!0}})}},{title:t("删除"),onClick:async({path:e,file:s})=>{await c({title:t("删除备份【{0}】",[s]),content:t("是否删除【{0}】备份?",[s])}),m({loading:t("正在备份数据库,请稍后..."),request:u({filename:e}),message:!0,success:A})}}])],data:[]}),[C,D]=n(z),Y=()=>{m({loading:t("正在备份，请稍后..."),request:s({sid:0}),message:!0,success:()=>{q.value=!0,A()}})},A=async()=>{m({loading:w,request:a(),data:Array,success:e=>{z.value.data=e||[]}})};return h(A),(e,s)=>{const a=d;return y(),_(x(l),{class:"p-20px"},{"header-left":j((()=>[k(a,{type:"primary",onClick:Y},{default:j((()=>[b(v(x(t)("备份")),1)])),_:1})])),"header-right":j((()=>s[0]||(s[0]=[]))),content:j((()=>[k(x(C),{"max-height":400})])),"footer-left":j((()=>s[1]||(s[1]=[]))),"footer-right":j((()=>s[2]||(s[2]=[]))),_:1})}}});export{q as default};
