System.register(["./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BSBh0Le2.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./index-legacy-y1mYB81o.js?v=1773287522785","./index-legacy-CDUlQ1jh.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./index-legacy-DGWsVoxN.js?v=1773287522785","./index-legacy-DWPn48Vb.js?v=1773287522785"],(function(e,a){"use strict";var l,s,t,d,r,n,u,i,o,p,c,b,_,m,v,f,x,g,h,w,y,D,$,j,k,U;return{setters:[e=>{l=e._},e=>{s=e._,t=e.g4,d=e.m},e=>{r=e._},e=>{n=e.k,u=e.R,i=e.a6,o=e.r,p=e.e,c=e.c,b=e.$,_=e.a8,m=e.a9,v=e.a0,f=e._,x=e.S,g=e.ak,h=e.j,w=e.aa,y=e.N},e=>{D=e.u},e=>{$=e.g},e=>{j=e.a1,k=e.b,U=e.a6,e.a8},null,null,null],execute:function(){const a={class:"w-240px"},A={class:"w-100px ml-8px"},R={class:"w-240px"},q={class:"w-240px"},S={class:"w-240px"},C={class:"w-240px"},E={class:"w-240px"},L={class:"ml-8px"};e("default",n({__name:"index",setup(e,{expose:n}){const{t:z}=u(),M=D(),{remoteList:N}=i(M),Q=o(null),Z=p({sid:N.value.length>0?N.value[0].id:null,name:"",codeing:"utf8mb4",db_user:"",password:"",dataAccess:"127.0.0.1",address:"127.0.0.1",active:!1,ssl:""}),B=o([{label:"utf-8",value:"utf8"},{label:"utf8mb4",value:"utf8mb4"},{label:"gbk",value:"gbk"},{label:"big5",value:"big5"}]),F=o([{label:z("Database.form.index_12"),value:"127.0.0.1"},{label:z("Database.form.index_13"),value:"%"},{label:z("Database.form.index_14"),value:"ip"}]),G=c((()=>N.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),H={name:{required:!0,message:z("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:z("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:z("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(z("Database.form.index_18"))}},I=e=>{Z.db_user=e},J=e=>{Z.address="ip"===e?"":e},K=()=>{$()};return n({onConfirm:async()=>{await(Q.value?.validate());try{const e=(()=>{const e=y(Z),{sid:a}=e;if(null===a)throw d.error(z("Database.form.index_18")),new Error(z("Database.form.index_18"));return{...e,sid:a,ps:e.name,dtype:"MySQL",address:"ip"===Z.dataAccess?Z.address.trim().split("\n").join(","):Z.address}})();await t(e),M.setRefresh(!0)}catch(e){console.warn(e)}}}),(e,t)=>{const d=k,n=U,u=j,i=r,o=s,p=l;return b(),_(p,{ref_key:"formRef",ref:Q,model:x(Z),rules:H,class:"p-20px"},{default:m((()=>[v(u,{label:e.$t("Database.form.index_1"),path:"name"},{default:m((()=>[f("div",a,[v(d,{value:x(Z).name,"onUpdate:value":[t[0]||(t[0]=e=>x(Z).name=e),I],placeholder:e.$t("Database.form.index_2"),"input-props":{name:"name"}},null,8,["value","placeholder"])]),f("div",A,[v(n,{value:x(Z).codeing,"onUpdate:value":t[1]||(t[1]=e=>x(Z).codeing=e),class:"code-select",options:x(B)},null,8,["value","options"])])])),_:1},8,["label"]),v(u,{label:e.$t("Database.form.index_3"),path:"db_user"},{default:m((()=>[f("div",R,[v(d,{value:x(Z).db_user,"onUpdate:value":t[2]||(t[2]=e=>x(Z).db_user=e),placeholder:e.$t("Database.form.index_4"),"input-props":{name:"username"}},null,8,["value","placeholder"])])])),_:1},8,["label"]),v(u,{label:e.$t("Database.form.index_5"),path:"password"},{default:m((()=>[f("div",q,[v(i,{value:x(Z).password,"onUpdate:value":t[3]||(t[3]=e=>x(Z).password=e),placeholder:"","input-props":{name:"password"}},null,8,["value"])])])),_:1},8,["label"]),v(u,{label:e.$t("Database.form.index_6"),path:"dataAccess"},{default:m((()=>[f("div",S,[v(n,{value:x(Z).dataAccess,"onUpdate:value":[t[4]||(t[4]=e=>x(Z).dataAccess=e),J],class:"access-select",options:x(F)},null,8,["value","options"])])])),_:1},8,["label"]),"ip"===x(Z).dataAccess?(b(),_(u,{key:0,label:e.$t("Database.form.index_7"),path:"address"},{default:m((()=>[f("div",C,[v(d,{value:x(Z).address,"onUpdate:value":t[5]||(t[5]=e=>x(Z).address=e),type:"textarea",autosize:{minRows:3,maxRows:3},"input-props":{name:"address"},placeholder:e.$t("Database.form.index_8")},null,8,["value","placeholder"])])])),_:1},8,["label"])):g("",!0),v(u,{label:e.$t("Database.form.index_9"),path:"sid"},{default:m((()=>[f("div",E,[v(n,{value:x(Z).sid,"onUpdate:value":t[6]||(t[6]=e=>x(Z).sid=e),class:"sid-select",options:x(G)},null,8,["value","options"])]),f("div",L,[v(o,{onClick:K},{default:m((()=>[h(w(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"]),g("",!0)])),_:1},8,["model"])}}}))}}}));
