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