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 l,av as o,a4 as n,$ as i,ac as r,a3 as u,x as p,a0 as c,q as v,a1 as m,a2 as d}from"./utils-lib.js?v=20260328163632";import{B as _}from"./index91.js?v=20260328163632";import{u as f}from"./store.js?v=20260328163632";import{a as h,b as g,c as k,f as x,g as b,i as j,j as y,l as w,o as C,k as R,t as S}from"./useMethod2.js?v=20260328163632";import{u as z}from"./index92.js?v=20260328163632";import{r as B,c as U,k as V,w as K,o as O,J as q,V as H,W as D,Y as F,_ as I,a3 as J,a1 as L,O as M,F as N,N as W,K as X,X as Y,Z}from"./base-lib.js?v=20260328163632";import{n as $,au as A}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:E,rowData:G,isHaveServer:P}=f(),Q=B(""),T=B(""),ee=B([]),ae=e=>e.id;B("");const se=U((()=>!P.value)),te=B({columns:[s(),{title:t("数据库名"),key:"name"},{title:t("用户名"),key:"username",...l()},o({width:160,event:x}),h({event:(e,a)=>{j(e,a)}}),g(),k(),n([{onClick:x,title:t("改密")},{onClick:b,title:t("删除")}])],data:[]}),le=B({page:1,pageSize:20,itemCount:0,pageSlot:5}),[oe,ne]=i(te),[ie]=u(le),{BtBatch:re}=r({tableRef:ne,checkedRowKeys:ee,options:[{label:t("删除数据库"),value:"delete",event:async(e,a,s,t,l)=>b(s.value,l)}]}),ue=U((()=>[{active:!0,label:t("添加数据库"),onClick:()=>y()},{label:t("root密码"),onClick:()=>w()},{label:t("远程服务器"),onClick:C}])),{BtOperation:pe}=z({options:ue}),ce=()=>{le.value.page=1,ve()},ve=()=>{let e={table:"databases",search_type:"gbase8s",search:T.value,p:le.value.page,limit:le.value.pageSize};""!==Q.value&&(e.type=Q.value),p({request:c(e),success:e=>{te.value.data=e.data.data||[],le.value.itemCount=e.data.page.total}})},me=()=>{R(),de(),ve()},de=()=>{G.value=null,T.value="",Object.assign(le.value,{page:1,itemCount:0})},_e={class:"text-14px text-[var(--text-color-2)]"},fe=V({__name:"index",setup(s){const{isRefreshList:l}=f();return K((()=>l.value),(e=>{e&&(ve(),l.value=!1)})),O(me),q(de),(s,l)=>{const o=$,n=A;return H(),D(N,null,[F(se)?(H(),I(a,{key:0},{content:J((()=>[M(e,{type:"gbase8s"})])),_:1})):L("",!0),M(F(d),null,{"header-left":J((()=>[M(F(pe),{class:"gap-10px"})])),"header-right":J((()=>[M(n,{class:"!gap-10px"},{default:J((()=>[M(o,{value:F(Q),"onUpdate:value":[l[0]||(l[0]=e=>W(Q)?Q.value=e:null),F(ce)],options:F(S),class:X([{"select-active":""!==F(Q)},"!w-140px"]),"consistent-menu-width":!1},null,8,["value","options","class","onUpdate:value"]),M(F(v),{modelValue:F(T),"onUpdate:modelValue":l[1]||(l[1]=e=>W(T)?T.value=e:null),placeholder:F(t)("请输入数据库名称/备注"),class:"!w-[220px]",onSearch:F(ce)},null,8,["modelValue","placeholder","onSearch"]),M(F(_),{onRefresh:F(ve)},null,8,["onRefresh"])])),_:1})])),content:J((()=>[M(F(oe),{"checked-row-keys":F(ee),"onUpdate:checkedRowKeys":l[2]||(l[2]=e=>W(ee)?ee.value=e:null),"row-key":F(ae),"scroll-x":1e3},null,8,["checked-row-keys","row-key"])])),"footer-left":J((()=>[M(F(re))])),"footer-right":J((()=>[M(F(ie),{"show-size-picker":"","page-sizes":F(m)([10,20,50,100]),onRefresh:F(ve)},{suffix:J((()=>[Y("span",_e,Z(F(t)("共 {0} 条",[F(le).itemCount])),1)])),_:1},8,["page-sizes","onRefresh"])])),_:1})],64)}}});export{fe as default};
