← Back
Editing: index412.js
import{o as a,l as e,L as t,K as s,co as o,S as l,k as i,a0 as r,b as n}from"./utils-lib.js?v=1765440387";import{_ as p}from"./index93.js?v=1765440387";import{_ as u}from"./index102.js?v=1765440387";import{_ as c}from"./index113.js?v=1765440387";import{c as m,r as d,k as f,p as b,G as _,q as k,v as g,e as h,A as w,B as y,H as j,x as v,U as x,D as C}from"./base-lib.js?v=1765440387";import{c as R,a as D,h as H,g as q,u as A}from"./column.js?v=1765440387";import{p as L}from"./useController6.js?v=1765440387";import{de as S,df as T}from"./site.js?v=1765440387";import{u as U}from"./useStore3.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";import"./validator.js?v=1765440387";const B={class:"h-full"},E=m({__name:"index",props:{compData:{default:()=>[]}},setup(m){const E=m,{isRefreshList:O}=U(),z=n(),G=d(!1),I=d(),K=d([]),P=d(),V=[{label:"删除",value:"delete",event:async(a,e,t,s)=>{const o=async a=>await S({id:a.id});await a({title:"批量删除备份文件",content:"批量删除已选备份文件,是否继续操作?",column:[{prop:"filename",label:"文件名"},R()],onConfirm:async()=>(await e(o),await X(),O.value=!0,!1)})}}],{id:$,name:F}=E.compData,J=f({p:1,limit:10,search:$,type:0,table:"backup",total:0}),M=a=>{a.backup_status?z.error("备份中的文件不可下载"):window.open("/download?filename="+a.filename,"_self","noopener,noreferrer")},N=async(e,t=!1)=>{try{"boolean"!=typeof t&&(t=!1),t||await a({width:"40rem",title:"删除备份",content:'<p>删除选中站点备份文件后,<span class="text-danger">该站点备份文件将永久消失</span>,是否继续?</p>',icon:"warning-filled",isHtml:!0});const s=await S({id:e.id});return t||(z.request(s),O.value=!0),await X(),0===K.value.length&&(J.p=1,X()),s}catch(s){}},Q=a=>{e({isAsync:!0,title:"备份日志",area:64,compData:a,component:()=>t(()=>import("./backup-log.js?v=1765440387"),__vite__mapDeps([]),import.meta.url)})},W=async()=>{(await s({loading:"正在备份站点...",request:T({id:$,backstage:1}),message:!0})).status&&(X(),O.value=!0)},X=async(a=!1,e=!0)=>{e&&(G.value=!0),await s({request:o({p:J.p,limit:J.limit,search:$,type:J.type.toString(),table:"backup"}),data:{data:[Array,K],page:l(J)}}),e&&(G.value=!1),a&&z.success("刷新成功"),clearTimeout(P.value),K.value.some(a=>1===a.backup_status)&&(P.value=setTimeout(()=>{X(!1,!1)},3e3))},Y=x([D(),{label:"文件名称",prop:"name"},{label:"存储位置",width:100,render:a=>{if(-1!=a.filename.indexOf("|")){let e=a.filename.match(/\|(.+)\|/,"$1");return h("span",null,[L[e[1]]])}return h("span",null,[y("本地")])}},H({prop:"size"}),{width:160,prop:"addtime",label:"备份时间"},q({table:"backup"}),A([{isHide:a=>1===a.backup_status,onClick:M,title:"下载"},{isHide:a=>1===a.backup_status,render:a=>h("span",{class:"cursor-pointer text-".concat(a.backup_status?"danger":"primary"),onClick:()=>{a.backup_status?Q(a):N(a)}},[a.backup_status?"备份中":"删除",a.backup_status?h("span",{class:"omit"},null):""])}])]);return b(()=>{X()}),(a,e)=>{const t=C,s=c,o=i,l=r,n=u,m=p,d=_("bt-loading");return k(),g("div",B,[h(m,null,{"header-left":w(()=>[h(t,{type:"primary",onClick:W},{default:w(()=>[...e[3]||(e[3]=[y("备份站点",-1)])]),_:1})]),"header-right":w(()=>[h(s,{onRefresh:e[0]||(e[0]=()=>X(!0))})]),content:w(()=>[j(h(o,{ref_key:"routeBackupRef",ref:I,data:v(K),"max-height":408,column:v(Y)},null,8,["data","column"]),[[d,v(G)],[d,"正在加载中,请稍后...","title"]])]),"footer-left":w(()=>[h(l,{options:V,tableRef:v(I)},null,8,["tableRef"])]),"footer-right":w(()=>[h(n,{page:v(J).p,"onUpdate:page":e[1]||(e[1]=a=>v(J).p=a),row:v(J).limit,"onUpdate:row":e[2]||(e[2]=a=>v(J).limit=a),total:v(J).total,onChange:X},null,8,["page","row","total"])]),_:1})])}}});export{E as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel