import{_ as e}from"./index.vue_vue_type_script_setup_true_lang2.js?v=20260328163632";import{B as a}from"./index97.js?v=20260328163632";import{aa as s,l as t,ao as o,av as l,a4 as r,$ as n,ac as i,A as u,a7 as p,a3 as c,x as d,a0 as m,q as v,a1 as _,a2 as h}from"./utils-lib.js?v=20260328163632";import{B as f}from"./index91.js?v=20260328163632";import{u as g}from"./store.js?v=20260328163632";import{a as x,b as k,c as y,f as j,g as b,h as w,i as C,s as R,l as S,o as O,k as U,t as q}from"./useMethod2.js?v=20260328163632";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang3.js?v=20260328163632";import{u as B}from"./index92.js?v=20260328163632";import{r as K,c as V,O as D,k as E,w as P,o as A,J as F,V as H,W as I,Y as L,_ as J,a3 as M,a1 as N,F as T,N as W,K as X,X as Y,Z}from"./base-lib.js?v=20260328163632";import{n as $,au as G}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index85.js?v=20260328163632";import"./database.js?v=20260328163632";import"./service.vue_vue_type_style_index_0_scoped_073b5b46_lang.js?v=20260328163632";const{pluginInfo:Q,rowData:ee,isHaveServer:ae}=g(),se=K(""),te=K(""),oe=K([]),le=e=>e.id,re=K(""),ne=V((()=>{var e;return-1===(null==(e=Q.value)?void 0:e.status_code)&&!ae.value})),ie=K({columns:[s(),{title:t("数据库名"),key:"name"},{title:t("用户名"),key:"username",...o()},l({width:160,event:j}),x({event:(e,a)=>{C(e,a)}}),k(),y(),r([{onClick:j,title:t("改密")},{onClick:b,title:t("删除")}])],data:[]}),ue=K({page:1,pageSize:20,itemCount:0,pageSlot:5}),[pe,ce]=n(ie),[de]=c(ue),{BtBatch:me}=i({tableRef:ce,checkedRowKeys:oe,options:[...w()]}),ve=V((()=>[{active:!0,label:t("添加数据库"),onClick:()=>{u({title:t("添加PgSql数据库"),area:560,showFooter:!0,component:()=>p((()=>import("./index99.js?v=20260328163632")),[],import.meta.url)})}},{label:t("管理员密码"),hide:!R.value.some((e=>0===e.id)),onClick:()=>S({},t("管理员密码"))},{label:t("远程服务器"),onClick:O},{type:"custom",render:()=>D(z,{compData:R.value},null)}])),{BtOperation:_e}=B({options:ve}),he=e=>{ie.value.columns.forEach((a=>{void 0!==a.sortOrder&&(e&&a.key===e.columnKey?a.sortOrder=e.order:a.sortOrder=!1)}));const{order:a,columnKey:s}=e;re.value=a?"".concat(s," ").concat("descend"===a?"desc":"asc"):"",ge()},fe=()=>{ue.value.page=1,ge()},ge=()=>{let e={table:"databases",search_type:"pgsql",search:te.value,p:ue.value.page,limit:ue.value.pageSize,order:re.value};""!==se.value&&(e.type=se.value),d({request:m(e),success:e=>{ie.value.data=e.data.data||[],ue.value.itemCount=e.data.page.total}})},xe=()=>{ke(),U(),ge()},ke=()=>{ee.value=null,te.value="",Object.assign(ue.value,{page:1,itemCount:0})},ye={class:"text-14px text-[var(--text-color-2)]"},je=E({__name:"index",setup(s){const{isRefreshList:o}=g();return P((()=>o.value),(e=>{e&&(ge(),o.value=!1)})),A(xe),F(ke),(s,o)=>{const l=$,r=G;return H(),I(T,null,[L(ne)?(H(),J(a,{key:0},{content:M((()=>[D(e,{type:"PgSql"})])),_:1})):N("",!0),D(L(h),null,{"header-left":M((()=>[D(L(_e),{class:"gap-10px"})])),"header-right":M((()=>[D(r,{class:"!gap-10px"},{default:M((()=>[D(l,{value:L(se),"onUpdate:value":[o[0]||(o[0]=e=>W(se)?se.value=e:null),L(fe)],options:L(q),class:X([{"select-active":""!==L(se)},"!w-140px"]),"consistent-menu-width":!1},null,8,["value","options","class","onUpdate:value"]),D(L(v),{modelValue:L(te),"onUpdate:modelValue":o[1]||(o[1]=e=>W(te)?te.value=e:null),placeholder:L(t)("请输入数据库名称/备注"),class:"!w-[220px]",onSearch:L(fe)},null,8,["modelValue","placeholder","onSearch"]),D(L(f),{onRefresh:L(ge)},null,8,["onRefresh"])])),_:1})])),content:M((()=>[D(L(pe),{"checked-row-keys":L(oe),"onUpdate:checkedRowKeys":o[2]||(o[2]=e=>W(oe)?oe.value=e:null),"row-key":L(le),"scroll-x":1e3,"onUpdate:sorter":L(he)},null,8,["checked-row-keys","row-key","onUpdate:sorter"])])),"footer-left":M((()=>[D(L(me))])),"footer-right":M((()=>[D(L(de),{"show-size-picker":"","page-sizes":L(_)([10,20,50,100]),onRefresh:L(ge)},{suffix:M((()=>[Y("span",ye,Z(L(t)("共 {0} 条",[L(ue).itemCount])),1)])),_:1},8,["page-sizes","onRefresh"])])),_:1})],64)}}});export{je as default};
