import{_ as $}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as I}from"./index.vue_vue_type_script_setup_true_lang-CgKUoL60.js?v=1773287522785";import{_ as R}from"./index.vue_vue_type_script_setup_true_lang-DG86e1NA.js?v=1773287522785";import"./index-BTglIPU2.js?v=1773287522785";import{u as F}from"./tools-BXr7PjJU.js?v=1773287522785";import{a as k,b as y}from"./index-DhnhmU-6.js?v=1773287522785";import{i as A}from"./ftp-SrpKmV1S.js?v=1773287522785";import{k as U,R as C,r as f,e as B,o as E,$ as N,a8 as V,a9 as l,a0 as s,_ as u,S as o,N as S}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as T,b as z}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./index-K4YGya6V.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./check-CNel7fTH.js?v=1773287522785";const L={class:"w-330px"},M={class:"w-330px"},Z={class:"w-330px"},pe=U({__name:"index",props:{data:{}},setup(c,{expose:h}){const w=c,{t:m}=C(),r=F(),i=f(null),d=f(null),a=B({ftp_username:"",ftp_password:"",path:r.addPath,ps:""}),b={path:k(),ftp_password:y({complex:{length:6}}),ftp_username:{trigger:["blur","change"],validator:(t,e)=>{if(e.length===0)return new Error(m("Ftp.Add.Index_2"));if(/^[a-zA-Z0-9_]+$/g.test(e)){if(e.length<3)return new Error(m("Ftp.Add.Index_4"))}else return new Error(m("Ftp.Add.Index_3"));return!0}}},v=()=>{const t=a.ftp_username;a.ps=t,t.length>0?a.path=r.addPath+"/"+t:a.path=r.addPath};return E(()=>{var t;(t=d.value)==null||t.focus()}),h({onConfirm:async()=>{var t,e,p;await((t=i.value)==null?void 0:t.validate()),await A(S(a)),(p=(e=w.data)==null?void 0:e.getList)==null||p.call(e),r.setRefresh(!0)}}),(t,e)=>{const p=z,_=T,x=R,g=I,P=$;return N(),V(P,{ref_key:"formRef",ref:i,model:o(a),rules:b,class:"w-530px px-20px pt-24px pb-12px"},{default:l(()=>[s(_,{label:t.$t("Public.Table.Username"),path:"ftp_username"},{default:l(()=>[u("div",L,[s(p,{value:o(a).ftp_username,"onUpdate:value":e[0]||(e[0]=n=>o(a).ftp_username=n),ref_key:"usernameRef",ref:d,placeholder:"","input-props":{name:"username"},onInput:v},null,8,["value"])])]),_:1},8,["label"]),s(_,{label:t.$t("Public.Table.Password"),path:"ftp_password"},{default:l(()=>[u("div",M,[s(x,{value:o(a).ftp_password,"onUpdate:value":e[1]||(e[1]=n=>o(a).ftp_password=n),placeholder:"","input-props":{name:"password"}},null,8,["value"])])]),_:1},8,["label"]),s(_,{label:t.$t("Ftp.Add.Index_1"),path:"path"},{default:l(()=>[u("div",Z,[s(g,{value:o(a).path,"onUpdate:value":e[2]||(e[2]=n=>o(a).path=n),placeholder:"","input-props":{name:"path"}},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])}}});export{pe as default};
