import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{by as a,hx as s}from"./page_layout.js?v=1763625242172";import{_ as l}from"./index129.js?v=1763625242172";import{k as t,P as r,r as p,e as i,R as u,S as n,X as o,a3 as d,V as _,a2 as m,an as v}from"./vue.js?v=1763625242172";import{dP as x,au as b,dV as f,d9 as c}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./public.js?v=1763625242172";import"./index.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang8.js?v=1763625242172";const h={class:"p-16px"},g=t({__name:"index",props:{data:{}},setup(t,{expose:g}){const{t:w}=r(),j=t,{getList:y}=j.data,D=p(null),$=i({sid:0,username:"",password:a(10),host:"127.0.0.1",ip:""}),q={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"!==$.host||""!==$.ip||new Error(w("Database.Mysql.index_6"))}},P=p([{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 g({onConfirm:async()=>{var e;await(null==(e=D.value)?void 0:e.validate()),await s({sid:$.sid,username:$.username,password:$.password,host:"ip"===$.host?$.ip:$.host,db_name:"*",tb_name:"*"}),null==y||y()}}),(a,s)=>{const t=x,r=b,p=f,i=c,g=e;return u(),n("div",h,[o(g,{ref_key:"formRef",ref:D,model:_($),rules:q},{default:d((()=>[o(t,{label:a.$t("Database.Mysql.index_5"),path:"server"},{default:d((()=>[o(l,{class:"w-200px",value:_($).sid,"onUpdate:value":s[0]||(s[0]=e=>_($).sid=e)},null,8,["value"])])),_:1},8,["label"]),o(t,{label:a.$t("Database.index_13"),path:"username"},{default:d((()=>[o(r,{class:"w-350px!",value:_($).username,"onUpdate:value":s[1]||(s[1]=e=>_($).username=e),placeholder:a.$t("Config.Panel.index_60")},null,8,["value","placeholder"])])),_:1},8,["label"]),o(t,{label:a.$t("Database.index_14"),path:"password"},{default:d((()=>[o(r,{class:"w-350px!",value:_($).password,"onUpdate:value":s[2]||(s[2]=e=>_($).password=e),placeholder:a.$t("Config.Panel.index_67")},null,8,["value","placeholder"])])),_:1},8,["label"]),o(i,null,{default:d((()=>[o(t,{label:a.$t("Database.Mysql.index_4")},{default:d((()=>[o(p,{class:"w-200px",value:_($).host,"onUpdate:value":s[3]||(s[3]=e=>_($).host=e),options:_(P)},null,8,["value","options"])])),_:1},8,["label"]),o(t,{"show-label":!1,path:"ip"},{default:d((()=>["ip"===_($).host?(u(),m(r,{key:0,class:"w-150px!",value:_($).ip,"onUpdate:value":s[4]||(s[4]=e=>_($).ip=e),placeholder:a.$t("Database.Mysql.index_6")},null,8,["value","placeholder"])):v("",!0)])),_:1})])),_:1})])),_:1},8,["model"])])}}});export{g as default};
