2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
|
|
import{_ as U}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.js?v=1773287522785";import{_ as q}from"./index.vue_vue_type_script_setup_true_lang-HxsqzSKU.js?v=1773287522785";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{C as M,au as j,h,gt as N,aq as P,gu as w,gv as K,i as x,ap as O,p as V,aB as A,m as E}from"./index-BTglIPU2.js?v=1773287522785";import{u as I}from"./index-B5d4M70B.js?v=1773287522785";import{u as X}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as Z}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as G}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{_ as H}from"./logs.vue_vue_type_script_setup_true_lang-BJO8Ezld.js?v=1773287522785";import{B as J}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as Q,R as W,e as Y,N as ee,o as te,$ as ae,Z as oe,a0 as m,a9 as d,S as o,X as B,j as se,aa as ie}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./index-lEMZglLp.js?v=1773287522785";const ne={class:"p-20px"},ve=Q({__name:"index",props:{row:{}},setup(C){const{t:a}=W(),_=C,{row:r}=_,i=I(),D=async()=>{try{const e=i.type==="mysql";k("backup");const{message:t}=await A(i.type,{id:r.id},!e);u(),x(t)&&(p(),i.setRefresh(!0),e&&E.success(t.result))}catch(e){u()}},c=Y({p:1,limit:10,search:r.id}),{keys:n,table:s,columns:b}=Z([{type:"selection",width:40},{key:"filename",title:a("Component.UploadFile.index_3"),ellipsis:{tooltip:{width:"trigger"}}},{key:"type",title:a("Ftp.Table.index_3"),width:80},{key:"size",title:a("Site.TableRow.index_23"),width:90,render:e=>M(e.size)},{key:"addtime",title:a("Site.TableRow.index_25"),width:146},G({width:180,options:e=>[{label:a("Public.Btn.Click"),show:e.type!=="local disk",onClick:()=>{j({title:e.type,name:e.type,admin:!0})}},{label:a("Database.tools.index_3"),show:e.type==="local disk",onClick:()=>{h({title:a("Database.tools.index_17"),content:a("Database.tools.index_18"),onConfirm:async({hide:t})=>{try{k("import"),t(),await N(i.type,{file:e.filename,name:r.name},!1),u(),i.setRefresh(!0)}catch(g){u()}}})}},{label:a("Ftp.Label.index_11"),show:e.type==="local disk",onClick:()=>{P(e.filename,e.name)}},{label:a("Public.Btn.Del"),onClick:()=>{h({title:a("Site.Batch.index_18"),content:a("Database.tools.index_19"),onConfirm:async({hide:t})=>{await w({id:e.id}),p(),i.setRefresh(!0),t()}})}}]})]),R=[{key:"del",type:"confirm",label:a("Site.Batch.index_20"),confirm:{title:a("Site.Batch.index_21"),desc:a("Site.Batch.index_11"),columns:[b.value[1]],api:e=>w({id:e.id},!1),done:()=>{p()}}}],{loading:S,setLoading:y}=X(),p=async()=>{try{y(!0);const{message:e}=await K(ee(c));x(e)?(s.data=e.data.map(t=>({...t,filename:t.filename.includes("|")?"/"+t.filename.split("|").slice(1).join("|"):t.filename,type:t.filename.includes("|")?t.filename.split("|")[0]:"local disk"})),s.total=O(e.page)):(s.data=[],s.total=0),r.backup_count=s.total}finally{n.value=[],y(!1)}};let f=null;const k=e=>{i.type==="mysql"&&(f=V({data:{row:_.row,type:e},component:H}))},u=()=>{f&&f.hide()};return te(()=>{p()}),(e,t)=>{const g=J,v=F,L=q,$=z,T=U;return ae(),oe("div",ne,[m(T,null,{toolsLeft:d(()=>[m(g,{class:"backup-btn",type:"primary",onClick:D},{default:d(()=>[se(ie(e.$t("Database.index_16")),1)]),_:1})]),table:d(()=>[m(v,{"checked-row-keys":o(n),"onUpdate:checkedRowKeys":t[0]||(t[0]=l=>B(n)?n.value=l:null),loading:o(S),"loading-num":6,data:o(s).data,columns:o(b)},null,8,["checked-row-keys","loading","data","columns"])]),pageLeft:d(()=>[m(L,{"checked-row-keys":o(n),"onUpdate:checkedRowKeys":t[1]||(t[1]=l=>B(n)?n.value=l:null),data:o
|