import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{bi as a,gq as s}from"./page_layout.js?v=1753954525509";import{_ as l}from"./index124.js?v=1753954525509";import{k as t,P as r,r as i,e as p,U as o,V as u,Q as n,a2 as d,X as _,a1 as m,al as v}from"./vue.js?v=1753954525509";import{cA as b,aq as x,cG as c,bY as f}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./public.js?v=1753954525509";import"./index.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1753954525509";const g={class:"p-16px"},h=t({__name:"index",props:{data:{}},setup(t,{expose:h}){const{t:w}=r(),j=t,{getList:y}=j.data,D=i(null),q=p({sid:0,username:"",password:a(10),host:"127.0.0.1",ip:""}),$={username:{required:!0,message:w("Config.Panel.index_60"),trigger:["blur","input"]},password:{required:!0,message:w("Config.Panel.index_67"),trigger:["blur","input"]},ip:{trigger:["blur","input"],validator:()=>"ip"!==q.host||""!==q.ip||new Error(w("Database.Mysql.index_6"))}},U=i([{label:w("Database.form.index_13"),value:"%"},{label:w("Database.form.index_12"),value:"127.0.0.1"},{label:w("Database.form.index_14"),value:"ip"}]);return h({onConfirm:async()=>{var e;await(null==(e=D.value)?void 0:e.validate()),await s({sid:q.sid,username:q.username,password:q.password,host:"ip"===q.host?q.ip:q.host,db_name:"*",tb_name:"*"}),null==y||y()}}),(a,s)=>{const t=b,r=x,i=c,p=f,h=e;return o(),u("div",g,[n(h,{ref_key:"formRef",ref:D,model:_(q),rules:$},{default:d((()=>[n(t,{label:a.$t("Database.Mysql.index_5"),path:"server"},{default:d((()=>[n(l,{class:"w-200px",value:_(q).sid,"onUpdate:value":s[0]||(s[0]=e=>_(q).sid=e)},null,8,["value"])])),_:1},8,["label"]),n(t,{label:a.$t("Database.index_13"),path:"username"},{default:d((()=>[n(r,{class:"w-350px!",value:_(q).username,"onUpdate:value":s[1]||(s[1]=e=>_(q).username=e),placeholder:a.$t("Config.Panel.index_60")},null,8,["value","placeholder"])])),_:1},8,["label"]),n(t,{label:a.$t("Database.index_14"),path:"password"},{default:d((()=>[n(r,{class:"w-350px!",value:_(q).password,"onUpdate:value":s[2]||(s[2]=e=>_(q).password=e),placeholder:a.$t("Config.Panel.index_67")},null,8,["value","placeholder"])])),_:1},8,["label"]),n(p,null,{default:d((()=>[n(t,{label:a.$t("Database.Mysql.index_4")},{default:d((()=>[n(i,{class:"w-200px",value:_(q).host,"onUpdate:value":s[3]||(s[3]=e=>_(q).host=e),options:_(U)},null,8,["value","options"])])),_:1},8,["label"]),n(t,{"show-label":!1,path:"ip"},{default:d((()=>["ip"===_(q).host?(o(),m(r,{key:0,class:"w-150px!",value:_(q).ip,"onUpdate:value":s[4]||(s[4]=e=>_(q).ip=e),placeholder:a.$t("Database.Mysql.index_6")},null,8,["value","placeholder"])):v("",!0)])),_:1})])),_:1})])),_:1},8,["model"])])}}});export{h as default};
