index-ky_xZYvq.js 3.4 KB

1
  1. import{d as T,a2 as v,a as C,r as I,av as L,o as w,K as l,aq as N,e as i,f as R,j as o,L as n,u as t,t as k,i as p,y as h,am as y}from"./vue-A59npLRR.js";import{c as A,b as D,_ as H,r as S}from"./restore.vue_vue_type_script_setup_true_lang-qYPLZOx-.js";import{b as z,T as E}from"./baTable-MdxYOkAk.js";import{T as V}from"./index-K8IR974I.js";import{a1 as $,_ as j}from"./index-EwE51S_X.js";import"./index-XALue448.js";import"./echarts-cxb9vJr1.js";const q={class:"default-main ba-table-box"},K={class:"mlr-12"},M={class:"table-header-operate-text"},O={class:"table-header-operate-text"},U=T({__name:"index",setup(F){const{t:a}=v(),b=C(),r=I({pagination:!1,backupsLoading:!1});let c=[{render:"confirmButton",name:"backups",title:"security.databaseBackup.Button backups",text:"",type:"primary",icon:"el-icon-Coin",class:"table-row-info",disabledTip:!1,popconfirm:{title:a("security.databaseBackup.Are you sure to back up the selected tabales")},click:s=>{u([s[e.table.pk]])}}];c=c.concat();const e=new z(new $(A),{column:[{type:"selection",align:"center",operator:!1},{label:a("security.databaseBackup.Table table name"),prop:"tableName",operator:!1},{label:a("security.databaseBackup.Table line number"),prop:"lineNumber",operator:!1},{label:a("security.databaseBackup.Table size"),prop:"size",operator:!1},{label:a("security.databaseBackup.Table bredundancy"),prop:"bredundancy",operator:!1},{label:a("security.databaseBackup.Table comment"),prop:"comment",operator:!1},{label:a("Operate"),align:"center",width:120,render:"buttons",buttons:c,operator:!1}],dblClickNotEditColumn:[void 0,"status"]},{defaultItems:{status:"1"}});L("baTable",e),w(()=>{e.table.ref=b.value,e.table.pk="tableName",e.mount(),e.getIndex()});const u=s=>{if(r.backupsLoading)return!1;r.backupsLoading=!0,e.table.ref.getRef().clearSelection(),D(s).then(()=>{r.backupsLoading=!1})},B=()=>{u(e.getSelectionIds())},g=()=>{e.form.extend.restore=[],e.form.operate="restore",e.form.loading=!0,S().then(s=>{e.form.extend.restore=s.data.list,e.form.loading=!1})};return(s,G)=>{const d=l("Icon"),f=l("el-button"),m=l("el-tooltip"),x=l("el-popconfirm"),_=N("blur");return i(),R("div",q,[o(V,{buttons:["refresh"]},{default:n(()=>[o(x,{onConfirm:B,"confirm-button-text":t(a)("security.databaseBackup.Button backups"),"cancel-button-text":t(a)("Cancel"),title:t(a)("security.databaseBackup.Are you sure to back up the selected tabales"),disabled:!(t(e).table.selection.length>0)},{reference:n(()=>[p("div",K,[o(m,{content:t(a)("security.databaseBackup.TableHeader backups the database"),placement:"top"},{default:n(()=>[y((i(),h(f,{disabled:!(t(e).table.selection.length>0),class:"table-header-operate",type:"primary",loading:r.backupsLoading},{default:n(()=>[o(d,{color:"#ffffff",name:"el-icon-Coin"}),p("span",M,k(t(a)("security.databaseBackup.Button backups")),1)]),_:1},8,["disabled","loading"])),[[_]])]),_:1},8,["content"])])]),_:1},8,["confirm-button-text","cancel-button-text","title","disabled"]),o(m,{content:t(a)("security.databaseBackup.TableHeader restoring the database"),placement:"top"},{default:n(()=>[y((i(),h(f,{class:"table-header-operate",type:"success",onClick:g},{default:n(()=>[o(d,{color:"#ffffff",name:"el-icon-RefreshRight"}),p("span",O,k(t(a)("security.databaseBackup.Button restore")),1)]),_:1})),[[_]])]),_:1},8,["content"])]),_:1}),o(E,{pagination:r.pagination,height:"calc(100vh - 175px)",ref_key:"tableRef",ref:b},null,8,["pagination"]),o(H)])}}}),ee=j(U,[["__scopeId","data-v-d622e7bc"]]);export{ee as default};